Adding potion effect to all entities and an extra one for the player when an item is used

Started by IsabelleTheStoop on

Topic category: Help with modding (Java Edition)

Last seen on 10:28, 14. Mar 2022
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Adding potion effect to all entities and an extra one for the player when an item is used

So the item I'm trying to make is pretty complex, so I'm just going to say what I'm making:

I'm trying to make the Time Stopper weapon from Megaman 2.
My idea was to add slowness and mining fatigue to every entity and then add speed and haste to the user of the item.

However, I don't really understand to do this. I know that I have to make a procedure to affect every entity and the player, but I can't figure it out.

Honestly, my main problem is that I don't know how to affect every entity and the player. I'm trying to use the "Add Potion with level # for # ticks ambient..." block.
Mainly, I don't know how to address the block to affect every entity.

Last seen on 15:39, 14. Sep 2024
Joined Dec 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Why not use commands? …
Thu, 02/24/2022 - 21:03

Why not use commands?
/effect give @e[type=!player] slowness

 

Last seen on 15:39, 14. Sep 2024
Joined Dec 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This gives an effect to all…
Thu, 02/24/2022 - 21:04

This gives an effect to all entities except players

Last seen on 08:44, 30. Sep 2024
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So pretty much, you just…
Thu, 03/31/2022 - 11:11

So pretty much, you just have to make a procedure when the power/item is used to do this:

 

For each entity in square cube size [200] As entity iterator

   Give entity iterator potion effect slowness [amplifier and duration anything you want]

   Give entity iterator potion effect mining fatigue [amplifier and duration anything you want]

 

Clear all potion effects from Event/Target entity type: slowness

Clear all potion effects from Event/Target entity type: mining fatigue

Give Event/Target entity potion effect speed [amplifier and duration anything you want]

Give Event/Target entity potion effect haste [amplifier and duration anything you want]

 

And remember, don't mess up where to put Event/Target Entity or Entity Iterator because that'll change everything.

Good luck!