I'm building a Minecraft map in version 1.15.2!
I want to do a challenge that if you kill an Elder Guardian then a lever is dropped.
How does this work?
I guess with a execute command, but I don't know exactly.
I thank you in advance for your help👌
You can do this simply by putting a lever in the guardian's inventory
/ data merge entity @e [type = elder_guardian, limit = 1, sort = nearest] {HandItems: [{id: "minecraft: lever", Count: 1b}, {}], HandDropChances: [2.000F, 0.085F] }
But still no lever is dropped.
Try it like this:
/ data merge entity @e [type = elder_guardian, limit = 1, sort = nearest] {HandItems: [{id: "minecraft: lever", Count: 1b}, {}], HandDropChances: [1,000F, 0.085F] }
How should I connect the command blocks? I once have the command block with the summon command and the one with the data command… Should I simply combine the two command blocks with redstone?
The / data command causes an existing guardian to drop the lever.
With this command you can directly spawn one that drops a lever: (then you no longer need the other one)
/ summon minecraft: elder_guardian ~ ~ ~ {HandItems: [{id: "minecraft: lever", Count: 1b}, {}], HandDropChances: [1,000F, 0.085F]}
Okay thanks