Steps to reproduce the issue:
Give yourself a trident with a greater than one max stack size. (Note: You also need to remove the max damage component to change max stack size)
/give @p minecraft:trident[minecraft:max_stack_size=64,!minecraft:max_damage] 64/give @p minecraft:trident[minecraft:max_stack_size=64,!minecraft:max_damage] 64In survival mode, throw the trident into the ground.
Pick up the trident.
Expected result:
Only one trident item would be picked up.
Actual result:
The player picks up the number of tridents held at the time of throwing. For this example the player would pick up 64 tridents.
Notes:
TridentItem.class (93-94)
ItemStack thrownItemStack = itemStack.consumeAndReturn(1, (LivingEntity)player);
ThrownTrident trident = (ThrownTrident)Projectile.spawnProjectileFromRotation(ThrownTrident::new, serverLevel, thrownItemStack, (LivingEntity)player, 0.0F, 2.5F, 1.0F);ItemStack thrownItemStack = itemStack.consumeAndReturn(1, (LivingEntity)player);
ThrownTrident trident = (ThrownTrident)Projectile.spawnProjectileFromRotation(ThrownTrident::new, serverLevel, thrownItemStack, (LivingEntity)player, 0.0F, 2.5F, 1.0F);Could be fixed with ItemStack#copyWithCount(1)
I cannot reproduce this