Jump to content

Lennos

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Lennos

  1. Thank you, that's all I need to know. That's good to know, thanks. Will get right into it.
  2. The entire println outputs this: I don't really know what you mean by where the event gets called from, but this statement should show you which package the event belongs to.
  3. The mod I'm using is Pixlemon. Ok so here's the code for Pre-Init: @EventHandler public void PreInit(FMLPreInitializationEvent event) { if (Loader.isModLoaded("pixelmon") { Pixelmon.EVENT_BUS.register(new PxEventHandler()); } } I've made Pixelmon a soft dependency, so you don't need to have it installed in order for this mod to work. And here's PxEventHandler: public class PxEventHandler { @SubscribeEvent public void checkIfFlying(RidePokemonEvent event) { System.out.println("Event hooked: " + event); } } RidePokemonEvent is posted when you right click on a rideable pixelmon. The post statement is located in a class that indirectly extends the EntityTameable class in net.minecraft.entity.passive. Other than that, I can't really tell if the code is server or client code. A good portion of it is still obfuscated and I don't wanna say anymore than I already have since Pixelmon isn't open source (I'm using the latest version of Pixelmon Reforged, btw). Another note, when the event handler is called on SP, on the console, the println statement is prefixed by something like this: So I'm guessing this means that RidePokemonEvent is posted on the server?
  4. Hey guys, So, I'm creating a mod that uses code from another mod (using build.gradle to put it into my build path). One of my event handlers listens for an event made by the other mod. For the longest time, I wasn't able to get it to work, until I realised that the other mod had it's own EVENT_BUS made and posted their events on that bus instead of the one created by MinecraftForge. So, I registered my event handler using the other mod's bus and finally managed to get it working... in single player, that is. The main problem comes when I test it on a server. When I entered a server (a pre-existing one, not a test server), the event handler doesn't get called at all. My initial suspicions were that, although I did register the handler on the mod bus, it didn't actually register on the server, so I made my handler hook to a general Event class and printed out the argument passed to it to see if it caught any event posted by the mod at all and it did catch some Effects and other events. So now my main suspicion is that the event I'm trying to hook is being posted on the server instead of the client. Should I use packets or just create my own test server? Or is there something else I'm missing. I created my Event Handlers on a separate class and registered them at Pre-Init in my @Mod class. To reiterate, the event handler works, but only in SP. It's a really simple setup but if you still want to see my code then I'll gladly post it.
×
×
  • Create New...

Important Information

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