public interface CommandData extends DataManipulator<CommandData,ImmutableCommandData>
DataManipulator
handling all related Value
s for command
related DataHolder
s, such as CommandBlock
s and
CommandBlockMinecart
s.Modifier and Type | Method and Description |
---|---|
Value<Boolean> |
doesTrackOutput()
Gets whether this command block will keep track of the output from the
last command it executed.
|
OptionalValue<Text> |
lastOutput()
Gets the last command output.
|
Value<String> |
storedCommand()
Gets the currently stored command.
|
Value<Integer> |
successCount()
Gets the success count of the last executed command.
|
asImmutable, copy, fill, fill, from, set, set, set, set, transform
getContentVersion, toContainer
Value<String> storedCommand()
Keys.COMMAND
Value<Integer> successCount()
The success count is the number of times the most recently used command of this command block succeeded. Most commands can only succeed once per execution, but certain commands (such as those which accept players as arguments) can succeed multiple times, and this value will be set accordingly. This success count can also be polled via a redstone comparator.
Keys.SUCCESS_COUNT
Value<Boolean> doesTrackOutput()
Keys.TRACKS_OUTPUT
OptionalValue<Text> lastOutput()
This will only be available if doesTrackOutput()
is set to
true, otherwise Optional.empty()
will be returned.
Keys.LAST_COMMAND_OUTPUT