Arrow Metadata

Discussion in 'Plugin Development' started by MaxFireIce, Mar 4, 2017.

Thread Status:
Not open for further replies.
  1. Offline

    MaxFireIce

    Hello,

    Ok, I could use some help. I have this plugin that uses an item to shoot a fireball, arrow, etc. However, I am now wanting to change the MetaData on the shot projectile so I can change stuff on the fireball like fire tick and block damage. I'm using:
    Code:java
    1. player.launchProjectile(Fireball.class);
    to shoot stuff. How would I go about changing it's MetaData? Any help is appreciated ;)!
     
  2. Offline

    Zombie_Striker

    For these, you will either have to listen to ProjectileHitEvent, cancel the event, and manually add the fire ticks and block damage, or you have to create your own CustomFireball class and override existing methods that call the firetick and block damage. I would recommend using the Event.
     
  3. Offline

    MaxFireIce

    @Zombie_Striker how would I check if the projectile was launched by the player when he used the item? I'm thinking setting a variable in another class to true, then to false on impact.
     
  4. Offline

    Zombie_Striker

    @MaxFireIce
    Well, you could set the display name to be equal to some value and then check for that name when the projectiles hits something.
     
Thread Status:
Not open for further replies.

Share This Page