CraftTweaker

CraftTweaker

151M Downloads

[Feature Request] IItemStack constructor from a string

Seraphaestus opened this issue ยท 1 comments

commented

Feature request name
IItemStack constructor from a string

Feature request description
The ability to construct an IItemStack of an item from a string containing that item's ID. Same functionality as the item bracket handler except the ID doesn't have to hardcoded.

val item as IItemStack;
item.get("minecraft:grass"); //functions the same as "item = <minecraft:grass>"

Or similar, this may not be the best syntax for it.

Feature request reason
Sometimes item IDs are viable to be programatically constructed - e.g. iceandfire's "dragon_egg_<color>". Let's say I want to reference something else with an ID "some_string_<color>" (e.g. a recipe where the latter is an ingredient for the former), I'm unable to programatically optimise the code and have to enter each ID manually, which is unwieldy and creates clutter.

Feature request dependencies
None