Package net.glowstone.block.itemtype
Class ItemProjectile
java.lang.Object
net.glowstone.block.itemtype.ItemType
net.glowstone.block.itemtype.ItemProjectile
- Direct Known Subclasses:
ItemEgg,ItemExperienceBottle,ItemSnowball
An item that can be used to throw a projectile (egg, snowball, etc.)
-
Nested Class Summary
Nested classes/interfaces inherited from class net.glowstone.block.itemtype.ItemType
ItemType.Context -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the context this item can be used in.voidrightClickAir(GlowPlayer player, org.bukkit.inventory.ItemStack holding) Called when a player right-clicks in midair while holding this item.voidrightClickBlock(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.abstract org.bukkit.entity.Projectileuse(GlowPlayer player, org.bukkit.inventory.ItemStack holding) Throws this projectile.Methods inherited from class net.glowstone.block.itemtype.ItemType
getMaterial, getMaterials, getMaxStackSize, getPlaceAs, setMaterial, setMaxStackSize, setPlaceAs, setPlaceAs, toString
-
Field Details
-
entityType
protected final org.bukkit.entity.EntityType entityType
-
-
Constructor Details
-
ItemProjectile
public ItemProjectile(org.bukkit.entity.EntityType entityType)
-
-
Method Details
-
getContext
Description copied from class:ItemTypeGet the context this item can be used in.- Overrides:
getContextin classItemType- Returns:
- context of the item, default is {
ItemType.Context.BLOCK}
-
rightClickAir
Description copied from class:ItemTypeCalled when a player right-clicks in midair while holding this item. Also called by default if rightClickBlock is not overridden.- Overrides:
rightClickAirin classItemType- Parameters:
player- The playerholding- The ItemStack the player was holding
-
rightClickBlock
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) Description copied from class:ItemTypeCalled when a player right-clicks on a block while holding this item.- Overrides:
rightClickBlockin classItemType- Parameters:
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 item
-
use
public abstract org.bukkit.entity.Projectile use(GlowPlayer player, org.bukkit.inventory.ItemStack holding) Throws this projectile.- Parameters:
player- the player throwing the projectileholding- the projectile as an item- Returns:
- the projectile as an entity
-