How to clear armor

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

Status
Not open for further replies.

Myth

Member
Oct 27, 2019
1
0
0
34
I am trying to clear any armor in a player's inventory without clearing everything else. If they were to not have the armor in one of the armor slots, how would I be able to remove it from being in any of the inventory slots while not removing the rest of the items?

This is what I currently have and it does not do what I want it to do

on death:
set player's helmet to air
set player's chestplate to air
set player's leggings to air
set player's boots to air

I am not very good at skript, so thanks for your help.
 
i can help you
execute console command "replaceitem entity %player% slot.armor.chest air"
execute console command "replaceitem entity %player% slot.armor.head air"
execute console command "replaceitem entity %player% slot.armor.legs air"
execute console command "replaceitem entity %player% slot.armor.feet air"
 
I think I can help you.

If you want it to remove the armor from the slots, this should work.

These skripts will work if gamerule keepInventory is set to true.
Code:
on death:
  execute console command "replaceitem entity %player% slot.armor.chest air"
  execute console command "replaceitem entity %player% slot.armor.head air"
  execute console command "replaceitem entity %player% slot.armor.legs air"
  execute console command "replaceitem entity %player% slot.armor.feet air"

To clear the armor from the inventory, this should work.
Code:
on death:
  execute console command "ci %player% <item tag>"

#Set <item tag> to the specified item

Reply if this doesnt work.
 
Status
Not open for further replies.