Search in sources :

Example 1 with PathfinderGoalFloat

use of net.minecraft.world.entity.ai.goal.PathfinderGoalFloat in project BedWars1058 by andrei1058.

the class IGolem method initPathfinder.

@SuppressWarnings("rawtypes")
@Override
protected void initPathfinder() {
    this.bP.a(1, new PathfinderGoalFloat(this));
    this.bP.a(2, new PathfinderGoalMeleeAttack(this, 1.5D, false));
    this.bQ.a(1, new PathfinderGoalHurtByTarget(this));
    this.bP.a(3, new PathfinderGoalRandomStroll(this, 1D));
    this.bP.a(4, new PathfinderGoalRandomLookaround(this));
    this.bQ.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, 20, true, false, player -> ((EntityHuman) player).isAlive() && !team.wasMember(((EntityHuman) player).getUniqueID()) && !team.getArena().isReSpawning(((EntityHuman) player).getUniqueID()) && !team.getArena().isSpectator(((EntityHuman) player).getUniqueID())));
    this.bQ.a(3, new PathfinderGoalNearestAttackableTarget(this, IGolem.class, 20, true, false, golem -> ((IGolem) golem).getTeam() != team));
    this.bQ.a(4, new PathfinderGoalNearestAttackableTarget(this, Silverfish.class, 20, true, false, sf -> ((Silverfish) sf).getTeam() != team));
}
Also used : ITeam(com.andrei1058.bedwars.api.arena.team.ITeam) WorldServer(net.minecraft.server.level.WorldServer) EntityHuman(net.minecraft.world.entity.player.EntityHuman) VersionCommon(com.andrei1058.bedwars.support.version.common.VersionCommon) EntityTypes(net.minecraft.world.entity.EntityTypes) StringUtils(org.apache.commons.lang.StringUtils) PathfinderGoalRandomLookaround(net.minecraft.world.entity.ai.goal.PathfinderGoalRandomLookaround) CreatureSpawnEvent(org.bukkit.event.entity.CreatureSpawnEvent) PathfinderGoalNearestAttackableTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalNearestAttackableTarget) GenericAttributes(net.minecraft.world.entity.ai.attributes.GenericAttributes) PathfinderGoalFloat(net.minecraft.world.entity.ai.goal.PathfinderGoalFloat) PathfinderGoalRandomStroll(net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStroll) PathfinderGoalMeleeAttack(net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack) World(net.minecraft.world.level.World) LivingEntity(org.bukkit.entity.LivingEntity) Messages(com.andrei1058.bedwars.api.language.Messages) EntityIronGolem(net.minecraft.world.entity.animal.EntityIronGolem) Objects(java.util.Objects) PathfinderGoalHurtByTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget) Location(org.bukkit.Location) DamageSource(net.minecraft.world.damagesource.DamageSource) Language(com.andrei1058.bedwars.api.language.Language) CraftWorld(org.bukkit.craftbukkit.v1_17_R1.CraftWorld) CraftLivingEntity(org.bukkit.craftbukkit.v1_17_R1.entity.CraftLivingEntity) PathfinderGoalRandomLookaround(net.minecraft.world.entity.ai.goal.PathfinderGoalRandomLookaround) EntityHuman(net.minecraft.world.entity.player.EntityHuman) PathfinderGoalHurtByTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget) PathfinderGoalNearestAttackableTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalNearestAttackableTarget) PathfinderGoalMeleeAttack(net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack) PathfinderGoalFloat(net.minecraft.world.entity.ai.goal.PathfinderGoalFloat) PathfinderGoalRandomStroll(net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStroll)

Example 2 with PathfinderGoalFloat

use of net.minecraft.world.entity.ai.goal.PathfinderGoalFloat in project BedWars1058 by andrei1058.

the class Silverfish method initPathfinder.

