#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)

full atlas
#

I want to make it so that the totem in my inventory is a specific model, but when it pops and is in front of your screen its a different texture?

north basinBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 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

full atlas
#

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

north basinBOT
# north basin <@&1201956957406109788>

<@&1166082198152159386> <@&1202694677766348840>

🙇 Helpers Arise!

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)

alpine geyser
#

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

true gazelle
full atlas
true gazelle
#

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

full atlas
#

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?

true gazelle
#

yes, exactly

full atlas
#

what would the property be for when the totem pops be then

true gazelle
#

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
full atlas
#

where would i put the file, in my models folder or in the items folder like in the github directory?

alpine geyser
#

the items folder

full atlas
#

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"
}
}

true gazelle
#

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"

full atlas
#

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

true gazelle
#

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

alpine geyser
#

your case should also be for the case of the fixed display context, not gui

full atlas
#

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

full atlas
#

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?

true gazelle
#

can you sent your resource pack? I have no clue what you're doing

full atlas
#

do you know why the item just turns invisible

full atlas
#

i had extra stuff from other mods in there so it might be a bit big

north basinBOT
#
Closed for inactivity

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.