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.

Related issues

Attachments

Comments

migrated
[media]
migrated

Confirmed for 17w06a.

11people5

Confirmed for 17w17a.

migrated

Confirmed for Minecraft 1.12 Pre-Release 4

11people5

It's 1.12-pre4 now actually.

migrated

Confirmed for 1.12-pre6.

migrated

in 1.12

pokechu22

Thanks! Just FYI, you may find code easier to understand if you use MCP instead of NMS, as MCP names the majority of methods.

migrated

Confirmed!

migrated

It's already set to confirmed.

migrated

Confirmed for 49a, 49b, 50a

migrated

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).

migrated

I found setting the color to -1 works

migrated

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 

migrated

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