Package net.minecraft.world.level
Class BaseCommandBlock
java.lang.Object
net.minecraft.world.level.BaseCommandBlock
- Direct Known Subclasses:
MinecartCommandBlock.MinecartCommandBase
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe command stored in the command block.private Componentprivate static final Componentprivate long(package private) ComponentThe previously run command.private static final intprivate intThe number of successful commands run.private booleanprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract CommandSourceStackcreateCommandSourceStack(CommandSource commandSource) abstract ServerLevelgetLevel()getName()abstract Vec3intbooleanabstract booleanisValid()voidload(ValueInput input) abstract voidbooleanperformCommand(Level level) voidsave(ValueOutput output) voidsetCommand(String command) Sets the command.voidsetCustomName(Component customName) voidsetLastOutput(Component lastOutputMessage) voidsetSuccessCount(int successCount) voidsetTrackOutput(boolean shouldTrackOutput)
-
Field Details
-
DEFAULT_NAME
-
NO_LAST_EXECUTION
private static final int NO_LAST_EXECUTION- See Also:
-
lastExecution
private long lastExecution -
updateLastExecution
private boolean updateLastExecution -
successCount
private int successCountThe number of successful commands run. (used for redstone output) -
trackOutput
private boolean trackOutput -
lastOutput
The previously run command. -
command
The command stored in the command block. -
customName
-
-
Constructor Details
-
BaseCommandBlock
public BaseCommandBlock()
-
-
Method Details
-
getSuccessCount
public int getSuccessCount() -
setSuccessCount
public void setSuccessCount(int successCount) -
getLastOutput
-
save
-
load
-
setCommand
Sets the command. -
getCommand
-
performCommand
-
createSource
-
getName
-
getCustomName
-
setCustomName
-
getLevel
-
onUpdated
public abstract void onUpdated() -
setLastOutput
-
setTrackOutput
public void setTrackOutput(boolean shouldTrackOutput) -
isTrackOutput
public boolean isTrackOutput() -
usedBy
-
getPosition
-
createCommandSourceStack
-
isValid
public abstract boolean isValid()
-