How to lock slot interaction to armor stands?

Solution 1:

Your commmands avoid replacing and placing items in the armorstand inventory (Removing shouldn't work but it does for some odd reason). All you should change is the Disable slot number to 2039583

This link sends you to a great armorstand generator.

Edit2:

I got this one working for some odd reason.

/summon armor_stand ~ ~ ~ {NoGravity:1b,ShowArms:1,Invisible:1,Invulnerable:1,PersistenceRequired:1,HandItems:[{id:"minecraft:iron_sword",Count:1b},{}],Pose:{Body:[0f,0f,0f],LeftArm:[0f,0f,0f],RightArm:[271f,0f,271f],LeftLeg:[0f,0f,0f],RightLeg:[0f,0f,0f],Head:[0f,0f,0f]},DisabledSlots:2039583}