public class CustomWeaponBow extends java.lang.Object implements CustomWeapon
| Constructor and Description |
|---|
CustomWeaponBow() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
cancelArrowImpact(org.bukkit.event.entity.EntityDamageByEntityEvent event)
Decides when to cancel arrow damage.
|
boolean |
canHaveSkillSlot()
Determines if the custom weapon can have a skillgem slot.
|
private static org.bukkit.Color |
getArrowColor(java.lang.String arrowType)
Gets a color based on the name of an arrow type.
|
java.util.List<org.bukkit.Material> |
getCustomItemMaterials()
Returns the materials that trigger events with the item.
|
java.util.List<java.lang.String> |
getCustomWeaponLores(boolean hasSkillSlot)
Gets the lores to show on an instance of the custom weapon.
|
static void |
onArrowHit(org.bukkit.entity.Player player,
org.bukkit.entity.Entity entity,
org.bukkit.entity.Arrow arrow)
Applies damage and effects from an arrow shot by a custom bow.
|
static void |
spawnArrowTrail(org.bukkit.entity.Arrow arrow,
org.bukkit.Color color)
Spawns a trail for an arrow with the given color.
|
static void |
tryToShoot(org.bukkit.entity.Player player,
org.bukkit.inventory.ItemStack bow)
Lets the player shoot an arrow from the given bow.
|
void |
use(org.bukkit.event.player.PlayerInteractEvent event)
Cancels the event of a bow interaction.
|
public void use(org.bukkit.event.player.PlayerInteractEvent event)
use in interface CustomItemevent - The interaction event.ArrowMenu.open(Player),
tryToShoot(Player, ItemStack)public java.util.List<org.bukkit.Material> getCustomItemMaterials()
getCustomItemMaterials in interface CustomItempublic boolean canHaveSkillSlot()
canHaveSkillSlot in interface CustomWeaponpublic java.util.List<java.lang.String> getCustomWeaponLores(boolean hasSkillSlot)
getCustomWeaponLores in interface CustomWeaponhasSkillSlot - If the weapon has a skillgem slot.public static void tryToShoot(org.bukkit.entity.Player player,
org.bukkit.inventory.ItemStack bow)
player - The player that is shooting.bow - The bow item stack.PlayerConfigurator.getSelectedArrows(Player),
PlayerConfigurator.getArrowAmount(Player, String),
MobMetadataUtils.setArrowTypeAndDamage(Arrow, String, int),
spawnArrowTrail(Arrow, Color),
getArrowColor(String),
DurabilityCalculator.damageItem(Player, ItemStack, boolean),
onArrowHit(Player, Entity, Arrow)private static org.bukkit.Color getArrowColor(java.lang.String arrowType)
arrowType - The name of the arrow type.public static void spawnArrowTrail(org.bukkit.entity.Arrow arrow,
org.bukkit.Color color)
arrow - The arrow entity.color - The trail particle color.SkillParticle.spawn(org.bukkit.Location, int)public static boolean cancelArrowImpact(org.bukkit.event.entity.EntityDamageByEntityEvent event)
event - The entity damage event.onArrowHit(Player, Entity, Arrow)public static void onArrowHit(org.bukkit.entity.Player player,
org.bukkit.entity.Entity entity,
org.bukkit.entity.Arrow arrow)
player - The player that shot the arrow.entity - The entity that got hit by the arrow.arrow - The arrow that hit the entity.tryToShoot(Player, ItemStack),
MobMetadataUtils.hasArrowTypeAndDamage(Arrow),
MobMetadataUtils.getArrowType(Arrow),
MobMetadataUtils.getArrowDamage(Arrow),
SkillUtils.callPlayerFixedDamageEvent(Player, Entity, double),
SkillUtils.callPlayerDamageOverTimeEvent(Player, Entity, Color, int, int, int),
SkillUtils.addPotionEffect(Entity, PotionEffectType, int, int),
SkillUtils.throwBackEntity(Entity, org.bukkit.Location, double),
SkillUtils.createExplosion(org.bukkit.Location, float)