Checking a player's distance from a certain type of block?

Started by bananarang_mods on

Topic category: Help with modding (Java Edition)

Last seen on 13:59, 19. May 2023
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Checking a player's distance from a certain type of block?

I'm testing something in my mod where if the player goes near a sunflower at day they get positive status effects, but I don't know how to do this- anyone know how? (I might need a screenshot of the working procedure)

Last seen on 22:09, 24. Dec 2023
Joined Apr 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You'd wanna check for…
Sun, 02/13/2022 - 16:29

You'd wanna check for Sunflower blocks in the vicinity of the player by constantly checking all blocks around player in a certain radius. What vicinity were you thinking about? if it's more than a few blocks this is not a good idea because of the lag it would create

Last seen on 22:34, 11. Feb 2023
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There is a procedure…
Tue, 02/15/2022 - 23:52

There is a procedure template to check for a block in a 6x6x6 radious

Last seen on 22:34, 11. Feb 2023
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
also it is not that laggy…
Tue, 02/15/2022 - 23:52

also it is not that laggy even for a nine block radious

Last seen on 22:34, 11. Feb 2023
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
*diameter
Wed, 02/16/2022 - 16:11

*diameter

Last seen on 20:00, 16. Apr 2024
Joined Dec 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could also use the "on…
Wed, 02/16/2022 - 16:52

You could also use the "on plant update tick" procedure on the sunflower and use the "does entity exist in X radius" procedure block and set the entity to player, then use the apply potion effect procedure block and set it to your custom potion effect, this could be less laggy than the other one.