@Override
protected void initPathfinder() {
    this.bP.a(1, new PathfinderGoalFloat(this));
    this.bP.a(2, new PathfinderGoalMeleeAttack(this, 1.9D, false));
    this.bQ.a(1, new PathfinderGoalHurtByTarget(this));
    this.bP.a(3, new PathfinderGoalRandomStroll(this, 2D));
    this.bQ.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, 20, true, false, player -> {
        return ((EntityHuman) player).isAlive() && !team.wasMember(((EntityHuman) player).getUniqueID()) && !team.getArena().isReSpawning(((EntityHuman) player).getUniqueID()) && !team.getArena().isSpectator(((EntityHuman) player).getUniqueID());
    }));
    this.bQ.a(3, new PathfinderGoalNearestAttackableTarget(this, IGolem.class, 20, true, false, golem -> {
        return ((IGolem) golem).getTeam() != team;
    }));
    this.bQ.a(4, new PathfinderGoalNearestAttackableTarget(this, Silverfish.class, 20, true, false, sf -> {
        return ((Silverfish) sf).getTeam() != team;
    }));
}
Also used : ITeam(com.andrei1058.bedwars.api.arena.team.ITeam) WorldServer(net.minecraft.server.level.WorldServer) EntityHuman(net.minecraft.world.entity.player.EntityHuman) VersionCommon(com.andrei1058.bedwars.support.version.common.VersionCommon) EntityTypes(net.minecraft.world.entity.EntityTypes) StringUtils(org.apache.commons.lang.StringUtils) CreatureSpawnEvent(org.bukkit.event.entity.CreatureSpawnEvent) PathfinderGoalNearestAttackableTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalNearestAttackableTarget) GenericAttributes(net.minecraft.world.entity.ai.attributes.GenericAttributes) PathfinderGoalFloat(net.minecraft.world.entity.ai.goal.PathfinderGoalFloat) PathfinderGoalRandomStroll(net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStroll) PathfinderGoalMeleeAttack(net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack) World(net.minecraft.world.level.World) LivingEntity(org.bukkit.entity.LivingEntity) Messages(com.andrei1058.bedwars.api.language.Messages) PathfinderGoalHurtByTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget) Location(org.bukkit.Location) DamageSource(net.minecraft.world.damagesource.DamageSource) Language(com.andrei1058.bedwars.api.language.Language) CraftWorld(org.bukkit.craftbukkit.v1_17_R1.CraftWorld) CraftLivingEntity(org.bukkit.craftbukkit.v1_17_R1.entity.CraftLivingEntity) EntitySilverfish(net.minecraft.world.entity.monster.EntitySilverfish) EntityHuman(net.minecraft.world.entity.player.EntityHuman) PathfinderGoalHurtByTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget) PathfinderGoalNearestAttackableTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalNearestAttackableTarget) PathfinderGoalMeleeAttack(net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack) PathfinderGoalFloat(net.minecraft.world.entity.ai.goal.PathfinderGoalFloat) PathfinderGoalRandomStroll(net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStroll) EntitySilverfish(net.minecraft.world.entity.monster.EntitySilverfish)

Example 3 with PathfinderGoalFloat

use of net.minecraft.world.entity.ai.goal.PathfinderGoalFloat in project BedWars1058 by andrei1058.

the class IGolem method u.

