Trying to change the reach of a tool.

Started by Charizard56 on

Topic category: Help with modding (Java Edition)

Last seen on 18:50, 4. Nov 2021
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Trying to change the reach of a tool.

Hello!

At the moment I want to implement two handed weapons to my mod. Of course, I should make their range a little bit longer... though maybe I know the solution, I don't know how to paste it to MCreator, not only that, this method may be only for the older versions of Minecraft...

Well, there was once a guy who asked about it in 2018, and Klemen answered him, saying that this tutorial can help...

http://jabelarminecraft.blogspot.com/p/minecraft-modding-extending-reach-of.html

Now it's 2020 and MCreator can make mods for 1.14.4 and 1.15.2, basically the newest versions. This tutorial is for 1.8, and when I was trying to figure out how you paste it to MCreator's custom code snippets in procedures, later I was trying to figure it out in the... more advanced way, in the... I think this procedure's code, I saw that:

Like in this tutorial, the colors were right (I mean, "public interface" was green and "float" was dark blue), except IExtentedReach and getReach. So I guess that the name of this method (I mean getReach), or however you should call this, was changed or deleted in the newer versions... or am I wrong...?

I don't really know what's wrong and basically, my most important question is how do you increase the reach of a tool? I'm making this mod on 1.15.2, MCreator 2020.5

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
well its kinda difficult if…
Mon, 12/21/2020 - 14:02

well its kinda difficult if you don't know how to code or at least find the appropriate methods for 1.15.2. because even if you were given a plug-and-use complete piece of code to determine if a player has extended reach and then do the things, you would still need to know how to give a player extended reach, which also needs coding.

Last seen on 18:50, 4. Nov 2021
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I could learn how to code, I…
Tue, 12/22/2020 - 14:16

I could learn how to code, I saw some tutorials already. But where to find those methods?

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
on the left side of the…
Thu, 12/24/2020 - 09:57

on the left side of the mcreator ui there's 2 tiny left and down buttons. click on the down button to open this:

https://cdn.discordapp.com/attachments/599250311852458006/791599517170008084/unknown.png

the red arrow shows where the minecraft deobfuscated source code is. find the corresponding 1.15.2 methods in there.

Jabelar's tutorial concept still works, although you'll need to adapt it for 1.15.2. you don't need to implement that IExtentedReach for simplicity. but you will need to implement that MovingObjectPosition method (you can mostly copy it from net.minecraft.client.renderer.GameRenderer#getMouseOver method but change it slightly to see farther.

instead of implemeting an IExtentedReach class, you could just use the REACH_DISTANCE static variable in net.minecraft.entity.player.PlayerEntity instead. extend the player's REACH_DISTANCE attribute, and then check if this attribute's value is greater then the default in your MouseEvent handler.

also, you'll need to learn the new SimpleImpl packet system, it is a bit different from pre 1.12.x

Last seen on 23:57, 31. Aug 2022
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This reminds me of a tool…
Thu, 12/24/2020 - 11:31

This reminds me of a tool from the Aether mod. I don't remember how that was coded, but it had extended reach

Last seen on 18:50, 4. Nov 2021
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you very much for help!
Fri, 12/25/2020 - 10:26

Thank you very much for help!