Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- registerCommand(new ModCommand(this, "item", ".item [enchant] [add|list] [id] [level]",
- "Enchants the current item.") {
- @Override
- public void onCommand(String msg, String... args) {
- try {
- if(Client.getController().isInCreativeMode()) {
- if(args[0].equalsIgnoreCase("item")) {
- if(args[1].equalsIgnoreCase("enchant")) {
- if(args[2].equalsIgnoreCase("add")) {
- if(Client.getPlayer().inventory.getCurrentItem() != null) {
- Client.getPlayer().inventory.getCurrentItem().addEnchantment(
- Enchantment.enchantmentsList[Integer.parseInt(args[3])], Integer.parseInt(args[4]));
- Player.addMessage("Added the enchantment: "
- + Enchantment.enchantmentsList[Integer.parseInt(args[3])].getTranslatedName(Integer.parseInt(
- args[4])) + " to your current item!");
- } else {
- Player.addMessage("Please have a item selected!");
- }
- } if(args[0].equalsIgnoreCase("item")) {
- if(args[1].equalsIgnoreCase("enchant")) {
- if(args[2].equalsIgnoreCase("list")) {
- for(int var0 = 0; var0 < Enchantment.enchantmentsList.length; var0++) {
- Enchantment enchantment = (Enchantment)Enchantment.enchantmentsList[var0];
- if(enchantment != null) {
- Player.addMessage("[" + Colours.RED + var0 + Colours.RESET + "] "
- + enchantment.getTranslatedName(var0));
- }
- }
- }
- }
- }
- }
- }
- } else {
- Player.addMessage("You can't use this command unless your in creative.");
- }
- } catch(Exception exception) {
- Player.addMessage("Syntax: " + getUsage());
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement