Search in sources :

Example 1 with CraftCreature

use of org.bukkit.craftbukkit.v1_14_R1.entity.CraftCreature in project Ublisk by Derkades.

the class V1_12_R1 method setTarget.

@Override
public void setTarget(Creature creature, LivingEntity target) {
    CraftCreature craftCreature = (CraftCreature) creature;
    EntityCreature nms = craftCreature.getHandle();
    if (target == null) {
        nms.setGoalTarget(null, null, false);
    } else {
        nms.setGoalTarget(((CraftLivingEntity) target).getHandle(), null, false);
    }
}
Also used : CraftCreature(org.bukkit.craftbukkit.v1_12_R1.entity.CraftCreature) EntityCreature(net.minecraft.server.v1_12_R1.EntityCreature)

Example 2 with CraftCreature

use of org.bukkit.craftbukkit.v1_14_R1.entity.CraftCreature in project Ublisk by Derkades.

the class V1_14_R1 method setTargetToClosestPlayer.

@Override
public void setTargetToClosestPlayer(final Creature creature, final Player player) {
    final CraftLivingEntity craftLiving = (CraftLivingEntity) player;
    final EntityLiving entityLiving = craftLiving.getHandle();
    ((CraftCreature) creature).getHandle().setGoalTarget(entityLiving, TargetReason.CLOSEST_PLAYER, false);
}
Also used : EntityLiving(net.minecraft.server.v1_14_R1.EntityLiving) CraftLivingEntity(org.bukkit.craftbukkit.v1_14_R1.entity.CraftLivingEntity)

Example 3 with CraftCreature

use of org.bukkit.craftbukkit.v1_14_R1.entity.CraftCreature in project Ublisk by Derkades.

the class V1_14_R1 method setTarget.

@Override
public void setTarget(final Creature creature, final LivingEntity target) {
    final CraftCreature craftCreature = (CraftCreature) creature;
    final EntityCreature nms = craftCreature.getHandle();
    if (target == null) {
        nms.setGoalTarget(null, null, false);
    } else {
        nms.setGoalTarget(((CraftLivingEntity) target).getHandle(), null, false);
    }
}
Also used : CraftCreature(org.bukkit.craftbukkit.v1_14_R1.entity.CraftCreature) EntityCreature(net.minecraft.server.v1_14_R1.EntityCreature)

Example 4 with CraftCreature

use of org.bukkit.craftbukkit.v1_14_R1.entity.CraftCreature in project UltraCosmetics by iSach.

the class EntityUtil method move.

@Override
public void move(Creature creature, Location loc) {
    PathfinderMob ec = ((CraftCreature) creature).getHandle();
    ec.maxUpStep = 1;
    if (loc == null)
        return;
    ec.yHeadRot = loc.getYaw();
    Path path = ec.getNavigation().createPath(loc.getX(), loc.getY(), loc.getZ(), 1);
    ec.getNavigation().moveTo(path, 2);
}
Also used : CraftCreature(org.bukkit.craftbukkit.v1_17_R1.entity.CraftCreature) Path(net.minecraft.world.level.pathfinder.Path) PathfinderMob(net.minecraft.world.entity.PathfinderMob)

Example 5 with CraftCreature

use of org.bukkit.craftbukkit.v1_14_R1.entity.CraftCreature in project UltraCosmetics by iSach.

the class EntityUtil method move.

@Override
public void move(Creature creature, Location loc) {
    PathfinderMob ec = ((CraftCreature) creature).getHandle();
    ec.maxUpStep = 1;
    if (loc == null)
        return;
    ec.yHeadRot = loc.getYaw();
    Path path = ec.getNavigation().createPath(loc.getX(), loc.getY(), loc.getZ(), 1);
    ec.getNavigation().moveTo(path, 2);
}
Also used : CraftCreature(org.bukkit.craftbukkit.v1_18_R2.entity.CraftCreature) Path(net.minecraft.world.level.pathfinder.Path) PathfinderMob(net.minecraft.world.entity.PathfinderMob)

Aggregations

PathfinderMob (net.minecraft.world.entity.PathfinderMob)2 Path (net.minecraft.world.level.pathfinder.Path)2 EntityCreature (net.minecraft.server.v1_12_R1.EntityCreature)1 EntityCreature (net.minecraft.server.v1_14_R1.EntityCreature)1 EntityLiving (net.minecraft.server.v1_14_R1.EntityLiving)1 CraftCreature (org.bukkit.craftbukkit.v1_12_R1.entity.CraftCreature)1 CraftCreature (org.bukkit.craftbukkit.v1_14_R1.entity.CraftCreature)1 CraftLivingEntity (org.bukkit.craftbukkit.v1_14_R1.entity.CraftLivingEntity)1 CraftCreature (org.bukkit.craftbukkit.v1_17_R1.entity.CraftCreature)1 CraftCreature (org.bukkit.craftbukkit.v1_18_R2.entity.CraftCreature)1