#Creating a radio but I lack the knowledge to have custom animations when using the item
10 messages · Page 1 of 1 (latest)
no way to do that with a resource pack alone
You'd need a datapack that swaps out the item (or changes the CustomModelData nbt of the item via an item modifier) when you detect the fungus on a stick being used.
oh! I already have a datapack that's detecting the r-click so thats convinient to hear that. I'll give it a shot
Okay update : I have no idea how to pull that off. Can i perhaps ask how you'd swap out items? @raw topaz
(anything I write in caps now has to be replaced with whatever you named your folders/files)
Make 2 .json files inside your data pack (YOURPACK/data/NAMESPACE/item_modifiers/) and name them something you remember.
Put this text in them (with different values):
{
"function": "minecraft:set_nbt",
"tag": "{CustomModelData:1}"
}
And in your rightclick detection function you add /item modify commands to swap to the respective CustomModelData value you need
(command would be item modify @s weapon.mainhand NAMESPACE:ITEM_MODIFER_NAME)
You'll probably have to check in some way whether the item was in your main or off hand and which one you currently held, but you could do that with advancements I guess (or however you detect the rightclick atm).
Okay! I'll give this a shot!
Ok I managed to pull off the swapping that you've instructed
it went as intended to swap, BUT, the main issue now becomes that whenever it swaps it gets pulled down (similar to when swapping between items; via down and back up motion while equipped by the player). By any chance do you perhaps know how to avoid that? @raw topaz
The only workaround I know is to give the item really slow attack speed so that it gets stuck at the bottom of that "swapping" animation (and never moves up) and adjust the display settings so that it is displayed higher.
dang -- thank you so much for the help so far btw