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

Started by bananarang_mods on Fri, 01/21/2022 - 06:29

Topic category: Help with modding (Java Edition)

Last seen on 01:46, 29. May 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Checking a player's distance from a certain type of block?
Fri, 01/21/2022 - 06:29

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 09:57, 17. Feb 2022
Joined Apr 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 01:35, 2. Apr 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 01:35, 2. Apr 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 01:35, 2. Apr 2022
Joined Dec 2021
Points:

User statistics:

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

*diameter

Last seen on 15:04, 28. May 2022
Joined Dec 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.