Search in sources :

Example 1 with PathfinderGoalRandomLookaround

use of net.minecraft.world.entity.ai.goal.PathfinderGoalRandomLookaround 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 PathfinderGoalRandomLookaround

use of net.minecraft.world.entity.ai.goal.PathfinderGoalRandomLookaround 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)

Aggregations

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