Started by
ChasingFlavors
on
Topic category: Help with Minecraft modding (Java Edition)
So, is there a way to have it so when a mob attacks you, it picks you up in a way and then drops you after a set amount of ticks?
Some examples of what I'm trying to get at here is the Roc from Lycanite's Mobs, the Sludge Menace from The Betweenlands, and the Shambler from The Betweenlands.
it occurs to me that if it is close to the entity, the entity would raise it, up to a certain point
and then they would share speeds
if the entity goes down blocks, the player should also
if the entity is still, the player should be a little higher off the ground.
but u can share a screen shot of this procedure, i rlly want do it, (and how to make a provocation to a mob like: if u running the mob will be agressive to you)
i had it work a few times on my mobs doing it to each other but not a player using this code
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);
}
}
}
} it works every now and again but not always
it better to limit what it can pic up or u just get a smash bros luigi latter in any direction
this procedure is only is'nt possible in mcreator? like with the procedure's blocks?