mojira.dev
MC-107185

Eyes of ender utilize the behavior of consumable items causing the player to be slowed down when using them

The Bug:

Eyes of ender utilize the behavior of consumable items causing the player to be slowed down when using them.

Steps to Reproduce:

  1. Obtain several eyes of ender, walk forward at a constant speed, and throw multiple of them into the air.

  2. Observe how fast you're traveling as you do this.

  3. Take note as to whether or not throwing eyes of ender slows down the player.

Observed Behavior:

You are slowed down as if you were eating food.

Expected Behavior:

You would not be slowed down, following the behavior of similar projectiles such as snowballs and eggs.

Code Analysis:

The following is based on 1.12 decompiled using MCP 9.40 PRE 1

The method net.minecraft.item.ItemEnderEye.onItemRightClick(World, EntityPlayer, EnumHand) sets the eye of ender as actively used item stack similar to bows, food or potions. However, since eye of enders do not override net.minecraft.item.Item.getMaxItemUseDuration(ItemStack) their use time is 0. This causes you to slow down in creative mode because the condition for stopping using the active item stack is --this.activeItemStackUseCount == 0, so with 0 as start value the first check is -1 == 0.

Since the method ItemEnderEye.onItemRightClick directly decreases the count in survival the active item stack is reset since its count changed.

Linked issues

Attachments

Comments

SunCat

Please put only one bug report in each ticket.
Can reproduce slowing down for survival if there are no strongholds in the world.

.

Confirmed for 16w39a.

.

Confirmed for 16w42a.

wobst.michael

Thank you for your feedback, @unknown. As the reporter of this bug, you can update the affected version(s) yourself, so please try updating this ticket from time to time.

JUE13

Confirmed for 17w17b

.

Confirmed for 1.12-pre2.

gaspoweredpick

Can confirm for 1.13.2 and 19w05a

PancakeIdentity

Confirmed for 20w09a

 

Avoma

Can confirm in 20w48a.

Avoma

Can confirm in 20w51a.

Avoma

Can confirm in 21w03a.

Avoma

Can confirm in 21w05b.

Avoma

Can confirm in 21w06a.

Avoma

Can confirm in 21w07a.

bugsbugsbugs

This didn’t happen in 1.10.2. Seems like it was introduced in 1.11. In 1.10.2 you used to continiusly throw eyes of ender when holding down right click.

[media]

user-c84db

Isn't this intended to prevent accidental throwing of multiple ender eyes in survival?

bugsbugsbugs

Confirmed for 21w14a. Appearantly this was caused by the fix of MC-83337. I cannot reproduce this in 16w33a, but can in 16w35a. I would like to request ownership as the original reporter hasn’t been active since June 2017.

Waldorf

Can confirm in 1.17 release candidate 1

Avoma

Can confirm in 1.17.

ampolive

Can confirm in 1.17.1.

Avoma

I am able to confirm this in 21w40a. The expected behavior would be that eye of enders would not slow you down when throwing them.

Avoma

Can confirm this in 21w41a.

Avoma

Can confirm in 1.18.1. Would it be alright if I take ownership of this report since I believe the current reporter's account has been deactivated? 🙂

Shadows_of_Fire

Confirmed to still exist in 1.20.5-pre1.  This issue can be fixed by changing the following code in LivingEntity#updateUsingItem
 

if(--this.useItemRemaining== 0&& !this.level().isClientSide&& !p_147201_.useOnRelease()) {

this.completeUsingItem();

}

 

to 

 
if(--this.useItemRemaining<= 0&& !this.level().isClientSide&& !p_147201_.useOnRelease()) {

this.completeUsingItem();

}

 

The change is switching out `==` for `<=`, which fixes completeUsingItem() not being called for items with a use duration of 0.

.

Avoma

(Unassigned)

Confirmed

Gameplay

Low

Items, Player

ender_eye

Minecraft 16w38a, Minecraft 16w39a, Minecraft 16w42a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11, ..., 1.21.2 Pre-Release 3, 1.21.3, 1.21.4, 25w08a, 1.21.5

Retrieved