The title is a bit confusing so let me explain. Basically, if suspicious sand has a high amount of the same item (for example: 64 netherite ingots), it doesn't give all 64 of the netherite when brushed.
To replicate:
Run this command:
/give @p minecraft:suspicious_sand{BlockEntityTag:{item:{id:"minecraft:netherite_ingot",Count:64b}}}
You can also do
/setblock x y z minecraft:suspicious_sand{item:{id:"minecraft:netherite_ingot",Count:64b}}
Place down the suspicious sand and brush it. Through my testing, it seems to give around 13 items instead of 64
Also tested with other Count sizes and the bug still persists, however at lower numbers like 8 it seems to give the full amount.
Linked issues
is duplicated by 3
Attachments
Comments 5
From further testing made in MC-264943 it also happens on Suspicious Gravel, the count size has problems from 24 onwards (haven't tested lower amounts yet), the items are randomly distributed for some reason, I can't tell what kind of distribution this thing follows yet, and it's messing with tables that drops Suspicious Blocks with a count more than said amount, since it always creates this kind of data before dropping the item.
Can I get control of this? It needs to be consistently updated if there's any hope of getting it fixed and/or seen by anyone else. EDIT: Affects 1.20.3 and 1.20.4
One way of fixing this is to change the call to this.item.split()
inside BrushableBlockEntity#dropContent(Player)
to this.item.copyAndClear()
. This would also eliminate the need to empty the item stack further down in the method.
// old
ItemEntity itemEntity = new ItemEntity(this.level, g, h, i, this.item.split(this.level.random.nextInt(21) + 10));
// proposed
ItemEntity itemEntity = new ItemEntity(this.level, g, h, i, this.item.copyAndClear());
The random number of items is hard-coded. They should not be hard-coded, but specified using the item modifier in loot table, which is what item modifier is supposed to do.
For example,
"limit_count":{
"limit":{
"max":{
"type":"uniform",
"min": 10,
"max": 30
}
}
}
works the same as now