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

What is a way to move the clients character forward naturally? A way to get the players character to move forward as if the W key was pushed down for say 3 seconds, I am working on this puzzle idea and it's supposed to be able to be used on any server (It's for boredom and just a learning project of mine) -- and I have been trying to solve how to make the character naturally work forward from the mod but I can't seem to get it!

 

I want a sort of puzzle AI which moves the character in a predetermined fashion that the user then the user has to try to follow it, but how do I path the player like that? As in getting the clients character to move different directions, thank you very much for your help it's heavily appreciated!

  • Author

Hi

 

You might find this link useful

http://greyminecraftcoder.blogspot.com.au/2013/10/user-input.html

It's a bit dated (1.6.4) but most of it is still the same (apart from the packet names) and it should show you where to look in vanilla.

 

-TGG

 

Hey thank you it helped set me on the right track, except I now appear to be at a standstill, I am not sure if I am doing something wrong but most people seem to be able to walk the character forwards like this: "Minecraft.getMinecraft().gameSettings.keyBindForward.pressed = true;" and just kinda tell it that its true, but my forge setup doesn't seem to find .pressed to even exist! it says this "The field KeyBinding.pressed is not visible" I feel like this is something elementary I am missing but I am not quite sure what..

 

Also thank you sincerely for the help and awesome blog writeup!

Hi

 

No worries you're welcome :)

 

The vanilla Keybinding.ispressed is private by default.  If you want to make it public, you can use an access transformer.

http://www.minecraftforge.net/wiki/Using_Access_Transformers

 

Actually I had to do exactly the same thing for a mod I'm working on; my speedytoolsmod_at.cfg contains just this single line

public net.minecraft.client.settings.KeyBinding * # All fields

 

After modifying your gradle.build you'll need to run

gradlew clean setupDecompWorkspace eclipse --refresh-dependencies.

 

After that the fields should be public.

 

You can also use Reflection.  It might be easier (or might not) - I've never used it.  The access transformer worked fine for me.

 

-TGG

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.