CraftTweaker

CraftTweaker

151M Downloads

[1.15.2] /ct hand does not specify data type for enchantment levels, should be short

bcodegard opened this issue ยท 0 comments

commented

Issue Description:

Enchantment levels are stored as shorts. /data get reports this correctly.
/ct hand does not report data type, leading to undesired behavior.

What happens:

using /ct hand with an enchanted item gives nbt data with enchantment level given as unspecified type. For comparison, /data get correctly reports that the enchantment level is a "short"
Pasting the output of /ct hand into a script, for instance, as a recipe input, will not accept the item that /ct hand was performed on, due to this type mismatch.

output of /ct hand with a fortune III enchanted book (got from creative menu)
item:minecraft:enchanted_book.withTag({StoredEnchantments: [{lvl: 3, id: "minecraft:fortune" as string}]})

code needed to accept thie same book in a recipe:
item:minecraft:enchanted_book.withTag({StoredEnchantments: [{lvl: 3 as short, id: "minecraft:fortune" as string}]}),

What you expected to happen:

Expected copy-and-paste from /ct hand to work as-is in recipes

Script used (Please Pastebin or gist your script, posting an unpasted or ungist'd script will automatically close this issue):

https://gist.github.com/bcodegard/efdd84253933bfc2d4c4cb0fbad9e23b

crafttweaker.log file (Please Pastebin or gist your file, posting an unpasted or ungist'd file will automatically close this issue):

not an error, just undesired behavior


Affected Versions (Do not use "latest"):

  • Minecraft: 1.15.2
  • Forge: 31.2.36
  • Crafttweaker: CraftTweaker-1.15.2-6.0.0.24
  • Using a server: No
  • If yes, does the client have the exact same scripts?

Your most recent log file where the issue was present:

[pastebin/gist/etc link here]