How can I make a command putting an effect on all players at a certain object?

How can I make a command putting an effect on all players at a certain object? - Crop faceless informal woman with opened notebook

I need a command where whenever a player stands at/in an object like a Cobweb, they will get a Wither effect. I can't seem to get my own one to work.



Best Answer

Put the following into an repeating command block:

/execute @a ~ ~ ~ detect ~ ~ ~ minecraft:web 0 effect @a[c=1] minecraft:wither DURATION_OF_EFFECT LEVEL_OF_WITHER_EFFECT

for example

/execute @a ~ ~ ~ detect ~ ~ ~ minecraft:web 0 effect @a[c=1] minecraft:wither 1 1

This will give everyone standing in an cobweb the wither effect

enter image description here




Pictures about "How can I make a command putting an effect on all players at a certain object?"

How can I make a command putting an effect on all players at a certain object? - From above of blank paper sheets of different colors scattered on table as abstract background
How can I make a command putting an effect on all players at a certain object? - Bokeh Photography of Person Holding Turned-on Iphone
How can I make a command putting an effect on all players at a certain object? - Vintage TV set on wooden bench



How do you make a command block give you a effect?

Using the effect command in Minecraft In order to give an effect, the syntax is: "/effect give <targets> <effect> [seconds] [amplifier] [hideParticles]". In order to remove an effect, it is: "/effect clear <targets> [effect]". The target tag refers to the username of the player.

How do you make an item give you an effect?

To make your command block run multiple commands, you will need to summon FallingSand or falling_block (depending on your version of Minecraft) with command blocks and redstone blocks for each command. The command blocks will be stacked one on top of the other and contain the individual command.



✔️ Make Items In Your Hand Give Players Abilities Minecraft! Make OP Weapons! ✔️




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Skylar Kang, Jill Burrow, Daria Shevtsova, Anete Lusina