CommandBook icon indicating copy to clipboard operation
CommandBook copied to clipboard

Better handling of enchantments

Open LadyCailinBot opened this issue 11 years ago • 1 comments

CMDBOOK-2341 - Reported by Andy

Currently, you can only add enchantments with the /item and /give command if you enter the exact name from org.bukkit.enchantments.Enchantment. Those names aren't all very logical, and some doesn't correspond well to what they are generally called (Which is why the /enchantments command was added I suppose).

I would like to do something about this, and add an /enchant command in InventoryComponent based off the vanilla Minecraft-command with some improvements. In addition to the command handling there would need to be a way to transform user input to Enchantment-values/IDs.

Is this something you might be interested in? Additionally, I'm unsure as to where to send the PR in terms of the lookup-functions. I feel that it might be better to put this class in package com.sk89q.worldedit.blocks since the rest of the Item and Block-class/functions are there, where it may be used by WorldEdit/WorldGuard as well should there ever be a need to (/searchitem is a possibility).

LadyCailinBot avatar Dec 29 '13 13:12 LadyCailinBot

Comment by Andy

Here's what I was thinking for resolving Enchantment names/IDs/Aliases: https://github.com/andypandy89/worldedit/commit/d03ea61b965b919b3390fbc16d052f5b931116fe

Its structure is identical to ClothColor.java.

LadyCailinBot avatar Dec 29 '13 19:12 LadyCailinBot