001 package org.bukkit.block; 002 003 public interface CommandBlock extends BlockState { 004 005 /** 006 * Gets the command that this CommandBlock will run when powered. 007 * This will never return null. If the CommandBlock does not have a 008 * command, an empty String will be returned instead. 009 * 010 * @return Command that this CommandBlock will run when powered. 011 */ 012 public String getCommand(); 013 014 /** 015 * Sets the command that this CommandBlock will run when powered. 016 * Setting the command to null is the same as setting it to an empty 017 * String. 018 * 019 * @param command Command that this CommandBlock will run when powered. 020 */ 021 public void setCommand(String command); 022 023 /** 024 * Gets the name of this CommandBlock. The name is used with commands 025 * that this CommandBlock executes. This name will never be null, and 026 * by default is "@". 027 * 028 * @return Name of this CommandBlock. 029 */ 030 public String getName(); 031 032 /** 033 * Sets the name of this CommandBlock. The name is used with commands 034 * that this CommandBlock executes. Setting the name to null is the 035 * same as setting it to "@". 036 * 037 * @param name New name for this CommandBlock. 038 */ 039 public void setName(String name); 040 }