How to trigger sound and overlay based on proximity to custom structure

Started by Figby2012 on

Topic category: Help with modding (Java Edition)

Last seen on 16:25, 28. Apr 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to trigger sound and overlay based on proximity to custom structure

I am trying to create a mod that replicates the effect in the video linked below. I have already made a structure which generates properly, and I have the sound and overlay image imported into MCreator. I just need to know how to make the sound and overlay appear when nearing the structure and then go away. The structure is not a standard structure it generates as a feature if that makes any difference.

 

 https://www.reddit.com/r/thomastheplankengine/comments/t20gx4/mojang_added_pirate_ships_as_randomlygenerated/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

Last seen on 06:38, 6. May 2024
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you can get the location…
Sun, 04/28/2024 - 09:58

If you can get the location of the structure, use the formulae:

distance = absolute(square root((structure x - player x)^2)+(structure y - player y)^2)+(structure y - player y)^2))

Last seen on 06:38, 6. May 2024
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
distance = absolute(square…
Sun, 04/28/2024 - 09:59

distance = absolute(square root((structure x - player x)^2)+(structure y - player y)^2)+(structure z - player z)^2)), sorry