How to make if your close to a block give you a specific potion effect ?

Started by Loqman520 on

Topic category: Help with modding (Java Edition)

Last seen on 12:43, 23. May 2023
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make if your close to a block give you a specific potion effect ?

Hello

 

I want to make something, if your close to a certain block it give you a potion effect, how I make that ?

Last seen on 12:28, 25. Apr 2024
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
on block tick update    if…
Thu, 05/18/2023 - 07:35

on block tick update

 

 if entity is in range = (your range)

       add potion effect (your effect) to event/target entity with duration (duration)

 

 

This code is just speculation and it is possible that this wont work but i would give it a try