BlockHarvestDropsEvent

Link to blockharvestdropsevent

The BlockHarvestDrops Event is fired whenever a block is about to drop its items.
You can modify the block list as well as the overall drop chance. Set latter to 1 if you do all chance handling beforehand.

You will need to cast the event in the function header as this class:
crafttweaker.event.BlockHarvestDropsEvent
You can, of course, also import the class before and use that name then.

Event interface extensions

Link to event-interface-extensions

BlockHarvestDrops Events implement the following interfaces and are able to call all of their methods/getters/setters as well:

The following information can be retrieved from the event:

ZenGetterZenSetterType
ZenGetter
player
ZenSetter
Type
IPlayer
ZenGetter
isPlayer
ZenSetter
Type
bool
ZenGetter
silkTouch
ZenSetter
Type
bool
ZenGetter
fortuneLevel
ZenSetter
Type
int
ZenGetter
drops
ZenSetter
drops
Type
List<WeightedItemStack>
ZenGetter
dropChance
ZenSetter
dropChance
Type
float

Adding an item to the list

Link to adding-an-item-to-the-list

You can either addAssign the list or use the method to add an item to the list:

ZenScript
Copy
event.drops += <minecraft:coal>;
event.addItem(<minecraft:coal>);