-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Minor
-
None
-
Affects Version/s: None
-
1.15.2
-
Yes
A new event for when block drops are calculated.
Currently it is too hard/too much work to figure out which events you have to listen to just to change the drops of a broken block, given that they can be destroyed by a player, entity, block explosion, entity explosion, physics, or other more specific mechanics.
I think there should be a CalculateDropEvent, which is called before the server calculates drops. Plugins can use it to override Vanilla drops.
event.setOverride(true); // Server will not use Vanilla drops. event.setCustomDrops(new ArrayList<>()); // Server will use these drops instead. event.getCustomDrops().add(drop);
If the block is broken by a Player you can get the tool.
event.getTool : Optional<ItemStack>