public class ItemType extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ItemType.Context
Context of the Items interaction.
|
| Constructor and Description |
|---|
ItemType() |
| Modifier and Type | Method and Description |
|---|---|
ItemType.Context |
getContext()
Get the context this item can be used in.
|
int |
getId()
Deprecated.
Magic value
|
org.bukkit.Material |
getMaterial()
Get the Material assigned to this ItemType.
|
int |
getMaxStackSize()
The maximum stack size of the item.
|
BlockType |
getPlaceAs()
The type of block to place when the item is used.
|
void |
rightClickAir(GlowPlayer player,
org.bukkit.inventory.ItemStack holding)
Called when a player right-clicks in midair while holding this item.
|
void |
rightClickBlock(GlowPlayer player,
GlowBlock target,
org.bukkit.block.BlockFace face,
org.bukkit.inventory.ItemStack holding,
org.bukkit.util.Vector clickedLoc,
org.bukkit.inventory.EquipmentSlot hand)
Called when a player right-clicks on a block while holding this item.
|
void |
setId(int id)
Deprecated.
Magic value
|
void |
setMaterial(org.bukkit.Material material)
Assign a Material to this ItemType (for internal use only).
|
protected void |
setMaxStackSize(int maxStackSize)
The maximum stack size of the item.
|
protected void |
setPlaceAs(BlockType placeAs)
Set this item to act like the given block type when being placed.
|
protected void |
setPlaceAs(org.bukkit.Material placeAs)
Set this item to act like the given block type when being placed.
|
String |
toString() |
@Deprecated public final int getId()
@Deprecated public final void setId(int id)
id - The internal item id for this item.public final void setMaterial(org.bukkit.Material material)
material - The internal material for this item.protected final void setPlaceAs(org.bukkit.Material placeAs)
placeAs - The material to place as.protected final void setPlaceAs(BlockType placeAs)
placeAs - The block to place as.public void rightClickAir(GlowPlayer player, org.bukkit.inventory.ItemStack holding)
player - The playerholding - The ItemStack the player was holdingpublic ItemType.Context getContext()
ItemType.Context.BLOCK}public void rightClickBlock(GlowPlayer player, GlowBlock target, org.bukkit.block.BlockFace face, org.bukkit.inventory.ItemStack holding, org.bukkit.util.Vector clickedLoc, org.bukkit.inventory.EquipmentSlot hand)
player - The playertarget - The block the player right-clickedface - The face on which the click occurredholding - The ItemStack the player was holdingclickedLoc - The coordinates at which the click occurredhand - The hand slot of this itempublic org.bukkit.Material getMaterial()
public BlockType getPlaceAs()
public int getMaxStackSize()
protected void setMaxStackSize(int maxStackSize)
Copyright © 2021. All rights reserved.