Started by
Luigi999999
on
Topic category: Help with Minecraft modding (Java Edition)
I would like to create a procedure : if I kill a (custom) mob, it has the chance to drop an item with a low chance but if you have a specific item in your inventory, the mob drops it with a higher chance. I already tried using a If/Else procedure but it didn't work (maybe I did something wrong). Thank you in advance
I have used “Random0,1 < 0.5” and I tried to put them one below the other.. Did I miss something?
It should work like this, yes. Maybe post a picture of your procedure and trigger settings.
Maybe make a procedure if (item) is = to entities main hand
if random 0,1 < 0.5 (drop item) at x y z
put this with the when mob killed procedure
Link to the Console error: https://pastebin.com/VBkw9bTy
Link to the procedure code: https://pastebin.com/fY9gz3tV
Link to the entity that drops the items (A mob called "Hit"): https://pastebin.com/2W9hLsnM
This is my procedure: https://imgur.com/gallery/jOtQvT9
Thank you in advance :)
The issue is here: https://imgur.com/OKJwsen
You are checking if the entity has something in the inventory, but this is checking the mob you kill, not your inventory. Avoid using this as this block is causing the crash.
Thank you. But how can I check if the player has that item in the inventory , then increases the drop rate? Is it possible?
It will be possible once this feature request will be implemented, so you will have two entity types - target and user: https://mcreator.net/tracker/issue/45976