Class ItemProjectileBehavior

java.lang.Object
org.cloudburstmc.server.item.behavior.CloudItemBehavior
org.cloudburstmc.server.item.behavior.ItemProjectileBehavior
All Implemented Interfaces:
org.cloudburstmc.api.item.behavior.ItemBehavior
Direct Known Subclasses:
ItemPotionLingeringBehavior, ItemPotionSplashBehavior

public class ItemProjectileBehavior extends CloudItemBehavior
Author:
CreeperFace
  • Field Details

    • projectileEntityType

      protected final org.cloudburstmc.api.entity.EntityType<? extends org.cloudburstmc.api.entity.Projectile> projectileEntityType
    • throwForce

      protected final float throwForce
  • Constructor Details

    • ItemProjectileBehavior

      public ItemProjectileBehavior()
  • Method Details

    • onClickAir

      public boolean onClickAir(org.cloudburstmc.api.item.ItemStack item, com.nukkitx.math.vector.Vector3f directionVector, org.cloudburstmc.api.player.Player player)
      Description copied from class: CloudItemBehavior
      Called when a player uses the item on air, for example throwing a projectile. Returns whether the item was changed, for example count decrease or durability change.
      Specified by:
      onClickAir in interface org.cloudburstmc.api.item.behavior.ItemBehavior
      Overrides:
      onClickAir in class CloudItemBehavior
      directionVector - direction
      player - player
      Returns:
      item changed
    • onProjectileCreation

      protected void onProjectileCreation(org.cloudburstmc.api.item.ItemStack item, org.cloudburstmc.api.entity.Projectile projectile)