Started by
Alec Cature
on
Topic category: Help with Minecraft modding (Java Edition)
Hello, I am attempting to make a very important item that when dropped, I do not want to be easily destroyed via explosions or despawned after the 5 minutes of it being on the ground. Is there a way to prevent these from happening?
As a bonus, if i can make it immune to cacti as well, that would be amazing but this isn't mandatory and I'm aware this can be much more difficult to achieve.
Edited by Alec Cature on Sat, 03/09/2024 - 20:40
Solved this issue! Here is the code for anyone else who wishes to do the same thing.
For the command, paste in this:
data merge entity @e[type=item,limit=1,nbt={Item:{id:"MOD:ITEM"}}] {Invulnerable:1b,Age:-32000}
and make sure to replace the 'MOD:ITEM' with your mod identifier and item name such as 'minecraft:iron_ingot'.