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.

Featured Replies

Posted

Hi everyone, im new to the modding community.
So, I have a little problem here. The text that i've entered can show up with a bind.
But the reach function doesn't work, and I don't know why.. Here's the code.

 

Spoiler

package ca.forge.api;

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C17PacketCustomPayload;
import net.minecraftforge.common.MinecraftForge;

import java.awt.Color;
import java.nio.ByteBuffer;

import org.lwjgl.input.Keyboard;

@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION)

public class ForgeAPI
{
    
    private static final Minecraft mc = Minecraft.getMinecraft();
    private boolean textGui;
    private final int textGuiKey = 22;   
    private boolean forgeStart;
    private final int forgeinit = 19;
    
    @EventHandler
    public void Init(FMLInitializationEvent event)
    {
        FMLCommonHandler.instance().bus().register(this);
        MinecraftForge.EVENT_BUS.register(this);
        System.out.println("Initialized ForgeAPI");
    }
    
    @SubscribeEvent
    public void onRender(TickEvent.RenderTickEvent e) {
        if(textGui)
            mc.fontRenderer.drawStringWithShadow("OpehClient", 2, 2, Color.CYAN.hashCode());
    }
    
    @SubscribeEvent
    public void onKeyInput(InputEvent.KeyInputEvent e) 
    {
        if(Keyboard.isKeyDown(22)) {
            this.textGui = (!this.textGui);
            return; 
        }
        else if(Keyboard.isKeyDown(19)) {
            this.forgeStart = (!this.forgeStart);
        }
        Packet spoofedForgePacket = manipulateForgePacket(spoofForgeValue(3.6D));
        mc.thePlayer.sendQueue.addToSendQueue(spoofedForgePacket);
    }
    
    private Packet manipulateForgePacket(byte[] spoofedForgeValue) {
        return new C17PacketCustomPayload("reach", spoofedForgeValue);
    }
    
    private byte[] spoofForgeValue(double ForgeValue) {
        byte[] buffer = new byte[8];
        ByteBuffer.wrap(buffer).putDouble(ForgeValue);
        return buffer;
    }
    
}

I tried to make the mod look less suspicious by changing codes.
Thanks for helping in advance!
Regards, Opeh.

(PS: Sorry for my bad english)
(If you want to help me via Skype or something, reply your skype name)

Edited by Opeh
forgot the title.

  • Guest locked this topic
Guest
This topic is now closed to further replies.

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.