Jump to content

AmethystAir

Members
  • Posts

    4
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

AmethystAir's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I tried registering it to the other bus using @SubscribeEvent and the event was still not being triggered, I'm at a loss for why it isn't working. Also, I tried switching one of the rings to only function in the baubles inventory and it still did not deactivate when I removed it. I believe the baubles onUnequipped() function not working may be related to something with whether it's running on the client or server and how I have the effects coded. I'll keep looking into this more tomorrow, I'll post here if I have any updates.
  2. I actually saw your post in another thread recommending that for something else so I gave it a try, but I'm not able to get it to run at all. Here's what I added, and nothing is being printed out to the console. I'm probably doing something wrong, but for the life of me I can't figure it out. Entirety of UpdateEvent.java: import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; public class UpdateEvent { private static int tick = 0; @EventHandler public void eventHandler(PlayerTickEvent event) { tick++; System.out.println("Player ticked!"); if (tick % 20 != 0) return; if (event.player.capabilities.allowFlying) { event.player.capabilities.allowFlying = false; event.player.capabilities.isFlying = false; event.player.fallDistance = 0; event.player.sendPlayerAbilities(); } } } Excerpt from CommonProxy.java where I register the new event: MinecraftForge.EVENT_BUS.register(new UpdateEvent());
  3. That's not exactly what I'm looking for, sorry, should have been more specific. The rings also function in the player's inventory (as intended), and that's where I'm having issues. I only mentioned the Baubles API in case it had some update function I could use. I'm using the vanilla inventory, nothing special about it other than having Baubles installed How would I go about tracking items in the vanilla inventory?
  4. I'm working on a mod that adds rings that give you special abilities (with Baubles API) and I'm having an issue where certain rings that set player abilities are not being disabled when removed from the player's inventory by any method. I've tried to use onDroppedByPlayer but it has no effect; neither does creating an ItemTossEvent. I would like to have either perfect detection of when the item is removed from the inventory, or an update loop that runs once a second (or so) that will disable the player's abilities if there's no ring there. The problem is, I haven't had much luck looking for either. Do you have any suggestions on either solution? I will be more than happy to provide code snippets if needed. Thanks in advance for any help you can provide!
×
×
  • Create New...

Important Information

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