Fix for MC-124024 does not cover certain cases
The bug
To fix MC-124024 the method net.minecraft.world.entity.Entity.removeAction(Component) is supposed to remove clickEvents from the text and its siblings. However, it does not cover the following cases (there might be more):
- with arguments of translate component
- NBT interpret (though this is apparently not exploitable due to
MC-124008)
Reproduction steps
- Use the following command in a command block
/summon armor_stand ~ ~1 ~ {CustomName:"{\"translate\":\"Armor Stand\\n%s\",\"with\":[{\"text\":\"<RandomGuy> Please click my name to write a message directly to me\",\"hoverEvent\":{\"action\":\"show_text\",\"contents\":\"\"},\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/say This could have been /op RandomGuy!\"}}]}"} - Use the following command to have the name of the armor stand appear in chat
/say @e[type=armor_stand,limit=1]
→ It looks like "RandomGuy" wrote something in chat
- Click on "RandomGuy" to reply to them
→
You just executed an arbitrary command