Started by
kaposuchus
on
Topic category: Troubleshooting, bugs, and solutions
this worked in the last version i had an eagle grab a fish from the surface or lower. it did make mob zoom forward but not by much cause i think it use the panic speed of the fish
i cant post the pic
package eons.procedures;
import net.minecraft.util.DamageSource;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.entity.passive.fish.CodEntity;
import net.minecraft.entity.MobEntity;
import net.minecraft.entity.Entity;
import java.util.Map;
import java.util.Collections;
import eons.EonsMod;
public class EonsAnomalocarisGrabProcedure {
public static void executeProcedure(Map<String, Object> dependencies) {
if (dependencies.get("entity") == null) {
if (!dependencies.containsKey("entity"))
EonsMod.LOGGER.warn("Failed to load dependency entity for procedure EonsAnomalocarisGrab!");
return;
}
Entity entity = (Entity) dependencies.get("entity");
if (entity instanceof CodEntity) {
if (((entity instanceof MobEntity) ? ((MobEntity) entity).getAttackTarget() : null).getPosX() == entity.getPosX()
&& ((entity instanceof MobEntity) ? ((MobEntity) entity).getAttackTarget() : null).getPosZ() == entity.getPosZ()
&& ((entity instanceof MobEntity) ? ((MobEntity) entity).getAttackTarget() : null).getPosY() >= entity.getPosY()) {
{
Entity _ent = ((entity instanceof MobEntity) ? ((MobEntity) entity).getAttackTarget() : null);
_ent.setPositionAndUpdate((entity.getPosX()), (entity.getPosY()), (entity.getPosZ()));
if (_ent instanceof ServerPlayerEntity) {
((ServerPlayerEntity) _ent).connection.setPlayerLocation((entity.getPosX()), (entity.getPosY()), (entity.getPosZ()),
_ent.rotationYaw, _ent.rotationPitch, Collections.emptySet());
}
}
((entity instanceof MobEntity) ? ((MobEntity) entity).getAttackTarget() : null).attackEntityFrom(DamageSource.GENERIC, (float) 1);
}
}
}
}
its also on an eagle