Need help making an Entity play a sound when it sets an attack target.

Started by _ShadowLink_ on

Topic category: Help with Minecraft modding (Java Edition)

Active 1 year ago
Joined Feb 2023
Points:
271

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 0
Need help making an Entity play a sound when it sets an attack target.

I'm looking for some help, or possibly an example of how to make an entity play a custom sound when it sets an attack target. I have the sound I plan to use and the entity already created, I'm just trying to figure out how I can implement this into my entity properly. The sound I want the entity to play gets spammed for each tick that the entity is chasing its target, and that, of course, is not what I want. I'm aware of a method involving NBT data tags, though I'm not exactly sure how to set it up properly. Any guidance or examples would be very much appreciated, as I am still a bit of a new MCreator user, and not very experienced in Java code. Thank you! ^-^