Interface HopperInventory
- All Superinterfaces:
BlockInventory, Container
The 5 slots of a hopper, read from and written to its block entity as
BlockInventory tells.
Once its cooldown is over, an enabled hopper pushes items into the container it faces, then pulls items from the container above it, and waits again the cooldown the configuration of its world gives after either one. With no container above it, it also picks up the items lying in its bowl, and those lying above it unless a full block covers it, without waiting for its cooldown nor starting it.
- Since:
- 0.1.0
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidsetTransferCooldown(int ticks) Makes the hopper wait before moving items again, or lets it move them on its next tick.intReturns the game ticks left before the hopper moves items again,0when it is ready.Methods inherited from interface BlockInventory
customName, lootTable, position, setCustomName, setLootTable, worldMethods inherited from interface Container
clear, contents, firstEmpty, get, isEmpty, set, setContents, size
-
Field Details
-
SIZE
static final int SIZEThe number of slots of a hopper.- Since:
- 0.1.0
- See Also:
-
-
Method Details
-
transferCooldown
int transferCooldown()Returns the game ticks left before the hopper moves items again,0when it is ready.A hopper only counts its cooldown down while its region ticks.
- Returns:
- the game ticks left before the hopper moves items again,
0when it is ready - Since:
- 0.1.0
-
setTransferCooldown
void setTransferCooldown(int ticks) Makes the hopper wait before moving items again, or lets it move them on its next tick.- Parameters:
ticks- the game ticks to wait,0to move items on the next tick- Throws:
IllegalArgumentException- ifticksis negative- Since:
- 0.1.0
-