Topic category: Advanced modding
I want to give a block a conditionally animated model, I already know a tile entity will be required for this. I am also aware that I'm going to have to write code myself for this to work.
Here's a basic rundown of what I'm trying to do:
- Put a custom model on a tile entity
- Trigger an animation when an NBT number tag on the tile entity is greater than 0
I don't need any help with adding the animation itself (unless animations work differently on tile entities than they do on mobs)
Update: people keep suggesting that I use a static model with an animated texture. This is not what I am looking for.
Creating a TESR seems to be the way to go, but I don't really know how to do that.
Most importantly though, and this is something nobody has told me about yet, is how to get the tile entity's NBT data and use it in arbitrary locations throughout the entity's code (like within the animation function).
I just use a second block thats a duplicate of the first, just with an animated texture.
Wont work, not smooth and not conditional
I mean, i found a way to make it work based on block update conditions. I personally rarely use NBT data for much. Ima look into how to streamline doing this stuff without secondary blocks.
I did a tutorial about that long time ago, you can find it here
https://mcreator.net/wiki/advanced-video-tutorials
The process is exactly the same this days
but if you also want to make Large weapons than you can directly access its Json file from MCreator Now :)
Thanks for trying to help, but this is the same method as was suggested above.
I specifically need a tile entity, as the animation needs to change based on NBT data and other variables, and a static model with animated textures just doesn't have the flexibility I need.
Think like a gauge that rotates based on how many items are stored in the block, or a counter that measures the length of a redstone pulse in ticks.
Then there is no other way than changing the state of your tile entity with actual coding sorry :c