ArmorStands' DisabledSlots incorrect flags implementation
Current problems:
- Cannot enable the offhand slot
- Cannot disable the mainhand slot.
- Can replace when placing is disabled.
The current implementation is:
1 << slot = disables all interaction
1 << (slot + 8) = disables removing/replacing
1 << (slot + 16) = disables placing, allows removing/replacing
Slot values:
boots slot: 1, pants slot: 2, chest slot: 3, helmet slot: 4
offhand is always disabled, mainhand is always enabled.
To reproduce:
- /summon armor_stand
- /entitydata @e[type=armor_stand] {DisabledSlots:255}, for instance (more example values below)
Example values:
Disabled all interaction, except boots: 11111101= 253
Disabled all interaction, except pants: 11111011= 251
Disabled all interaction, except chest: 11110111= 247
Disabled all interaction, except helmet: 11101111= 239
Disabled all interaction, all slots: 11111111 = 255
Disabled removing/replacing, all slots: 11111111 00000000 = 65280
Disabled placing, allow removing, all slots: 11111111 00000000 00000000 = 16711680
What the implementation should be (see Searge's comment here):
1 << slot = disables all interaction
1 << (slot + 8) = disables removing
1 << (slot + 16) = disables placing
'Replacing' should theoretically not be possible, and the first flag should also disable placing and not just removing.
2015-12-13, 01:15 AM
2023-09-06, 07:04 PM
18
14