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


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

    I tried this:

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

    timtower Administrator Administrator Moderator

    Moved to plugin development
  3. Offline


    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


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


    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:
    Just use:
    Object packet = Reflections.getPacket("PacketPlayOutEntityDestroy", yourProjectile.getEntityId());
    Reflcetions.sendPacket(player, packet);
  7. Offline


    This never will work?

    ((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


    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