#Is there a way to change the totem you see in your inventory and when it gets popped
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
also btw i tried to make a custom sound for totem pop, i put it in the minecraft/sounds/item/totem directory and called it use_totem.ogg and yet it still didn't play. the audio file isn't that big so idk whats wrong
<@&1166082198152159386> <@&1202694677766348840>
Please note that you still might not immediately get a response since all helpers are human beings and volunteers (and also might be sleeping right now)
for what version? i feel like item model definitions in 1.21.4+ should be able to do this
im not sure offhand and cant test it myself atm, but i believe that the game uses the fixed display context for the popped totem. note that if i'm right then my solution would display that model in item frames as well
just was looking at the code and can confirm this
its for 1.21.4 can u tell me a basic idea of what i should do?
You can make an item model that changes based on GUI context
Here's the spyglass item model for reference
As for the sound, while the vanilla sound is hardcoded, you could remove the sound and use a different sound
so correct me if I'm wrong, the spyglass has the model of minecraft:item/spyglass when in the gui if like your inventory or chest, when its floating on the ground, or fixed like in an item frame i think, however otherwise it will have the model of spyglass_in_hand?
yes, exactly
what would the property be for when the totem pops be then
the fixed gui context
that gui context is used for items that are:
- floating on the screen (only in vanilla for totem popping)
- on campfires
- emerging from a suspicious block
- in an item frame
where would i put the file, in my models folder or in the items folder like in the github directory?
the items folder
i made it something like this but it didn't really work
{
"model": {
"type": "minecraft:select",
"cases": [
{
"model": {
"type": "minecraft:model",
"model": "minecraft:textures/item:totem2"
},
"when": [
"gui"
]
}
],
"fallback": {
"type": "minecraft:model",
"model": "minecraft:textures/item:totem_of_undying"
},
"property": "minecraft:display_context"
}
}
the model field references a model in the models folder
so minecraft:item/totem_of_undying would reference a file at
assets/minecraft/models/item/totem_of_undying.json
you need both an item definition file (the file in the items folder) and a model file (the file in the models folder)
also
"gui"
i said to use "fixed"
i made a file at assets/minecraft/models/item/totem_of_undying.json which has this
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "minecraft:item/totem_of_undying"
}
}
and another file at assets/minecraft/models/item/totem2.json which has this
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "minecraft:item/totem2"
}
}
both of the textures are valid
minecraft:textures/item:totem2
this is not how models are referenced
{
"model": {
"type": "minecraft:select",
"cases": [
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/totem2"
},
"when": [
"fixed"
]
}
],
"fallback": {
"type": "minecraft:model",
"model": "minecraft:item/totem_of_undying"
},
"property": "minecraft:display_context"
}
}
this is what your file should look like
your case should also be for the case of the fixed display context, not gui
i put in that code and i replaced the second totem_of_undying to totem2 to see if the second totem would work at all, but it would still be the texture of the first totem even though i didn't use it anywhere
in the code, i also tried deleting the item/totem2 directory to see if that would make it have an error (i reverted the code back to the original one u sent so only the first case was totem2) but it was still the same and i didn't get any of that purple and black square i normally get so idk if the fixed thing checks for the right thing
i put it in the default models/item folder because otherwise it would be getting overriden by the preexsiting one, so it would just become a default totem. are you sure i should keep it in the minecraft:items folder because i dont know when that will ever run?
can you sent your resource pack? I have no clue what you're doing
do you know why the item just turns invisible
yeah sure gimme 1 sec
i had extra stuff from other mods in there so it might be a bit big
This question has been inactive for some time, so it's going to be closed for inactivity. If you still need it, please disregard this message.