mojira.dev
MC-77737

Armor stand: DisabledSlots disables Remove when Replace is disabled

Using a value that disables all replacing but enables removing the item causes removing to also be disabled. For example, if you disable replacing the helmet, it will also disable removing it, but removing should still be enabled as the value didn't mark removing as disabled.

7936 should disable replacement of every slot except for removing an item. When used, the armor stand's armor cannot be replaced, and when having an empty hand and right clicking, the armor is not removed.

/summon ArmorStand ~ ~1 ~ {DisabledSlots:7936,Equipment:[{id:stone,Count:1},{id:iron_boots,Count:1},{id:iron_leggings,Count:1},{id:iron_chestplate,Count:1},{id:iron_helmet,Count:1}],ShowArms:1b}

Linked issues

Comments 9

Confirmed.
7936 = 0x001f00 should be "Remove all, replace none, place all"

According to http://minecraft.gamepedia.com/Chunk_format#Entity_format this is intended:

DisabledSlots: Bit field allowing disable place/replace/remove of armor elements. Given the armorPos value : 0 for Hand, 1 for Feet, 2 for Legs, 3 for Chest and 4 for Head, flag 1<<armorPos will disable remove of armorPos, 1<<(armorPos+8) will disable replace and remove of armorPos, and 1<<(armorPos+16) will disable place of armorPos. For instance the flag 2039552 will disable every possible interactions with the ArmorStand. Flag 1 is a special case : it will disable removing all part and place/replace of Hand

@Kumasasa
You go around saying that the Minecraft wiki is not a 100% trusted source, and then you're using it as a reference for this. Someone may have edited that due to discovering this behaviour.

@conormcs: You did observe that I didn't resolve the ticket as "Working as Intended" and that I confirmed this issue, didn't you ? According to wiki this is intended was just a hint.

"1 << (slot + 8)" is to disable taking of items, "1 << (slot + 16)" is to disable placing of items.
"1 << slot" is to disable slots completely

@Searge, If I use 1 << slot for the head slot, for example, I can still place a head but not remove it (as the wiki observes). I can also 'replace' the helmet with another helmet, essentially removing it even though the slot is supposed to be disabled completely. I can otherwise confirm that 1 << (slot + 8) works perfectly, preventing removal including from replacement. However, 1 << (slot + 16) suffers the same as the first, in that I can effectively place an item via replacing the helmet with another.

@@unknown: So you're saying this should be reopened? Or is this a different issue? In that case please make sure a ticket exists.

@@unknown I'm not sure actually. It's possible a mistake was made with Searge's comment, but it could also be possible that the actual implementation is bugged and should instead be as he said, which I'm more inclined to believe. I'll make a new report concerning it just in case (as there does not appear to be an existing report concerning it).

EDIT: Done: MC-94252

Here is what I think how it should work:
1 << slot should only disable removing Items, but allow replacing and placing
1 << slot+8 should only disable replacing items, but still allow removing Items and placing items
1 << slot+16 should only disable placing Items, but allow replacing and removing

To disable an armor stand completely, add them together:
10000000100000001 (binary)

Here is how it works at the moment: (1.9)

1 << slot completely disables all actions
1 << slot+8 disables removing and replacing, but allows placing Items
1 << slot+16 disables placing but allows replacing and removing

This is not good because it doesn't allow for some combinations, for example only allow removing but disable replacing and placing which could be used to detect right-click actions on armor stands.

It also doesn't support the off-hand at all, which should get fixed.

onnowhere

michael

Confirmed

DisabledSlots, armor_stand, remove, replace

Minecraft 1.8.2-pre4, Minecraft 1.8.2-pre7, Minecraft 1.8.3, Minecraft 1.8.4, Minecraft 1.8.5, Minecraft 1.8.6, Minecraft 15w38b, Minecraft 15w45a, Minecraft 15w46a

Retrieved