Skip to content

Instantly share code, notes, and snippets.

@JamiesWhiteShirt
Last active July 16, 2017 16:38
Show Gist options
  • Save JamiesWhiteShirt/c82699be330151414e0b6b6cb1f01c98 to your computer and use it in GitHub Desktop.
Save JamiesWhiteShirt/c82699be330151414e0b6b6cb1f01c98 to your computer and use it in GitHub Desktop.
Incorrect command
public class CommandPing extends CommandBase {
@Override
public String getCommandName() {
return "ping";
}
@Override
public String getCommandUsage(ICommandSender sender) {
return "/ping <something>";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
if (args.length == 1) {
sender.addChatMessage(new TextComponentString(I18n.translateToLocal("commands.ping.success")));
} else {
throw new WrongUsageException(this.getCommandUsage(sender));
}
}
}
commands.ping.success=The server says pong
commands.ping.success=El servidor dice pong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment