1.21: Allow to cast Component to IData
kindlich opened this issue ยท 0 comments
Describe the feature you'd like
If we want to use Text Components for setJsonComponent
calls we need it castable to IData
// This works
itemDef.setJsonComponent(<componenttype:minecraft:lore>, ["line1", "line2", "line3"]);
// This doesnt
itemDef.setJsonComponent(<componenttype:minecraft:lore>, [Component.translatable("tooltip.test.line1"), Component.translatable("tooltip.test.line2")]);
Describe alternatives you've considered
In this case, we could also check if ItemLore is castable to IData.
Additional context
Original Discord Discussion: https://canary.discord.com/channels/136877912698650625/1253211465645686824/1254193611831247008
Minecraft version
1.21
Modloader
NeoForge