Jump to content

TheBigCraftGuy

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by TheBigCraftGuy

  1. Wait, I didn't read properly. I'm also new and have not fiddled with loot tables but why are subscribing to an event without a parameter.
  2. Try making the method static. I EventBusSubscriber requires a static method.
  3. This is my code so far but it doesn't seem to work private static void changeAI(CreeperEntity entity) { if (entity.world != null && !entity.world.isRemote) { Set<PrioritizedGoal> goals = ObfuscationReflectionHelper.getPrivateValue(GoalSelector.class, entity.goalSelector, "goals"); ChangeMod.LOGGER.info(goals); for (PrioritizedGoal goal: goals) { if (goal.getGoal() instanceof AvoidEntityGoal) { entity.goalSelector.removeGoal(goal); ChangeMod.LOGGER.info(goal.getGoal().toString()); } } goals = ObfuscationReflectionHelper.getPrivateValue(GoalSelector.class, entity.goalSelector, "goals"); ChangeMod.LOGGER.info(goals); } } But the creepers still avoid them and the goals are the same length
  4. I am trying to remove the AvoidEntity goals for a creeper to make it not run away from ocelots. This is my code: @Mod.EventBusSubscriber(modid = CreeperMod.MODID) public class EntityChangeEvent { @SubscribeEvent public static void onSpawn(EntityJoinWorldEvent event) { if (event.getEntity() instanceof CreeperEntity) changeAI((CreeperEntity) event.getEntity(), event); } private static void changeAI(CreeperEntity entity) { if (entity.world != null && !entity.world.isRemote) { CreeperMod.LOGGER.info(entity.goalSelector.getRunningGoals().count()); entity.goalSelector.getRunningGoals().forEach((action) -> { CreeperMod.LOGGER.info(action.getGoal()); if (action.getGoal() instanceof AvoidEntityGoal) { entity.goalSelector.removeGoal(action.getGoal()); CreeperMod.LOGGER.info("removed"); } }); } } But it looks like the AvoidEntity goals are not running when the creeper is spawned. How would I remove those goals. Thanks
  5. I have made a new crafting recipe and I would like to make it output one of two items. Thanks!
  6. I have a custom item model and I am registering the item using deferred registries. How would I set a different location for the model. So instead of storing the model json in models/item I could store it in models/staff. I think I would use a ResourceLocation but I don't know how to implement it with deferred registries. Thanks!
  7. So I have a PlayerEntity and a different LivingEntity. How would I teleport the entity a certain amount infront of the player like the "^ ^ ^" arguments in commands. The rotation doesn't matter. Thanks!
×
×
  • Create New...

Important Information

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