Started by
fenixgalax
on
Topic category: Help with Minecraft modding (Java Edition)
Good day!
Im very new to this and im trying to make a mod that would make mobs like skeletons zombies and such drop all their equipped gear on death....
Is the a simple way to do it or do i need to make a loot table for each individual mob?
thanks for any help.
There is a simple way to do this. The chance of a mob dropping its armor and held items is determined by an NBT tag. This means you can make a procedure that triggers when an entity spawns, checks if the entity is a monster, and, if it is, overrides that NBT tag to be 1. (Guaranteed 100% chance- by default, it's more like 0.02, or 2%.) You can do this by either using a data merge command, or by using NBT modifier functions in MCcreator, and it'll work for any monster entity that can have stuff equipped. (If you look at the items tab of this command generator, it should give you the tags you need.)
would i need to do this for each individual mob or will it work for all at once?
so i made a tag that puts all the mobs i want to drop gear in one group....
now im trying to make a procedure that would make all the mobs with that tag change their nbt for gear drop to 100% chance but im not sure what to use and in which order....
Please help!!!
Thank you in advance.
You just need a procedure with the 'when entity spawns' global trigger.
Then you need an 'if' bracket that checks if your entity has your custom tag.
If it does, inside the if bracket, you want to run a command that changes the Hand-drop-chance NBT tag to 1.0, using a command that targets the nearest entity. (You would use /data, which allows you to override NBT tags.) The specific command I use for this is:
...Where you replace type with the registry name of the entity you want. 0.2f gives a 20% chance of tropping, and 0.1f gives a 10% chance. You would want to replace all of these with 1.0f.
i actually managed to do it without checking for the entity.
just placed run command with your code and i adjusted it to 100% drop in the spawn event of the mob.