Topic category: Help with Minecraft modding (Java Edition)
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
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.
I could learn how to code, I saw some tutorials already. But where to find those methods?
on the left side of the mcreator ui there's 2 tiny left and down buttons. click on the down button to open this:
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
This reminds me of a tool from the Aether mod. I don't remember how that was coded, but it had extended reach
Thank you very much for help!