How to make a player to launch projectiles invisibility?

Discussion in 'Plugin Development' started by Amenddos, Jul 10, 2015.

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

    Amenddos

    how hide projectiles at launch? (Sorry for english, im brazillian)

    I tried this:

    Code:
    Vector Ferro = p.getLocation().getDirection().normalize().multiply(55);
    Arrow FerroH = ((Arrow)p.launchProjectile(Arrow.class));
    ((LivingEntity)FerroH).addPotionEffect(new PotionEffect(PotionEffectType.INVISIVILITY, 65, 0));
    FerroH.setVelocity(Ferro);
    but did not work
     
    Last edited: Jul 11, 2015
  2. Online

    timtower Administrator Administrator Moderator

    Moved to plugin development
     
  3. Offline

    bazsi700

    I'm not sure, and I can't test it right now, but projectile is a kind of entity so maybe you could give it invisiblity potion effect when you catch the projectile launch event.
     
  4. Offline

    feff890

    If you increase the velocity of it to a super speed you can barely see it.
     
  5. Offline

    bazsi700

    But then it will go somewhere else. Isn't it?
     
  6. Only works on LivingEntity.
    Eh.. no.
    Send a PacketPlayOutEntityDestroy(int... entityID) with my reflection util: http://bukkit.org/threads/361069
    Just use:
    Code:
    Object packet = Reflections.getPacket("PacketPlayOutEntityDestroy", yourProjectile.getEntityId());
    Reflcetions.sendPacket(player, packet);
     
  7. Offline

    Amenddos

    This never will work?

    Code:
    ((LivingEntity)FerroH).addPotionEffect(new PotionEffect(PotionEffectType.INVISIVILITY, 65, 0));
     
  8. Yes, this will never work. Arrow isn't a LivingEntity, it is a projectile.
     
    Konato_K likes this.
  9. Offline

    Amenddos

    Is there any way to set the invisibility effect to arrow?
     
  10. No
    As I said already 3 (!!!) times you must send a packet to the player
     
Thread Status:
Not open for further replies.

Share This Page