Jump to content

minecraftkeba

Members
  • Posts

    17
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

minecraftkeba's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. But then I couldn´t get the entity which attacks him, or is this possible?
  2. I want to send a message to the player when he gets damaged.
  3. Oh ok. And whats about the idea with the packets? Do you know how to do that?
  4. But why is it working on Single and not on Multiplayer then?
  5. Ok I justed tested some thing: Side side = FMLCommonHandler.instance().getSide(); On Single- and Multi-Player it allways returned "CLIENT", but why can I not recive the Event on Mutliplayer then?
  6. Do you know the Name of the packet and how to execute code when the client recives the code?
  7. @EventHandler public void preinit(FMLPreInitializationEvent e) throws AWTException, NativeHookException { FMLCommonHandler.instance().bus().register(new HurtEvent()); MinecraftForge.EVENT_BUS.register(new HurtEvent()); } And I need it to work on Client only.
  8. Ok I changed some things around: 1. I made a new Class: public class HurtEvent { @SubscribeEvent public void OnKeyInputx(LivingHurtEvent e) { System.out.println("HurtEvent"); } } 2. And I registered this class by calling: FMLCommonHandler.instance().bus().register(new HurtEvent()); 3. I also registered the Code by calling: MinecraftForge.EVENT_BUS.register(new HurtEvent()); Does anyone know why it is still not working?
  9. I used: MinecraftForge.EVENT_BUS.register(new Main()); But it dosn´t work.
  10. coolAlias can you send some example code, because i only need the event if a player is hurt anyway so that would be ok. Thanks
  11. diesieben07 you are right, that is exactly what I want to do.
  12. No there is no mod on the server... A player has the mod installed and he joines a normal Bukkit or Spigot server. And now the Event doesnt get triggered. I even tried: @SubscribeEvent public void OnKeyInput(LivingHurtEvent e) { System.out.println("test"); Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("HurtEvent")); } And I do not get "test" in the console.
  13. The one who uses the mod should see the message nobody else.
  14. Ok. I registered the Event with: FMLCommonHandler.instance().bus().register(new Main()); and my new Code is: @SubscribeEvent public void OnKeyInput(LivingHurtEvent e) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("HurtEvent")); } But I still do not get the message on a Server. In Singleplayer it works.
×
×
  • Create New...

Important Information

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