Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

TheBigCraftGuy

Members
  • Joined

  • Last visited

  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!

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.