Jump to content

How do I upgrade an item in hand?


Amperka_pro

Recommended Posts

Гугл переводчик извините ...

In general, I decided to work on NBT tags. Using the NbttagCompound class but ran into an incomprehensible problem. If I get the ItemStack via Minecraft.getMinecraft (). Player.getHeldItemMainHand () and use the item.setTagCompound (/ * something * /) method and then immediately throw the item, then the changes will not be applied, and if via PlayerInteractEvent.RightClickItem event
and get ItemStack item = event.getItemStack () then after operations with nbt and item drop, it will be applied. Why is that? I noticed that in the first case, if you install nbt and immediately open the inventory, then nbt will be applied, since the item will move up and then down. In the second case, the object will immediately move back and forth. How to do this with a method?

 

Версия Forge 1.12.2

 

Если вдруг есть русские:

Вообщем я решил поработать над тегами NBT. Используя класс NbttagCompound, но столкнулся с непонятной проблемой. Если я получу ItemStack через Minecraft.getMinecraft (). Player.getHeldItemMainHand () и после использую метод item.setTagCompound (/ * что то * /) и после сразу выкину предмет, то изменения не применяется, а если через PlayerInteractEvent.RightClickItem event
и получить ItemStack item = event.getItemStack () то после операций с nbt и дропа предмета, он применится. Почему так? Заметил, что в первом случае, если установить nbt и сразу открыть инвентарь, то nbt применится, так как предмет сдвинется вверх, а потом вниз. Во втором случае, предмет сразу туда-сюда передвинется. Как такое сделать методом?

Edited by Amperka_pro
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.