[SOLVED] Play sound every x ticks when riding entity

Started by damiansb on

Topic category: Help with modding (Java Edition)

Last seen on 00:48, 29. Oct 2020
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[SOLVED] Play sound every x ticks when riding entity
Mon, 06/08/2020 - 15:00 (edited)

Hello, guys. I'm new to MCreator and Modding.

I'm trying to make a procedure to play an engine sound when I'm riding an entity.

I have a 1.5 second seamless (30 ticks duration?)  engine sound, so I guessed the best way to do it was in the "OnEntityTickUpdate" procedure, and I created the following:

I declared a local variable of the type number to handle the tick_counter:

On Tick Update Procedure

It doesn't seem to work, and now I'm kinda stuck. 

I don't even know if this is the best way to do it... I'm pretty new, so any help would be appreciated.

Update 08/06/2020

Nevermind, guys. I figured out all I had to do was using NBT Tags instead of local variables. Now I understand the difference.

If anyone is curious about, the final procedure looks like this:

Final procedure

 

Edited by damiansb on Mon, 06/08/2020 - 15:00
Last seen on 19:53, 2. Jun 2021
Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
im trying to check that out,…
Mon, 07/27/2020 - 06:13

im trying to check that out, do i need to make anything besides that? like creating variables?

Last seen on 19:53, 2. Jun 2021
Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
its crashing my world on…
Mon, 07/27/2020 - 06:16

its crashing my world on creation

Last seen on 19:53, 2. Jun 2021
Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
oh nvm it was crashing…
Mon, 07/27/2020 - 06:33

oh nvm it was crashing because of my error, thanks for that code!

Last seen on 19:04, 29. Oct 2022
Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ok I'm sure this is a noob…
Sun, 01/10/2021 - 17:28

ok I'm sure this is a noob question but where is the (if Get Event/target entity...) 1/3 of the way down and (if is Event/target entity s...) 2/3 of the way down in the Final product pic located in the block procedures files?????

Last seen on 19:04, 29. Oct 2022
Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
guess i'm not going to get…
Wed, 05/19/2021 - 02:48

guess i'm not going to get an answer