ai.txt 581 B

12345678910111213141516171819202122232425262728293031
  1. event.load("player_login");
  2. event.load("entity_join");
  3. msg("dev", "§bAi §rloaded");
  4. @wait
  5. wait();
  6. ignoreGoto(event);
  7. goto("wait");
  8. @entity_join
  9. if(isLiving(entity)) {
  10. loc = entity.getLocation(entity);
  11. world = loc.getWorld(loc);
  12. world_name = world.getName(world);
  13. if(isSurvWorldName(world_name)) {
  14. if(!living.getAi()) {
  15. living.removeAi(entity);
  16. }
  17. }
  18. }
  19. goto("wait");
  20. @player_login
  21. //Spawn mobs with ai
  22. online_list = players.toList();
  23. if(list.getSize(online_list) > 0) {
  24. living.setAi(false);
  25. } else {
  26. living.setAi(true);
  27. }
  28. goto("wait");