@SuppressWarnings("rawtypes")
@Override
protected void u() {
    this.bR.a(1, new PathfinderGoalFloat(this));
    this.bR.a(2, new PathfinderGoalMeleeAttack(this, 1.5D, false));
    this.bS.a(3, new PathfinderGoalHurtByTarget(this));
    this.bR.a(4, new PathfinderGoalRandomStroll(this, 1D));
    this.bR.a(5, new PathfinderGoalRandomLookaround(this));
    this.bS.a(6, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, 20, true, false, player -> !((EntityHuman) player).getBukkitEntity().isDead() && !team.wasMember(((EntityHuman) player).getBukkitEntity().getUniqueId()) && !team.getArena().isReSpawning(((EntityHuman) player).getBukkitEntity().getUniqueId()) && !team.getArena().isSpectator(((EntityHuman) player).getBukkitEntity().getUniqueId())));
    this.bS.a(7, new PathfinderGoalNearestAttackableTarget(this, IGolem.class, 20, true, false, golem -> ((IGolem) golem).getTeam() != team));
    this.bS.a(8, new PathfinderGoalNearestAttackableTarget(this, Silverfish.class, 20, true, false, sf -> ((Silverfish) sf).getTeam() != team));
}
Also used : WorldServer(net.minecraft.server.level.WorldServer) StringUtils(org.apache.commons.lang.StringUtils) CraftEventFactory(org.bukkit.craftbukkit.v1_18_R1.event.CraftEventFactory) GenericAttributes(net.minecraft.world.entity.ai.attributes.GenericAttributes) World(net.minecraft.world.level.World) PathfinderGoalHurtByTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget) Location(org.bukkit.Location) DamageSource(net.minecraft.world.damagesource.DamageSource) Language(com.andrei1058.bedwars.api.language.Language) CraftWorld(org.bukkit.craftbukkit.v1_18_R1.CraftWorld) ITeam(com.andrei1058.bedwars.api.arena.team.ITeam) EntityHuman(net.minecraft.world.entity.player.EntityHuman) VersionCommon(com.andrei1058.bedwars.support.version.common.VersionCommon) EntityTypes(net.minecraft.world.entity.EntityTypes) PathfinderGoalRandomLookaround(net.minecraft.world.entity.ai.goal.PathfinderGoalRandomLookaround) CreatureSpawnEvent(org.bukkit.event.entity.CreatureSpawnEvent) PathfinderGoalNearestAttackableTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalNearestAttackableTarget) PathfinderGoalFloat(net.minecraft.world.entity.ai.goal.PathfinderGoalFloat) PathfinderGoalRandomStroll(net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStroll) PathfinderGoalMeleeAttack(net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack) LivingEntity(org.bukkit.entity.LivingEntity) Messages(com.andrei1058.bedwars.api.language.Messages) EntityIronGolem(net.minecraft.world.entity.animal.EntityIronGolem) CraftLivingEntity(org.bukkit.craftbukkit.v1_18_R1.entity.CraftLivingEntity) Objects(java.util.Objects) PathfinderGoalRandomLookaround(net.minecraft.world.entity.ai.goal.PathfinderGoalRandomLookaround) EntityHuman(net.minecraft.world.entity.player.EntityHuman) PathfinderGoalHurtByTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget) PathfinderGoalNearestAttackableTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalNearestAttackableTarget) PathfinderGoalMeleeAttack(net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack) PathfinderGoalFloat(net.minecraft.world.entity.ai.goal.PathfinderGoalFloat) PathfinderGoalRandomStroll(net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStroll)

Example 4 with PathfinderGoalFloat

use of net.minecraft.world.entity.ai.goal.PathfinderGoalFloat in project BedWars1058 by andrei1058.

the class Silverfish method u.

