Solved remove arrows that are stuck in players

Discussion in 'Plugin Development' started by guitargun, Feb 5, 2015.

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

    guitargun

    how can I remove arrows that are stuck in players?
    I have a EntityDamagedByEntityEvent and the players can be hit by arrows how can I remove these arrows?
     
  2. Offline

    RainoBoy97

    Entity#remove
     
  3. Offline

    Konato_K

  4. Offline

    guitargun

    @Konato_K ok stupid me first used the 1.8 plugin in a 1.7 server with classnotfound errors to follow (fixed that)
    but I have set the amount to 0 but I still see the arrows.
    Code:
    Code:
                        System.out.println(event.getDamager() instanceof Arrow);
                        if(event.getDamager() instanceof Arrow){
                            ((CraftPlayer)victim).getHandle().getDataWatcher().watch(9, (byte) 0);
                        }
    it says true in the console

    tried this as well

    Code:
                        System.out.println(event.getDamager() instanceof Arrow);
                        if(event.getDamager() instanceof Arrow){
                            ((CraftPlayer)victim.getPlayer()).getHandle().getDataWatcher().watch(9, (byte) 0);
                        }
    still no result

    Edit:
    nvm I used a delayed task and it is solved now
     
Thread Status:
Not open for further replies.

Share This Page