Hello, I am creating a mod for Minecraft 1.21, and I would like to add a block similar to suspicious sand, with the difference that the item that comes out will always be a flash item, which I have already added to the mod. In addition, that flash item will be rotating at the same time as it comes out of the block, and when the animation is finished, a different item will appear, taking into account the loot table. When you take out a block of suspicious sand from creative mode and use the brush, nothing appears, However, if you find suspicious sand in a structure and use the brush, the item does appear. I want to do the same with this new block, and it doesn't necessarily have to be generated naturally, because I can use a command to give it any loot table.
#How can I make a block similar to Suspicious Sand
11 messages · Page 1 of 1 (latest)
they're implemented using BrushableBlock and BrushableBlockEntity
see the vanilla implementation
for example:
public class DustyBlockEntity extends BrushableBlockEntity{
public DustyBlockEntity(BlockPos pos, BlockState state) {
super(pos, state);
}
@Override
public BlockEntityType<?> getType() {
return BlockEntities.DUSTY_BLOCK_ENTITY;
}
}
this looks like a simplification
if you look at the vanilla implementation, there's a lot more