@Override
protected void u() {
    this.bR.a(1, new PathfinderGoalFloat(this));
    this.bR.a(2, new PathfinderGoalMeleeAttack(this, 1.9D, false));
    this.bS.a(1, new PathfinderGoalHurtByTarget(this));
    this.bR.a(3, new PathfinderGoalRandomStroll(this, 2D));
    this.bS.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, 20, true, false, player -> {
        return (!((EntityHuman) player).getBukkitEntity().isDead()) && (!team.wasMember(((EntityHuman) player).getBukkitEntity().getUniqueId())) && (!team.getArena().isReSpawning(((EntityHuman) player).getBukkitEntity().getUniqueId())) && (!team.getArena().isSpectator(((EntityHuman) player).getBukkitEntity().getUniqueId()));
    }));
    this.bS.a(3, new PathfinderGoalNearestAttackableTarget(this, IGolem.class, 20, true, false, golem -> {
        return ((IGolem) golem).getTeam() != team;
    }));
    this.bS.a(4, new PathfinderGoalNearestAttackableTarget(this, Silverfish.class, 20, true, false, sf -> {
        return ((Silverfish) sf).getTeam() != team;
    }));
}
Also used : ITeam(com.andrei1058.bedwars.api.arena.team.ITeam) WorldServer(net.minecraft.server.level.WorldServer) EntityHuman(net.minecraft.world.entity.player.EntityHuman) VersionCommon(com.andrei1058.bedwars.support.version.common.VersionCommon) EntityTypes(net.minecraft.world.entity.EntityTypes) StringUtils(org.apache.commons.lang.StringUtils) CreatureSpawnEvent(org.bukkit.event.entity.CreatureSpawnEvent) PathfinderGoalNearestAttackableTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalNearestAttackableTarget) CraftEventFactory(org.bukkit.craftbukkit.v1_18_R1.event.CraftEventFactory) GenericAttributes(net.minecraft.world.entity.ai.attributes.GenericAttributes) PathfinderGoalFloat(net.minecraft.world.entity.ai.goal.PathfinderGoalFloat) PathfinderGoalRandomStroll(net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStroll) PathfinderGoalMeleeAttack(net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack) World(net.minecraft.world.level.World) LivingEntity(org.bukkit.entity.LivingEntity) Messages(com.andrei1058.bedwars.api.language.Messages) CraftLivingEntity(org.bukkit.craftbukkit.v1_18_R1.entity.CraftLivingEntity) PathfinderGoalHurtByTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget) Location(org.bukkit.Location) DamageSource(net.minecraft.world.damagesource.DamageSource) Language(com.andrei1058.bedwars.api.language.Language) EntitySilverfish(net.minecraft.world.entity.monster.EntitySilverfish) CraftWorld(org.bukkit.craftbukkit.v1_18_R1.CraftWorld) EntityHuman(net.minecraft.world.entity.player.EntityHuman) PathfinderGoalHurtByTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget) PathfinderGoalNearestAttackableTarget(net.minecraft.world.entity.ai.goal.target.PathfinderGoalNearestAttackableTarget) PathfinderGoalMeleeAttack(net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack) PathfinderGoalFloat(net.minecraft.world.entity.ai.goal.PathfinderGoalFloat) PathfinderGoalRandomStroll(net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStroll) EntitySilverfish(net.minecraft.world.entity.monster.EntitySilverfish)

Aggregations

ITeam (com.andrei1058.bedwars.api.arena.team.ITeam)4 Language (com.andrei1058.bedwars.api.language.Language)4 Messages (com.andrei1058.bedwars.api.language.Messages)4 VersionCommon (com.andrei1058.bedwars.support.version.common.VersionCommon)4 WorldServer (net.minecraft.server.level.WorldServer)4 DamageSource (net.minecraft.world.damagesource.DamageSource)4 EntityTypes (net.minecraft.world.entity.EntityTypes)4 GenericAttributes (net.minecraft.world.entity.ai.attributes.GenericAttributes)4 PathfinderGoalFloat (net.minecraft.world.entity.ai.goal.PathfinderGoalFloat)4 PathfinderGoalMeleeAttack (net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack)4 PathfinderGoalRandomStroll (net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStroll)4 PathfinderGoalHurtByTarget (net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget)4 PathfinderGoalNearestAttackableTarget (net.minecraft.world.entity.ai.goal.target.PathfinderGoalNearestAttackableTarget)4 EntityHuman (net.minecraft.world.entity.player.EntityHuman)4 World (net.minecraft.world.level.World)4 StringUtils (org.apache.commons.lang.StringUtils)4 Location (org.bukkit.Location)4 LivingEntity (org.bukkit.entity.LivingEntity)4 CreatureSpawnEvent (org.bukkit.event.entity.CreatureSpawnEvent)4 Objects (java.util.Objects)2