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. Установите его на 1, если вы уже сделали все обработки заранее.

Класс события

Link to класс-события

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.

Наследование от интерфейсов событий

Link to наследование-от-интерфейсов-событий

BlockHarvestDropsEvent реализует следующие интерфейсы и способно вызвать все их методы/геттеры/сеттеры:

Следующая информация может быть получена от события:

ZenGetterZenSetterТип
ZenGetter
player
ZenSetter
Тип
IPlayer
ZenGetter
isPlayer
ZenSetter
Тип
bool
ZenGetter
silkTouch
ZenSetter
Тип
bool
ZenGetter
fortuneLevel
ZenSetter
Тип
int
ZenGetter
drops
ZenSetter
drops
Тип
List<WeightedItemStack>
ZenGetter
dropChance
ZenSetter
dropChance
Тип
float

Добавление предмета в список

Link to добавление-предмета-в-список

Вы можете либо использовать оператор +=, либо использовать метод, чтобы добавить предмет в список:

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