Jump to content

BuluBulu27

Members
  • Posts

    2
  • Joined

  • Last visited

Converted

  • Gender
    Male

BuluBulu27's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hello modders, I'm trying to make a mod that sends a console message when a fish has been caught and is ready to get pulled. I know I have to use some kind of EntityFishHook.onUpdate(), but I don't know how and when to use it. Also, to send the message, would I have to override the onUpdate() method and add something into it, or can I check for a certain field and add a condition concerning it? Here's the code for EntityFishHook.onUpdate() if you don't want to look for it in your IDE (it's pretty long): Thanks for any help you can provide!
  2. Hello, I recently wanted to give modding a try, so here I am trying to figure out some basics. I basically want to start by making an AutoWalk, a keybind that toggles "moving forward" for both SinglePlayer and Multiplayer, on Client Side. Will there be any difference between SP and MP for that kind of mod? How can I toggle the movement? So far, here's what I have: a rip off of multiple sources I have found online to help me with that, but I couldn't find anything updated to 1.8.9. KeyBindings.java import org.lwjgl.input.Keyboard; import net.minecraft.client.settings.KeyBinding; import net.minecraftforge.fml.client.registry.ClientRegistry; public class KeyBindings { public static KeyBinding keepForward; public static void init() { keepForward = new KeyBinding("key.keepForward", Keyboard.KEY_O, "key.categories.Autowalk"); ClientRegistry.registerKeyBinding(keepForward); } } KeyInputHandler.java import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent; public class KeyInputHandler { @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event) { if(KeyBindings.keepForward.isPressed()) System.out.println("FORWAAAAAARD!!!"); } } AutoWalk.java import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; @Mod(modid = AutoWalk.MODID, version = AutoWalk.VERSION) public class AutoWalk { public static final String MODID = "autowalk"; public static final String VERSION = "1.0"; @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { Configuration config = new Configuration(event.getSuggestedConfigurationFile()); MinecraftForge.EVENT_BUS.register(new com.bulubulu.KeyInputHandler()); com.bulubulu.KeyBindings.init(); } @Mod.EventHandler public void init(FMLInitializationEvent event) {} @Mod.EventHandler public void postInit(FMLPostInitializationEvent event) {} } I hope some of you can shed some light on the matter. Thanks!
×
×
  • Create New...

Important Information

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