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.HarvestDropsEventEvent.HasResult, Event.Result| Modifier and Type | Field and Description |
|---|---|
float |
dropChance |
java.util.ArrayList<ItemStack> |
drops |
int |
fortuneLevel |
EntityPlayer |
harvester |
boolean |
isSilkTouching |
block, blockMetadata, world, x, y, z| Constructor and Description |
|---|
BlockEvent.HarvestDropsEvent(int x,
int y,
int z,
World world,
Block block,
int blockMetadata,
int fortuneLevel,
float dropChance,
java.util.ArrayList<ItemStack> drops,
EntityPlayer harvester,
boolean isSilkTouching) |
getListenerList, getResult, hasResult, isCancelable, isCanceled, setCanceled, setResult, setuppublic final int fortuneLevel
public final java.util.ArrayList<ItemStack> drops
public final boolean isSilkTouching
public float dropChance
public final EntityPlayer harvester
public BlockEvent.HarvestDropsEvent(int x,
int y,
int z,
World world,
Block block,
int blockMetadata,
int fortuneLevel,
float dropChance,
java.util.ArrayList<ItemStack> drops,
EntityPlayer harvester,
boolean isSilkTouching)