Jump to content

[1.12] Player control riding custom entity


Spaceboy Ross

Recommended Posts

1 minute ago, Spaceboy Ross said:

The 3 variable arguments all are set to 0.0f, so that may be the problem.

do you understand what the code is doing?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

1 minute ago, Spaceboy Ross said:

I believe that the 3 float arguments are supposed to be movement X, Y, and Z and that the code is supposed to move the entity based on those arguments.

Looks that way to me too, do you understand whats being done in the code and how its moving the entity?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

Have you stepped through it with a debugger and seen whats happening (if its being called at all)?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

@Spaceboy Ross You're at a very important point in your programming/modding learning and my main advice is "slow down and understand". You're jumping around across a number of advanced modding topics while missing some fundamental skills related to Java programming as well as setting up your mod. Cutting and pasting and guessing at changing values is not a good way to develop your ability and will lead to weirder and weirder bugs in your code.

 

Now you certainly SHOULD use vanilla code as a reference, even copying portions of it, but you also MUST understand what the code is doing. So if you have a parameter name that is something like p_191986_1_ in the vanilla code you should rename it according to what it actually does. Your code will become much more readable, and your ability to modify it properly will improve. If you don't understand Java well enough to know that you can rename the parameters then you really need to practice getting stronger in Java as well. For parameters passed into a method, the name of the method and the TYPE and order of the parameters must match the call, but the name can be anything you want (and should be meaningful).

 

In order to figure out what the parameters really mean (so you can name them correctly) you should look at the Call Hierarchy (right-click on method name in Eclipse and it will give you that option) to see where other code that uses the method is. You can look at that and it is usually pretty obvious then what the fields represent.

 

Then, regarding debugging you have not followed my suggestion regarding adding lots of console print statements through your code. You should be able to identify what is wrong with almost any code within 10 minutes if you print out the right info to trace the execution. In your case you keep saying "it doesn't work" but that isn't helpful. You need to figure out if your method isn't being called at all versus whether it is being called and executing differently than you expect.

 

I don't personally use debug mode much (I find console statements work for most cases) but if you're going to do that then you need to learn how to do that properly -- setting breakpoints, ensuring the thread settings are correct (so other threads don't time out), and learn the various ways to step through (or into) the code. There are lots of tutorials for that.

 

The reason why we're all jumping in on this thread is because you're showing a lot of potential and obviously have a passion for modding, but you're missing some important lessons you need to learn in order to really progress.

 

So, simply (a) figure out what the code is supposed to do (b) trace the execution.

  • Thanks 3

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Just now, Spaceboy Ross said:

The debugger wouldn't work, my framerate dropped to nothing while debugging and my CPU got maxed out.

did you make any breakpoints? how did you launch it? what are your computer specs?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

You said this amazingly eloquently and motivatingly.

I have to say though that using debug mode you can hot swap code which is absolutely invaluable.

Edited by Cadiboo
typo
  • Thanks 1

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

1 minute ago, Spaceboy Ross said:

The 3 float arguments are strafing movement, vertical movement, and forward movement.

Okay good, so in Eclipse highlight each parameter name, right-click and choose Refactor | Rename and call them something like strafeIn, vertMotionIn, forwardMotionIn. 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

22 hours ago, Spaceboy Ross said:

I'm sure it's being called because I had print statements printing out the argument values.

Okay, now trace the rest. Is the motion and rotation of the entity changing as expected then?

 

In addition to adding console statements to you custom methods, I often also add some to an event like LivingUpdateEvent. Check for your entity type and print out things like position and motion, plus information about whether it thinks it is isRidden and who the rider is.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

4 hours ago, Spaceboy Ross said:

I discovered that if I run setVelocity or move nothing happens. Does anyone know how to make the entity move because it's refusing to move?

I think entity has the method move(x,y,z, MoverType)

https://github.com/Cadiboo/WIPTechAlpha/blob/c179d852e43f08d6e9f34db62bd2a59c36475e6b/src/main/java/cadiboo/wiptech/entity/item/EntityPortableGenerator.java#L85 

 

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

On 9/22/2018 at 3:17 PM, Spaceboy Ross said:

The isRider and all rider properties are true, the entity is fully aware that there is a rider on it. The arguments are just outputting 0, that's all it's doing.

Then you have to trace back further. Why is the code that is calling the method passing zeros. Keep working backwards until you find where the values are determined.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.