Jump to content

Recommended Posts

Posted (edited)

I'm making an item that when held down is supposed to show a copy of the player at the raytraced position for the local client only, any ideas on how to accomplish this?

Version 1.16.5

Edited by AMOnDuck
forgot to specify version
Posted

HI duck, I think you should be able to just render the player at the centre of the screen, and scale it according to the distance of the ray tracing.

I have recently accomplished similar target, but in this case I'm doing the laser projection on the wall: Video

The laser rotates, scales, and the alpha changes according to the position of the hit, which I think is probably easier than actually render the thing in the world.

I might be wrong tho, I would also like to see if we have any other better solution.

  • Thanks 1
Posted (edited)

For just showing the player you could look at how the inventory does it, which it does in the renderEntityInInventory method in the InventoryScreen class (at least with offical mappings). 

This is the code for it, along with explanations on what I think all of the parameters mean

  Reveal hidden contents

This code is all untested however so I'm guessing you'll need a lot of other functions inside of the class, so here's just the entire thing

[removed copy-pasted vanilla code]

Hope this helps

Edited by diesieben07
  • Thanks 1

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.