mojira.dev
MC-269838

Pumpkin seeds drop from sheared pumpkins is hardcoded

Closely relates to the recently-fixed MC-267866 and also to MC-94610 and MC-149589.

The bug

The dropping of pumpkin seeds from a pumpkin on which shears are used appears to be hardcoded.

How to fix

Introduce a loot table, as was done to fix MC-267866.

Linked issues

Comments

migrated

Confirmed, there is no loot table of this nature located in either the gameplay folder or the blocks folder.

[Mod] Jingy

Can confirm.

Code analysis:

protected ItemInteractionResult useItemOn(ItemStack itemStack, BlockState blockState, Level level, BlockPos blockPos, Player player, InteractionHand interactionHand, BlockHitResult blockHitResult) {
. . .
         level.setBlock(blockPos, Blocks.CARVED_PUMPKIN.defaultBlockState().setValue(CarvedPumpkinBlock.FACING, direction1), 11);
-> ISSUE START
         ItemEntity itementity = new ItemEntity(
                 level, 
                 (double)blockPos.getX() + 0.5D + (double)direction1.getStepX() * 0.65D, 
                 (double)blockPos.getY() + 0.1D, 
                 (double)blockPos.getZ() + 0.5D + (double)direction1.getStepZ() * 0.65D, 
                 new ItemStack(Items.PUMPKIN_SEEDS, 4)
         );
-> ISSUE END
         itementity.setDeltaMovement(0.05D * (double)direction1.getStepX() + level.random.nextDouble() * 0.02D, 0.05D, 0.05D * (double)direction1.getStepZ() + level.random.nextDouble() * 0.02D);
. . .
      }
   }

muzikbike

(Unassigned)

Confirmed

Loot tables

missing-loot-table

1.20.4, 24w12a, 24w13a, 24w37a

Retrieved