public static class BlockEvent.HarvestDropsEvent extends BlockEvent
drops array can be amended, as can the dropChance.
Note well: the harvester player field is null in a variety of scenarios. Code expecting null.
The dropChance is used to determine which items in this array will actually drop, compared to a random number. If you wish, you
can pre-filter yourself, and set dropChance to 1.0f to always drop the contents of the drops array.
isSilkTouching is set if this is considered a silk touch harvesting operation, vs a normal harvesting operation. Act accordingly.BlockEvent.BreakEvent, BlockEvent.HarvestDropsEvent, BlockEvent.MultiPlaceEvent, BlockEvent.PlaceEventEvent.HasResult, Event.Result| Modifier and Type | Field and Description |
|---|---|
float |
dropChance |
java.util.List<ItemStack> |
drops |
int |
fortuneLevel |
EntityPlayer |
harvester |
boolean |
isSilkTouching |
pos, state, world| Constructor and Description |
|---|
BlockEvent.HarvestDropsEvent(World world,
BlockPos pos,
IBlockState state,
int fortuneLevel,
float dropChance,
java.util.List<ItemStack> drops,
EntityPlayer harvester,
boolean isSilkTouching) |
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setuppublic final int fortuneLevel
public final java.util.List<ItemStack> drops
public final boolean isSilkTouching
public float dropChance
public final EntityPlayer harvester
public BlockEvent.HarvestDropsEvent(World world, BlockPos pos, IBlockState state, int fortuneLevel, float dropChance, java.util.List<ItemStack> drops, EntityPlayer harvester, boolean isSilkTouching)