Jump to content

Recommended Posts

Posted

So, I have a .obj file, which I'd like to have the player sit in the center of. Not override the player's model, but have it rendered on top of them.

I know it's possible, as I've seen it done before, however, I'm unsure how to go about doing it. I know I'll need a TESR but that's about it.

 

I assume I'll have to get the player's coords then render it to that, however I've never done anything with a TESR before, which will make this difficult for me.

 

Any form of help or advice on how to go about doing this is appreciated.

Posted
10 minutes ago, NolValue said:

To clarify, I'm looking for general pointers on how to use a TESR as the documentation for it isn't the greatest.

You don't need a TESR for this. Use the RenderPlayerEvent.Post and render your object model there.

 

A TESR stands for TileEntitySpecialRenderer IE for Block Entities/TileEntities not the player.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
2 minutes ago, NolValue said:

Ah, alright then. I was thinking by using that I'd be overriding the player's model though.

Do you want to draw something like a hat on the player or do you want to change the way the player looks entirely?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted (edited)

I want to draw something on top of the player, or rather around the player.

 

Not replace the model.

 

Sorry for the late response, forgot that I had made this post.

Edited by NolValue
Posted
1 hour ago, NolValue said:

I want to draw something on top of the player, or rather around the player.

 

Not replace the model.

 

Sorry for the late response, forgot that I had made this post.

Then the correct thing to do is what I originally said.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted (edited)

As it turns out, RenderPlayerEvent.post is not the proper way to do this, as I'm going to render something to a player when a button is pressed. It's going to take a lot more work than originally expected, as I need to write a custom .obj parser and renderer now using OpenGL, haha.

Edited by NolValue
Posted
3 hours ago, NolValue said:

as I need to write a custom .obj parser and renderer now using OpenGL

Which isnt that hard, forge has one for block models if you need to you can take a look at that. However if it renders on a button push it requires a little more code. Assuming on button push it needs to render for all players on the player who pushed the button this will require a capability and custom packets to sync the capability. However if not you could simply have a boolean accessible from your proxies. And render off of that.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

Yeah, thankfully my code already has Capabilities and a packet sync setup that I can just add to, haha. 

 

Just need to figure out how to get the player who's using the keybind, which I should be able to by looking through MC's code.

Posted
8 minutes ago, NolValue said:

Just need to figure out how to get the player who's using the keybind, which I should be able to by looking through MC's code.

Minecraft#player since keybinds happen on the client.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
On 10/7/2018 at 9:19 PM, NolValue said:

Ah, alright then. I was thinking by using that I'd be overriding the player's model though.

With most events you have a choice, you can add to the the vanilla behavior or you can fully replace it. It depends on the event but some have the ability to "cancel" the vanilla behavior (and execute the code you put in the event handler), some events allow you to directly replace the contents of a field passed in the event, and some events use the Results return value (like Result.DENY). It is usually described a bit in the comments for the event, and you also trace the call hierarchy to see how the result is used.

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

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.