How do I make it so my mob can be sheered?

Started by Zenkrak983 on Sat, 01/15/2022 - 02:56

Topic category: Help with modding (Java Edition)

Last seen on 03:56, 20. Jan 2022
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How do I make it so my mob can be sheered?
Sat, 01/15/2022 - 02:56

I want to make a little stone guy with a flower on his head and I want it to be able to be sheered with sheers to take off the flower so how would I do that?

I need to make it so 1. I can hold sheers and right click to take of the flower and spawn an item 2. I want it to take some time before the flower comes back 3. I want it to change textures once its sheered.

Last seen on 21:13, 20. Jan 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Have 2 seperate models and a…
Sun, 01/16/2022 - 04:07

Have 2 seperate models and a living entity for each model. Create a model for of the stone guy before he's sheared and a model for after he is sheared. 

Create a procedure for when the non-sheared stone guy is right clicked on while the player is holding shears, it will despawn the non-sheared stone guy and spawn in the sheared stone guy. 

 

For the sheared stone guy, create a procedure for OnEntityInitialSpawnIn. Set NBT number tag "age" to 0. Create a procedure for OnEntityTickUpdate and set NBT number tag "age" to get NBT number tag "age"+1. After that use an if statement and do "if get NBT tag number "age" equals (however long you want it to take before the stone guy can be sheared again), then despawn sheared stone guy and spawn in non-sheared stone guy.