Unbreakable armor stands

  • 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 community!

    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!

Szefciox

New Member
May 5, 2025
9
0
1
Im searching for a skript that will make every armor stand on my server be unbreakable but still hitable, so no {unbreakable:1b} bc then u cant hit them,im new to skript and cant find a skript like this anywhere
 
this small example should work
Python:
on damage of armor stand:
    send "bonk" to attacker #code can be executed In front of cancel event
    cancel event
    add 1 to {hits} #code can be executed after cancel event
    if {hits} >= 10:
        send "you have hit the armor stand %{hits}% times" to attacker
    else:
        send "ouch" to attacker
 
this small example should work
Python:
on damage of armor stand:
    send "bonk" to attacker #code can be executed In front of cancel event
    cancel event
    add 1 to {hits} #code can be executed after cancel event
    if {hits} >= 10:
        send "you have hit the armor stand %{hits}% times" to attacker
    else:
        send "ouch" to attacker
Thank u! Il see if it works
Edit: i got a problem,the armor stands are unbreakable and hittable but i need them to also take durability from sword on hit,do u think thats possible? and is it possible to make the script work for one specific armor stand?
 
Last edited:
Try this. Haven't tested, feel free to ask if there's errors.

Python:
command /spawnarmorstand:
    permission: op
    trigger:
        spawn armor stand at player's location
        set {_target} to last spawned entity
        set string tag "special" of custom nbt of {_target} to "special"

on damage of armor stand:
    set {_tag} to string tag "special" of custom nbt of victim

    if {_tag} is "special":
        add 1 to damage value of attacker's tool
        cancel event
 
Try this. Haven't tested, feel free to ask if there's errors.

Python:
command /spawnarmorstand:
    permission: op
    trigger:
        spawn armor stand at player's location
        set {_target} to last spawned entity
        set string tag "special" of custom nbt of {_target} to "special"

on damage of armor stand:
    set {_tag} to string tag "special" of custom nbt of victim

    if {_tag} is "special":
        add 1 to damage value of attacker's tool
        cancel event
there are 2 errors in line 6 and 9
 
here you go
Python:
command /spawnarmorstand:
    permission: op
    trigger:
        spawn armor stand at location of player
        set {_as} to last spawned entity
        set metadata "special" of {_as} to true

on damage of armor stand:
    if metadata "special" of victim is true:
        add 1 to damage value of attacker's tool
        cancel event
 
here you go
Python:
command /spawnarmorstand:
    permission: op
    trigger:
        spawn armor stand at location of player
        set {_as} to last spawned entity
        set metadata "special" of {_as} to true

on damage of armor stand:
    if metadata "special" of victim is true:
        add 1 to damage value of attacker's tool
        cancel event
It breaks afer 2 quick taps
 
try this, if it sends the message it works otherwise I'll change it
Python:
command /spawnarmorstand:
    permission: op
    trigger:
        spawn armor stand at location of player
        set {_as} to last spawned entity
        set metadata "special" of {_as} to true

on damage of armor stand:
    if metadata "special" of victim is true:
        add 1 to damage value of attacker's tool
        send "test true" to attacker
        cancel event
 
try this, if it sends the message it works otherwise I'll change it
Python:
command /spawnarmorstand:
    permission: op
    trigger:
        spawn armor stand at location of player
        set {_as} to last spawned entity
        set metadata "special" of {_as} to true

on damage of armor stand:
    if metadata "special" of victim is true:
        add 1 to damage value of attacker's tool
        send "test true" to attacker
        cancel event
dosent send the message
 
maybe this? uses names insted
Python:
command /spawnarmorstand:
    permission: op
    trigger:
        spawn armor stand at location of player
        set {_as} to last spawned entity
        set custom name of {_as} to "SpecialArmorStand"
        set custom name visibility of {_as} to false

on damage of armor stand:
    attacker is a player
    custom name of victim is "SpecialArmorStand"
    add 1 to damage value of attacker's tool
    send "test true" to attacker
    cancel event
 
If you want to have an entity that is invulnerable, I'd recommend downloading and installing SkBee.

Shane has created the ability to edit nbt compound, meaning the tags/flags an entity has, such as NoAI, Invisibilty, or invulnerability!

If you then use the reference here for your code, you can create the nbt compound of invulnerability and attach it to your armor stand. The code is shown below.

Code:
command /armorstand:
    trigger:
        set {_n} to nbt compound from "{Invulnerable:1b}"
        spawn armor stand at player with nbt {_n}
        
#Code is not tested and skUnity Parser isn't working.
 
If you want to have an entity that is invulnerable, I'd recommend downloading and installing SkBee.

Shane has created the ability to edit nbt compound, meaning the tags/flags an entity has, such as NoAI, Invisibilty, or invulnerability!

If you then use the reference here for your code, you can create the nbt compound of invulnerability and attach it to your armor stand. The code is shown below.

Code:
command /armorstand:
    trigger:
        set {_n} to nbt compound from "{Invulnerable:1b}"
        spawn armor stand at player with nbt {_n}
       
#Code is not tested and skUnity Parser isn't working.
In the case this code does not work, try this version:


Code:
command /armorstand:
    trigger:
        spawn armor stand at player
        set {_n} to nbt compound of last spawned armor stand
        set boolean tag "Invulnerable" of {_n} to true
        set nbt compound of last spawned armor stand to {_n}
 
maybe this? uses names insted
Python:
command /spawnarmorstand:
    permission: op
    trigger:
        spawn armor stand at location of player
        set {_as} to last spawned entity
        set custom name of {_as} to "SpecialArmorStand"
        set custom name visibility of {_as} to false

on damage of armor stand:
    attacker is a player
    custom name of victim is "SpecialArmorStand"
    add 1 to damage value of attacker's tool
    send "test true" to attacker
    cancel event
error at 7 and 14
 
just remove line 7 but line 14 should be correct because it passes the parser
*edit. or you can try this?
Python:
command /spawnarmorstand:
    permission: op
    trigger:
        spawn armor stand at location of player
        set {_as} to last spawned entity
        set metadata value "armorStand" of {_as} to "SpecialArmorStand"

on damage of armor stand:
    attacker is a player
    metadata value "armorStand" of victim
    add 1 to damage value of attacker's tool
    send "test true" to attacker
    cancel event
 
Python:
command /spawnarmorstand:
permission: op
trigger:
spawn armor stand at location of player
set {_as} to last spawned entity
set metadata value "armorStand" of {_as} to "SpecialArmorStand"

on damage of armor stand:
attacker is a player
metadata value "armorStand" of victim
add 1 to damage value of attacker's tool
send "test true" to attacker
cancel event
error at line 12