Jump to content

Ian Battistoni

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Ian Battistoni

  1. I'm creating a mod but it doesn't recognize EntityJoinWorldEvent in 1.20 package com.lunaroom.illagernew.init; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal; import net.minecraft.world.entity.monster.Pillager; import net.minecraft.world.entity.monster.Zombie; import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber(modid = "illagernew") public class Illagermodify { @SubscribeEvent public static void onEntityJoinWorld(EntityJoinWorldEvent event) { if (event.getEntity() instanceof Pillager) { Pillager pillager = (Pillager) event.getEntity(); // Agrega una tarea para atacar a los Zombies. pillager.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(pillager, Zombie.class, true)); // Agrega una tarea para atacar a los jugadores y aldeanos. pillager.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(pillager, LivingEntity.class, 10, true, false, entity -> entity instanceof LivingEntity && !(entity instanceof Pillager))); // Agrega una tarea para responder al ser atacado. pillager.targetSelector.addGoal(1, new HurtByTargetGoal(pillager)); } } }
  2. How can I create a weapon mod with custom animations? For example a spear that has a hit animation where it hits from bottom to top and not like the sword that is from top to bottom.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.