Search in sources :

Example 1 with CraftCreature

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

the class V1_12_R1 method setTargetToClosestPlayer.

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

Example 2 with CraftCreature

use of org.bukkit.craftbukkit.v1_12_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)

Aggregations

EntityCreature (net.minecraft.server.v1_12_R1.EntityCreature)1 EntityLiving (net.minecraft.server.v1_12_R1.EntityLiving)1 CraftCreature (org.bukkit.craftbukkit.v1_12_R1.entity.CraftCreature)1 CraftLivingEntity (org.bukkit.craftbukkit.v1_12_R1.entity.CraftLivingEntity)1