Package org.bukkit.block
Interface CommandBlock
- All Superinterfaces:
- BlockState,- CommandBlockHolder,- Metadatable,- PersistentDataHolder,- TileState
Represents a captured state of a command block.
- 
Method SummaryModifier and TypeMethodDescriptionGets the command that this CommandBlock will run when powered.getName()Deprecated.name()Gets the name of this CommandBlock.voidSets the name of this CommandBlock.voidsetCommand(@Nullable String command) Sets the command that this CommandBlock will run when powered.voidDeprecated.in favour ofname(net.kyori.adventure.text.Component)Methods inherited from interface org.bukkit.block.BlockStategetBlock, getBlockData, getChunk, getData, getDrops, getDrops, getDrops, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isCollidable, isPlaced, setBlockData, setData, setRawData, setType, update, update, updateMethods inherited from interface io.papermc.paper.command.CommandBlockHoldergetSuccessCount, lastOutput, lastOutput, setSuccessCountMethods inherited from interface org.bukkit.metadata.MetadatablegetMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.block.TileStategetPersistentDataContainer, isSnapshot
- 
Method Details- 
getCommandGets the command that this CommandBlock will run when powered. This will never return null. If the CommandBlock does not have a command, an empty String will be returned instead.- Specified by:
- getCommandin interface- CommandBlockHolder
- Returns:
- Command that this CommandBlock will run when powered.
 
- 
setCommandSets the command that this CommandBlock will run when powered. Setting the command to null is the same as setting it to an empty String.- Specified by:
- setCommandin interface- CommandBlockHolder
- Parameters:
- command- Command that this CommandBlock will run when powered.
 
- 
getNameDeprecated.in favour ofname()Gets the name of this CommandBlock. The name is used with commands that this CommandBlock executes. This name will never be null, and by default is "@".- Returns:
- Name of this CommandBlock.
 
- 
setNameDeprecated.in favour ofname(net.kyori.adventure.text.Component)Sets the name of this CommandBlock. The name is used with commands that this CommandBlock executes. Setting the name to null is the same as setting it to "@".- Parameters:
- name- New name for this CommandBlock.
 
- 
nameGets the name of this CommandBlock. The name is used with commands that this CommandBlock executes. This name will never be null, and by default is aTextComponentcontaining@.- Returns:
- Name of this CommandBlock.
 
- 
nameSets the name of this CommandBlock. The name is used with commands that this CommandBlock executes. Setting the name to null is the same as setting it to aTextComponentcontaining@.- Parameters:
- name- New name for this CommandBlock.
 
 
- 
name()