public interface CommandBlockSource extends Locatable, CommandSource, DataHolder
Modifier and Type | Method and Description |
---|---|
default Value<Boolean> |
doesTrackOutput()
Gets whether this command block will keep track of the output from the
last command it executed.
|
default CommandData |
getCommandData()
Gets the
CommandData for this source. |
default OptionalValue<Text> |
lastOutput()
Gets the last command output.
|
default Value<String> |
storedCommand()
Gets the currently stored command.
|
default Value<Integer> |
successCount()
Gets the success count of the last executed command.
|
getLocation, getWorld
getLocale, getName
getMessageChannel, sendMessage, sendMessage, sendMessage, sendMessages, sendMessages, setMessageChannel
asSubjectReference, getCommandSource, getContainingCollection, getOption, getOption, getParents, getParents, getPermissionValue, getSubjectData, getTransientSubjectData, hasPermission, hasPermission, isChildOf, isChildOf, isSubjectDataPersisted
getActiveContexts, getFriendlyIdentifier, getIdentifier
setRawData, validateRawData
getContentVersion, toContainer
getApplicableProperties, getProperty
default CommandData getCommandData()
CommandData
for this source.default Value<String> storedCommand()
default 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.
default Value<Boolean> doesTrackOutput()
default OptionalValue<Text> lastOutput()
This will only be available if doesTrackOutput()
is set to
true, otherwise Optional.empty()
will be returned.