|
| boolean | isHopperItem (ItemStack itemStack) |
| abstract ItemStack | getDefaultItem () |
| abstract void | onBlockUse (Player player, ItemStack itemStack, Block block, BlockFace blockFace) |
| abstract void | onAirUse (Player player, ItemStack itemStack) |
| abstract boolean | onDeviceDrop (Player player, boolean isShifting, Item dropped) |
|
|
static final NamespacedKey | HOPPER_ITEM_TYPE = new NamespacedKey(HopperLib.getInstance(),"hopper_item") |
◆ getDefaultItem()
| abstract ItemStack cc.mrcl.hopperlib.CustomItems.HopperItem.getDefaultItem |
( |
| ) |
|
|
abstract |
Defines the custom itemstack to be used by default. It MUST have a HOPPER_ITEM_TYPE String persistent container.
- Returns
- The item definition.
◆ isHopperItem()
| boolean cc.mrcl.hopperlib.CustomItems.HopperItem.isHopperItem |
( |
ItemStack | itemStack | ) |
|
Checks if an item is a HopperItem of this type.
- Parameters
-
| itemStack | The item to check. |
- Returns
- Whether the item is or isn't this custom item.
◆ onAirUse()
| abstract void cc.mrcl.hopperlib.CustomItems.HopperItem.onAirUse |
( |
Player | player, |
|
|
ItemStack | itemStack ) |
|
abstract |
Executed when a player right clicks with this item on the air.
- Parameters
-
| player | The player who right-clicked. |
| itemStack | The itemstack that corresponds to this item |
◆ onBlockUse()
| abstract void cc.mrcl.hopperlib.CustomItems.HopperItem.onBlockUse |
( |
Player | player, |
|
|
ItemStack | itemStack, |
|
|
Block | block, |
|
|
BlockFace | blockFace ) |
|
abstract |
Executed when a player right clicks with this item on a block.
- Parameters
-
| player | The player who right-clicked. |
| itemStack | The itemstack that corresponds to this item |
| block | The block the item was right-clicked on. |
| blockFace | The blockface the player right-clicked. |
◆ onDeviceDrop()
| abstract boolean cc.mrcl.hopperlib.CustomItems.HopperItem.onDeviceDrop |
( |
Player | player, |
|
|
boolean | isShifting, |
|
|
Item | dropped ) |
|
abstract |
Executed when a player drops this custom item
- Returns
- Cancellation of the event, true if the drop event should be cancelled
- Parameters
-
| dropped | The item entity that was dropped, can be killed. |
| player | The player that dropped the item |
| isShifting | Whether the player was shifting or not when the item was dropped |
The documentation for this class was generated from the following file:
- src/main/java/cc/mrcl/hopperlib/CustomItems/HopperItem.java