Package io.papermc.paper.command

# Interface CommandBlockHolder

All Known Subinterfaces:
  `CommandBlock`, `CommandMinecart`

public interface CommandBlockHolder

## Method Summary

Modifier and Type
Method
Description
`@NotNull String`
`getCommand()`
Gets the command that this CommandBlock will run when powered.
`int`
`getSuccessCount()`
Gets the success count from this command block.
`@NotNull Component`
`lastOutput()`
Gets the last output from this command block.
`void`
`lastOutput(@Nullable Component lastOutput)`
Sets the last output from this command block.
`void`
`setCommand(@Nullable String command)`
Sets the command that this CommandBlock will run when powered.
`void`
`setSuccessCount(int successCount)`
Sets the success count from this command block.

## Method Details

### getCommand

@NotNull @NotNull String getCommand()
Gets 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.

Returns:
  Command that this CommandBlock will run when activated.

### setCommand

void setCommand(@Nullable @Nullable String command)
Sets the command that this CommandBlock will run when powered. Setting the command to null is the same as setting it to an empty String.

Parameters:
  `command` - Command that this CommandBlock will run when activated.

### lastOutput

@NotNull @NotNull Component lastOutput()
Gets the last output from this command block.

Returns:
  the last output

### lastOutput

void lastOutput(@Nullable @Nullable Component lastOutput)
Sets the last output from this command block.

Parameters:
  `lastOutput` - the last output

### getSuccessCount

int getSuccessCount()
Gets the success count from this command block.

Returns:
  the success count
See Also:
  - Command_Block#Success_count

### setSuccessCount

void setSuccessCount(int successCount)
Sets the success count from this command block.

Parameters:
  `successCount` - the success count
See Also:
  - Command_Block#Success_count