1
Is there any way to do this with redstone?
Hello, i just wanted to know what commands I should use on my vanilla server to stop people going out of a certain area without having a golden helmet on, i know it sounds weird, but my servers spawn is a square, and i would like people to take damage every second(doesnt have to be exact) when they are not inside the square, and they are not wearing a golden helmet. Any help would be much appreciated. I dont mind if it takes multiple command blocks on a 1tick clock. Just need a solution. Thanks.
Create an account or sign in to comment.
2
1
From Experience i would recommend using harming instead of wither as it is more malleable to soot your needs
1
First, do this command:
/scoreboard objectives add hasHelmet dummy
Use this attached to a 1 tick clock:
/scoreboard players set @a hasHelmet 0
/scoreboard players set @a[x=,y=,z=,dx=,dy=,dz=] hasHelmet 1
/scoreboard players set @a hasHelmet 1 {Inventory:[{Slot:103b,id:minecraft:golden_helmet}]}
/effect @a[score_hasHelmet=0] minecraft:wither 1 0
Make sure the commands are in order.
Change x, y, and z to the lowest (bottom north-west) coordinates of your area, and dx, dy, and dz to the dimensions of your area.
/scoreboard objectives add hasHelmet dummy
Use this attached to a 1 tick clock:
/scoreboard players set @a hasHelmet 0
/scoreboard players set @a[x=,y=,z=,dx=,dy=,dz=] hasHelmet 1
/scoreboard players set @a hasHelmet 1 {Inventory:[{Slot:103b,id:minecraft:golden_helmet}]}
/effect @a[score_hasHelmet=0] minecraft:wither 1 0
Make sure the commands are in order.
Change x, y, and z to the lowest (bottom north-west) coordinates of your area, and dx, dy, and dz to the dimensions of your area.