how to make entity dance through procedure

Started by softmushroombaby on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how to make entity dance through procedure
Sat, 04/05/2025 - 06:41 (edited)

I'm trying to make it so a custom entity dances, or plays a different animation, when a player puts on a custom disc! But the code isn't working! Apparently, the "source entity" is causing problems? i don't understand, I'm new to this and don't understand dependancies

 

Heres a link version in case the image broke https://imgur.com/a/peNQtJt

 

Edited by softmushroombaby on Sat, 04/05/2025 - 06:41
Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If u want them to dance if a…
Thu, 04/03/2025 - 18:21

If u want them to dance if a certain song is playing I would instead set a NBT tag on the block on right click instead. Then on the blocks tick update in a radius of the block check for the mob. If the mob exists in the radius and has the tag make the entity the play the animation.( make sure u set a tag on the entry so the animation doesn’t repeat.)

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
also the entity wouldn’t be…
Thu, 04/03/2025 - 19:27

also the entity wouldn’t be the event target since ur checking if player right clicks block. It would just be the block not entity.

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you could use the block "for…
Thu, 04/03/2025 - 23:00

you could use the block "for each entity at xyz with radius n, as entity iterator, do"
if: entity iterator is of type weiss = true,
then: play animation and change texture. 

unless you want to use the entity on tick update procedure, to check for noteblocks with the correct disk within a certain radius. 

Joined Feb 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Life saver, this worked!!…
Fri, 04/04/2025 - 05:02

Life saver, this worked!! You're a lifesaver!

https://imgur.com/a/XjzFdF5

What I want to do now is 

  1. stop animation when disc is taken out of jukebox
  2. stop animation when entity is hit
Joined Feb 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
also is there a way to stop…
Fri, 04/04/2025 - 05:03

also is there a way to stop the entity from moving or looking around? i kinda want them to stick strictly to their animation

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
1: Ur gonna need to mark the…
Fri, 04/04/2025 - 06:49

1: Ur gonna need to mark the jukebox with a NBT(so u can check it across different procedures). Then on the entity tick update check in a radius if the block with the NBT exists. If not have a cancel animation to cancel the animation.

2. Use the if entity is hurt condition. If true then cancel the animation.

3. Just use the override motion block and set all to 0.

 

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
but wouldnt the animation…
Fri, 04/04/2025 - 08:39

but wouldnt the animation just start again at the next entitytickupdate? maybe a custom potion effect that is applied upon damage, and prevents the animation from starting. 

event: entitytickupdate
if NOT entity has potioneffect,
then if block with nbt exists
play animation

if starting the music is supposed to pacify an angered mob, that you have hit prior, the entity iterator procedure can remove the potion effect, maybe with a certain probability. 

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well u will need some kind…
Fri, 04/04/2025 - 12:34

Well u will need some kind of condition to stop animation from playing continuously. 

Joined Feb 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Good news!! I have a working…
Fri, 04/04/2025 - 13:00

Good news!! I have a working procedure for an entity stopping when hurt!

https://imgur.com/a/8Dy4KNR

I'm still lost on what to do on how to stop an entity when you turn the music off though-- I have no clue how NBTs work!

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Mmm so what u need is to use…
Fri, 04/04/2025 - 13:28

Mmm so what u need is to use the template option top left. There is a option for 6x6x6 to check blocks in an area. 
So use the trigger on tick update for the entity. Once u marked the block with the NBT tag on right click. U can use an “if” inside the 6x6x6 blocks to check for block that has the tag. If true make the entity dance.

I could make an example for u but I’m away from my computer atm.

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah, the 6x6x6 option is…
Fri, 04/04/2025 - 20:14

yeah, the 6x6x6 option is the best choice (although i think its actually a 7x7x7 template). The IF should set the provided "found" variable to true or false, which is then returned to the entiy. that way, it will stop the animation automatically, if the nbt stops being found. you then only have to remove the nbt, when it stops playing. you can set the procedure that initially gives the nbt value, to remove the value, after the right amount of ticks (theres a block for that). since the procedure already gives the nbt tag, when you rightclick WITH the music disk, just make rightclicking a jukebox with anything other than the disk remove the tag. 

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes doing that should work. …
Fri, 04/04/2025 - 21:12

Yes doing that should work.

 To answer your question. NBTs are like locals but they are saved and don’t reset unless the entity dies or leaves the game. They are like global variables but are not permanent. Local variables don’t save and reset once the procedure ends.

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
👍Np
Sat, 04/05/2025 - 06:37

👍Np