Check for named item in helmet slot not working



  • I am trying to make a SCP-035 mask in Minecraft with command blocks. (since I think it would be fun and people only make NPCs)

    I am trying to make the part where it checks when you put it on and then runs the rest of the commands and stuff.

    I have tried copy pasting commands into my command blocks but they don't work either. I have tried looking online to see if anyone has has done an actual mask but no.

    Here is my current command:

    execute if entity @a[nbt={Inventory:[{Slot:103b,id:"minecraft:skeleton_skull",Count:1b,tag:{display:{Name:"{\"text\":\"SCP-035\"}"}}}]}]
    

    PS: (This is a repeating, unconditional, always active command block)

    Any help would be appreciated!



  • The source of problem originates probably from the name of your mask given to yourself and the name criteria written in the nbt check. There may exists discrepancies between these two which makes the tag unsuitable for nbt checks.

    What I would recommend for you to do is to use the {CustomModelData:int} tag.

    execute as @a[nbt={Inventory:[{Slot:103b,tag:{CustomModelData:int}}]}] at @s run yourfunction
    

    Like so.

    give @s skeleton_skull{CustomModelData:int} 1
    

    Give yourself the corresponding skull.

    This is bound to be correct since the tag is simply an integer, which provides added efficiency to your functions. Additionally, it is much easier for you to synchronize your functions with resource packs shall the need arise.

    By the way, I am curious about what you would add into the game for the possession mask, for I am a fan of the SCP-verse as well.

    Edit: Another suggestion - create a datapack for your project and bolster your efficiency exponentially




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2