Started by
mememem
on
Topic category: Help with Minecraft modding (Java Edition)
I am making a mob that is supposed to drop 1-2 diamonds if it got killed by a player, I don't know how to write a procedure for that please help.
Topic category: Help with Minecraft modding (Java Edition)
I am making a mob that is supposed to drop 1-2 diamonds if it got killed by a player, I don't know how to write a procedure for that please help.
This is the quickest way I could think of with procedures. (change pig to your mob and the random chance to desired number)
https://imgur.com/a/m6JCvfU
I tried out your procedure but the mob drop up to 4 diamonds when player killed, I deleted everything in the "else" tail part and that made the mob drop 1-2 each time, with 0 on occasion. The number I was looking for is 100% for one to drop, with 50% for a second one, thanks anyway.
Update: I was successfully able to created what I wanted, I modified your procedure and deleted the Targer Entity specification and it worked out fine, I think the field specifically is what caused the problem where the first drop got duplicated. Here is the procedure for those that want to copy.
That's strange since I tested it 10+ times and always got either 1 diamond or 2 diamonds, never more than 2.
Also the target part was just there since I didn't have a mob that could have it connected to a trigger ( which I am guessing is how you have connected it ) if you did then it probably ran it twice, one for the procedure target and one for the connected trigger
My workspace is in 1.19.2, so my guess is probably version difference.
This is the procedure, repost it since the forum is deleting our pictures.
https://imgur.com/3GVSeJ4
also I just want to ask, about the procedure, now I wanted the mob to have a 10% chance to drop the third diamond, so the drop requirement should be 50% chance to drop one, 40% to drop two and 10% to drop three.
Oh yeah I can imagine the workspace version being an issue since mines a newer one.
This is not mine this is from a discord user. (change the greater and equal/lesser and equal to not have the equals part)
https://imgur.com/a/0o0tOiz
Oh and in that the number 80 circled should be 79
This procedure (https://imgur.com/a/0o0tOiz) still limit drops to a player kill right? i don't see the source entity as a player.
you'd have to add that part. That procedure is just something someone made to have a drop chance loot table
I ended up making an improvement on the already working mechanic and it now work like a charm.
https://i.imgur.com/vQdO0qh.png