mojira.dev
MC-111533

Arrow has water potion when summoned or updated

The bug

When summoning an arrow, or updating its NBT (in game), it will have a water effect.

/summon minecraft:arrow

Code analysis

Code analysis by @unknown in this comment.

Linked issues

Attachments

Comments 13

Confirmed for 17w06a.

Confirmed for 17w17a.

Confirmed for Minecraft 1.12 Pre-Release 4

It's 1.12-pre4 now actually.

Confirmed for 1.12-pre6.

3 more comments

It's already set to confirmed.

Confirmed for 49a, 49b, 50a

Daniel Burnett

Confirmed as recently as 18w01a. And I know why, too. The code that clears the potion effect for non-potion arrows is the setPotionEffect method of EntityTippedArrow. This is called whenever an arrow entity is created via the ItemArrow's createArrow() method, as well as when skeletons or dispensers fire an arrow. However, it is not called when the EntityTippedArrow is summoned on its own.

I would suggest that setPotionEffect() be called when an arrow is summoned, and the getArrowStack() method made public. Then it would be as simple as having CommandSummon check if the entity is an instanceof EntityTippedArrow and, if so, call entity.setPotionEffect(entity.getArrowStack()) (similarly to how the summon command currently checks if the entity is an instanceof EntityLiving and calls its onInitialSpawn method if so).

I found setting the color to -1 works

Felix Lindegren Roms

I got this bug from the code;
execute as @e[type=snowball] facing entity Flexie_ eyes run summon arrow ~ ~ ~ {Motion:[0.0,0.0,2.5],Time:1}
On 1.13.2 

Goofables S

Erik Broes

Confirmed

/entitydata, /summon, arrow, particle, potion-effect, water

Minecraft 16w50a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w17a, Minecraft 1.12 Pre-Release 1, ..., Minecraft 18w03b, Minecraft 18w06a, Minecraft 18w07c, Minecraft 18w09a, Minecraft 18w10d

Retrieved