mojira.dev
MC-92191

Using /entitydata on a Player-thrown Potion will Edit Player's Inventory

To reproduce, throw any potion and use this command while it's flying:

/entitydata @e[type=potion] {Potion:{tag:{Potion:"minecraft:healing"}}}

I was using command blocks to change the kinds of potions thrown by witches. I made them throw healing potions, instead of harming. I used the /entitydata command on a loop to do this. Here's the exact command:

/execute @e[type=Witch] ~ ~ ~ /entitydata @e[type=potion,c=1,r=1] {Potion:{tag:{Potion:"minecraft:healing"}}}

It seemed to be working just perfectly, up until I tried throwing potions at the witch. When I threw a potion at the witch, of course, it turned into a healing potion before it hit, but it also changed the potion I was holding. I threw a potion of harming. When it got near the witch, it turned into a potion of healing in my inventory. Could you please fix this? I want to be able to use /entitydata on potions without it changing the selected potion of the player. And by the way, I was on creative mode during all this.

More info: https://www.reddit.com/r/Minecraft/comments/3rmub5/15w45a_thrownpotion_entities_will_render_the_item/cwplbo0

Linked issues

Comments 3

SunCat

Relates to MC-107291

migrated

Please check if it's still an issue in the next snapshot.

SunCat

It's fixed in 16w39c

migrated

(Unassigned)

Confirmed

Minecraft 15w45a, Minecraft 16w36a, Minecraft 16w38a, Minecraft 16w39a, Minecraft 16w39b

Minecraft 16w39c

Retrieved