Block that detects distance from the player

Started by Ed8002 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Block that detects distance from the player

I'm trying to design a mod that adds an ore that when you're close to it at a distance of 3 blocks radius, it poisons you, but I can't find an "event" that allows me to make the block detect proximity to the player, does anyone have an idea of ​​how I can do it? :C

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In the advanced tab for the…
Wed, 08/21/2024 - 14:54

In the advanced tab for the block, check random tick, then in the update tick trigger, use for each entity, check if they are a subtype of player entity, then if they are give them the poison effect.