Interface CommandMinecart

All Superinterfaces:
Audience, CommandBlockHolder, CommandSender, Entity, HoverEventSource<HoverEvent.ShowEntity>, Metadatable, Minecart, Nameable, Permissible, PersistentDataHolder, Pointered, ServerOperator, Sound.Emitter, Vehicle

public interface CommandMinecart extends Minecart, CommandBlockHolder
  • Method Details

    • getCommand

      @NotNull @NotNull String getCommand()
      Gets the command that this CommandMinecart will run when activated. This will never return null. If the CommandMinecart does not have a command, an empty String will be returned instead.
      Specified by:
      getCommand in interface CommandBlockHolder
      Returns:
      Command that this CommandMinecart will run when powered.
    • setCommand

      void setCommand(@Nullable @Nullable String command)
      Sets the command that this CommandMinecart will run when activated. Setting the command to null is the same as setting it to an empty String.
      Specified by:
      setCommand in interface CommandBlockHolder
      Parameters:
      command - Command that this CommandMinecart will run when activated.
    • setName

      @Deprecated void setName(@Nullable @Nullable String name)
      Sets the name of this CommandMinecart. The name is used with commands that this CommandMinecart executes. Setting the name to null is the same as setting it to "@".
      Parameters:
      name - New name for this CommandMinecart.