An API to get the amount of experience dropped from a block
rikka0w0 opened this issue ยท 1 comments
I would suggest we should have some function to retrieve the amount of experience dropped from breaking a block.
In vanilla, the logic is hard coded in OreBlock, RedstoneOreBlock and MobSpawner, and they drop Exp orb themselves after the block is removed.
Think about this case: One modded block wants to know the amount of experience dropped from another modded block (the latter may not be even placed in the world).
I would recommend we should at least have:
- A callback fired BEFORE the block removal is performed, which returns the amount of exp.
- When a block breaks, drop that amount of exp if exp > 0. Do this in ServerPlayerInteractionManager instead of inside individual blocks.