123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- event.load("entity_join");
- event.load("living_pre_hurt");
- event.load("entity_click");
- ignore = set.new();
- set.add(ignore, "human");
- set.add(ignore, "ender_dragon");
- set.add(ignore, "villager");
- msg("dev", "§bAi §rloaded");
- @wait
- wait();
- ignoreGoto(event);
- goto("wait");
- @entity_join
- if(!isLiving(entity)) {
- goto("wait");
- }
- if(isPlayer(entity)) {
- goto("wait");
- }
- if(entity.hasTag(entity, "mod_spawned")) {
- goto("wait");
- }
- entity_type = entity.getType(entity);
- if(set.contains(ignore, entity_type)) {
- goto("wait");
- }
- entity.addTag(entity, "no_tick");
- goto("wait");
- @entity_click
- is(isLiving(entity)) {
- removeTag(entity);
- }
- goto("wait");
- @living_pre_hurt
- removeTag(living_entity);
- goto("wait");
- function removeTag(living_entity) {
- entity.removeTag(living_entity, "no_tick");
- }
|