on armor equip carved pumpkin

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

ialali

Member
Mar 13, 2025
1
0
1
Hello, I am trying to create a script that plays music when the player wears a carved pumpkin and its custom model is 26, but when wearing it, nothing happens. Can someone help me with this code?

Code:
on armor equip:
    if player's helmet is carved pumpkin:
        if player's helmet's custom model data is 26:
            play sound "minecraft:music_disc.pigstep" with volume 100 with pitch 1 at player for player
on armor unequip:
    if player's helmet is carved pumpkin:
        if player's helmet's custom model data is 26:
            execute console command "stopsound %player%"
 
Hello, I am trying to create a script that plays music when the player wears a carved pumpkin and its custom model is 26, but when wearing it, nothing happens. Can someone help me with this code?

Code:
on armor equip:
    if player's helmet is carved pumpkin:
        if player's helmet's custom model data is 26:
            play sound "minecraft:music_disc.pigstep" with volume 100 with pitch 1 at player for player
on armor unequip:
    if player's helmet is carved pumpkin:
        if player's helmet's custom model data is 26:
            execute console command "stopsound %player%"
I think usage of multiple 's is complicated. using "of" instead 's is more good.


Plus, use this event like that:

Python:
on armor change:
    send custom model data of new armor item to players

Just delete all your script and paste this. The reason behind there is nothing in this example code is to make sure if we can get the correct custom model data. When you run this code, just wear your custom modeled helmet and see what happens.