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.

yesdood

Members
  • Joined

  • Last visited

  1. This is something that can be used for a TON of stuff - Packet events. Packet Read Event: Where it would be called: channelRead0 in NetworkManager.java Purpose: Packets are incredibly powerful and are used for nearly everything. Most existing events could arguably be replaced with Packet events. Health change? Packet for that. Chat message? Packet for that. PacketReadEvent would be used to read packets sent to the client. Packet Send Event: Where it would be called: addToSendQueue in NetHandlerPlayClient.java Purpose: Again, packets are incredibly powerful. These would be the packets sent from the client to the server. Things like clicking blocks, attacking entities, placing blocks, tab completing, sending chat messages, etc. PacketSendEvent would be cancellable, as well as be able to change the sent packet before it is sent. Example Usages: PacketReadEvent: For reading messages sent in chat: protected void onPacketRead(PacketReadEvent event) { if (event.getPacket() instanceof S02PacketChat) { S02PacketChat packetChat = (S02PacketChat)event.getPacket(); System.out.println(packetChat.func_148915_c().getUnformattedText()); } } For getting health changed: protected void onPacketRead(PacketReadEvent event) { if (event.getPacket() instanceof S06PacketUpdateHealth) { S06PacketUpdateHealth packetHealth = (S06PacketUpdateHealth)event.getPacket(); System.out.println(packetHealth.getHealth()); } } PacketSendEvent: Block breaking: protected void onPacketSend(PacketSendEvent event) { if (event.getPacket() instanceof C07PacketPlayerDigging) { C07PacketPlayerDigging digging = (C07PacketPlayerDigging)event.getPacket(); BlockPos blockPos = digging.func_179715_a(); Block block = mc.theWorld.getBlockState(blockPos).getBlock(); if (digging.getStatus() == C07PacketPlayerDigging.Action.START_DESTROY_BLOCK) { mc.thePlayer.addChatMessage(new ChatComponentText(String.format("Started digging block %s at %s, %s, %s", block.getLocalizedName(), blockPos.getX(), blockPos.getY(), blockPos.getZ()))); } else if (digging.getStatus() == C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK) { mc.thePlayer.addChatMessage(new ChatComponentText(String.format("Stopped digging block %s at %s, %s, %s", block.getLocalizedName(), blockPos.getX(), blockPos.getY(), blockPos.getZ()))); } } } Attacking entities: protected void onPacketSend(PacketSendEvent event) { if (event.getPacket() instanceof C02PacketUseEntity) { C02PacketUseEntity packetUseEntity = (C02PacketUseEntity)event.getPacket(); if (packetUseEntity.getAction() == C02PacketUseEntity.Action.ATTACK) { mc.thePlayer.addChatMessage(new ChatComponentText(String.format("Started attacking entity: %s", packetUseEntity.getEntityFromWorld(mc.thePlayer.getEntityWorld()).getName()))); } } } These are all basic examples, though there are TONS of other examples that could benefit from this. While there are existing events for the examples I provided, I'm sure you get the point.
  2. yesdood replied to GodOfYeti's topic in Modder Support
    He wants a gui, not something rendering over in the ingame GUI. He could use that, but he wants to have a gui. Well, it sounds like that is what he wants: "how can I make a gui on the ingame screen"
  3. yesdood replied to GodOfYeti's topic in Modder Support
    Or you could just use the RenderGameOverlay event and draw it that way if it's something he wants up always.
  4. Yup, use the RenderGameOverlayEvent event, it should work just fine.

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.