Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

How do I upgrade an item in hand?


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 - 1.16

 

If anyone knows at 1.12 then tell me, at 1.16 it will do too

Link to post
Share on other sites
5 minutes ago, Amperka_pro said:

If anyone knows at 1.12 then tell me, at 1.16 it will do too

That is not how this works.

State the version you are actually using, the answer might be vastly different.

Link to post
Share on other sites
3 минуты назад diesieben07 сказал:

Это не так.

Укажите версию, которую вы используете, ответ может сильно отличаться.

If I write 1.12, then you will close the question, and if 1.16 then it may not match. How to be?

Edited by Amperka_pro
Link to post
Share on other sites
2 minutes ago, diesieben07 said:

Обновитесь до 1.16, тогда мы вам поможем. Оставайтесь на версии 1.12, и вам не помогут. Просто как тот.

 

Это ваше последнее предупреждение.

Well, buy a normal computer, then I'll upgrade. Of course it's easy to say, they themselves would have been in my shoes.

Link to post
Share on other sites
Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.