Class BaseCommandBlock

java.lang.Object
net.minecraft.world.level.BaseCommandBlock
All Implemented Interfaces:
CommandSource
Direct Known Subclasses:
MinecartCommandBlock.MinecartCommandBase

public abstract class BaseCommandBlock extends Object implements CommandSource
  • Field Details

    • TIME_FORMAT

      private static final SimpleDateFormat TIME_FORMAT
    • DEFAULT_NAME

      private static final Component DEFAULT_NAME
    • lastExecution

      private long lastExecution
    • updateLastExecution

      private boolean updateLastExecution
    • successCount

      private int successCount
    • trackOutput

      private boolean trackOutput
    • lastOutput

      @Nullable private Component lastOutput
    • command

      private String command
    • name

      private Component name
  • Constructor Details

    • BaseCommandBlock

      public BaseCommandBlock()
  • Method Details

    • getSuccessCount

      public int getSuccessCount()
    • setSuccessCount

      public void setSuccessCount(int p_45411_)
    • getLastOutput

      public Component getLastOutput()
    • save

      public CompoundTag save(CompoundTag p_45422_)
    • load

      public void load(CompoundTag p_45432_)
    • setCommand

      public void setCommand(String p_45420_)
    • getCommand

      public String getCommand()
    • performCommand

      public boolean performCommand(Level p_45415_)
    • getName

      public Component getName()
    • setName

      public void setName(@Nullable Component p_45424_)
    • sendSystemMessage

      public void sendSystemMessage(Component p_220330_)
      Specified by:
      sendSystemMessage in interface CommandSource
    • getLevel

      public abstract ServerLevel getLevel()
    • onUpdated

      public abstract void onUpdated()
    • setLastOutput

      public void setLastOutput(@Nullable Component p_45434_)
    • setTrackOutput

      public void setTrackOutput(boolean p_45429_)
    • isTrackOutput

      public boolean isTrackOutput()
    • usedBy

      public InteractionResult usedBy(Player p_45413_)
    • getPosition

      public abstract Vec3 getPosition()
    • createCommandSourceStack

      public abstract CommandSourceStack createCommandSourceStack()
    • acceptsSuccess

      public boolean acceptsSuccess()
      Specified by:
      acceptsSuccess in interface CommandSource
    • acceptsFailure

      public boolean acceptsFailure()
      Specified by:
      acceptsFailure in interface CommandSource
    • shouldInformAdmins

      public boolean shouldInformAdmins()
      Specified by:
      shouldInformAdmins in interface CommandSource
    • isValid

      public abstract boolean isValid()