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.
Event Class
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
BlockHarvestDrops Events implement the following interfaces and are able to call all of their methods/getters/setters as well:
ZenGetters/ZenSetters
The following information can be retrieved from the event:
ZenGetter | ZenSetter | Type |
---|---|---|
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 |
ZenMethods
event.addItem(IItemStack)
Adds the Item to the droplist
ZenGetters/ZenSetters/ZenMethodes from extensions
The following information can be retrieved from the event:
ZenGetter | ZenSetter | Type |
---|---|---|
ZenGetter world | ZenSetter | Type IWorld |
ZenGetter blockState | ZenSetter | Type IBlockState |
ZenGetter block | ZenSetter | Type IBlock |
From extension of extension
ZenGetter | ZenSetter | Type |
---|---|---|
ZenGetter position | ZenSetter | Type IBlockPos |
ZenGetter x | ZenSetter | Type int |
ZenGetter y | ZenSetter | Type int |
ZenGetter z | ZenSetter | Type int |
Adding an item to the list
You can either addAssign the list or use the method to add an item to the list:
event.drops += <minecraft:coal>;event.addItem(<minecraft:coal>);