예제 #1
0
 @EventHandler
 public void onTarget(EntityTargetEvent event) {
   EntityUtil entity = (EntityUtil) event.getEntity();
   if (entity.checkInVillage()) {
     event.setCancelled(true);
   }
 }
예제 #2
0
  @EventHandler
  public void onMobSpawn(EntitySpawnEvent event) {
    EntityUtil entity = (EntityUtil) event.getEntity();
    if (entity instanceof Player) {

    } else {
      if (entity.checkInVillage()) {
        event.setCancelled(true);
      }
    }
  }