Skeleton & EntityShootBowEvent

Discussion in 'Plugin Development' started by black_ixx, Nov 18, 2012.

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

    black_ixx

    Hey!

    I want to allow skeletons to shoot grenades at my new plugin. Its already able to spawn skeletons which can attack players and now I want to transform their arrrows into a grenade.
    Thats my event:

    Code:
        @EventHandler
        public void onShoot(EntityShootBowEvent event) {
            System.out.print("-1");
            if (event.getEntity() instanceof Skeleton){
                System.out.print("0");
                final Skeleton s = (Skeleton) event.getEntity();
                int type = SkelettMainHelper.skeletonTypeStore.get(s);
     
                System.out.print(type);
                if (type ==13){
                    event.setCancelled(true);
                    s.throwSnowball();
                }
                if (type==12){
                    plugin.getServer().getScheduler().scheduleSyncDelayedTask( plugin, new ZombieMGSchedule(10,s,plugin), 3L);
                    return;
                }
            }
           
        }
    When a skeleton attacks me with its bow, nothing happens...
    Yes, Ive registered the event and I know it because the line "-1" was printed out as Ive shot a bow (as player). It looks like the skeleton is not able to fire the event. But why?.. Is there any other event?
     
  2. Offline

    black_ixx

  3. Offline

    black_ixx

    does somebody know how to fix that?
     
  4. Offline

    feildmaster Retired Staff

  5. Offline

    black_ixx

Thread Status:
Not open for further replies.

Share This Page