Jump to content

Help Making a Basic Mod


CreepyCreeper516

Recommended Posts

Hello, i'm trying to make this: When a player presses the F12 key, they will continuously keep crouching every 1 (or few) seconds until that key is pressed again. Any ideas on how to make this? So, basically like a auto sneak. Thanks! ? (If you could, please type the code down below or make the mod and upload the file for me.) BTW, this is for Sky Factory 3. I made an auto tree farm using the Steve's Carts mod but i don't have a way to quickly grow the trees. However, when you rapidly sneak, the saplings will grow. Also, this is just for me - i won't show anyone this code or give the file to them without your permission.

Edited by CreepyCreeper516
Link to comment
Share on other sites

10 hours ago, CreepyCreeper516 said:

i'm trying to make this

 

10 hours ago, CreepyCreeper516 said:

If you could, please type the code down below or make the mod and upload the file for me

Either we are in a paradox, or one of your statements are incorrect.

 

I do not believe anyone here will simply make a mod for you, at least not for free.
I believe Diesieben07 has stated a few times that he charges an hourly salary of 50$.
The other's, I'm not sure about.

 

This place is a forum to learn how to do things, or ask for help.
Requesting someone do everything, isn't asking for help, it's asking them to do everything.

 

However, I can tell you key points of interest:

1) Use either a Tickhandler, or subscribe to the LivingUpdateEvent

2) set sneaking with Entity::setSneaking(bool)

3) Key-presses (like pressing F12) only happen Client-Side, so you might be required to use packets to send the updated sneaking to the server ("so that the trees know that you are sneaking")

Edited by Matryoshika
  • Like 1

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

11 hours ago, CreepyCreeper516 said:

If you could, please type the code down below or make the mod and

It's impolite to request free labor. The volunteers here will answer Forge and Minecraft design questions, but that's all. You're expected to know programming, Java and your IDE (e.g. Eclipse) or find other external resources to learn them.

 

Have you setup a Forge decomp workspace? If not, then go to the tutorials and start reading. If you're set up, then dive into the Minecraft classes and find where key-presses are processed.

 

1 hour ago, Matryoshika said:

Key-presses (like pressing F12) only happen Client-Side...

Good point. My first go at this would be to define a new abstract key (that a user could reassign). Then I'd try to find a way to translate that key's  complete press (down & up) into a sneak-key-down action (if such a thing exists). If that tricks Minecraft into thinking that the sneak key is down and not yet released, then you'd be sneaking continuously until you tapped the real sneak key (its release ending the sneaking).

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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