Jump to content

[1.19.2] Trying To Draw A Line Behind Player


Suleiman700

Recommended Posts

Hello.

I am trying to draw a line behind player when he moves.

The idea behind this mod is to help players when they go mining, It will help them follow the walk path using this mod.

The problem is that in 1.19.2 I cannot find the render event & player movement event (maybe these events are not need, I dunno) - I used to create mods for 1.12.2

Like when a player moves it will call a render method that draws line at player pos xyz.

 

Thanks in advance!

Edited by Suleiman700
Link to comment
Share on other sites

Use EntityRenderersEvent.AddLayers to add a new RenderLayer to the player's LivingEntityRenderer.

For players you need to add it to each "skin".

Edited by warjort

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

An alternative approach if you want a "persistant" path is to spawn a Particle at the player's location every few ticks from your own client side PlayerTickEvent

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

17 hours ago, warjort said:

An alternative approach if you want a "persistant" path is to spawn a Particle at the player's location every few ticks from your own client side PlayerTickEvent

 

I am trying to do that but did not find any clue how!

 

I tried but the classes names & methods names are not found at all (World, Level, spawnParticle, addFreshEntity)

World.spawnParticle("reddust", par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, 0.0D, 0.0D, 0.0D);
Level.spawnParticle("reddust", par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, 0.0D, 0.0D, 0.0D);
Level.addFreshEntity("reddust", par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, 0.0D, 0.0D, 0.0D);

idea64-JGvfvunz-TV.png

 

+ Do you know how to get the correct classes names in 1.19.2 ?

Link to comment
Share on other sites

They are not static methods. You get the level via

event.player.level

You also need to check the event.side.isClient() and event.phase (start or end)

You also don't cant addFreshEntity() for a particle, particles are not entities which need to be added on the server.

 

https://forge.gemwire.uk/wiki/Particles

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

1 hour ago, warjort said:

They are not static methods. You get the level via

event.player.level

You also need to check the event.side.isClient() and event.phase (start or end)

You also don't cant addFreshEntity() for a particle, particles are not entities which need to be added on the server.

 

https://forge.gemwire.uk/wiki/Particles

 

Thanks, I've managed to add particles :)

Have a great day

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.



×
×
  • Create New...

Important Information

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