Jump to content

[KIND OF SOLVED][1.15.2] Using Minecraft#setRenderViewEntity without player disappearing


Novârch

Recommended Posts

I've made a custom entity that I use Minecraft#setRenderViewEntity with. I do this because I want the player to be able to remotely control the entity and I think it looks cool. When using the method the player's model disappears, how can I prevent that, is there a better method do achieve the effect I'm looking for?

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Link to comment
Share on other sites

Haven't looked at the code regarding this yet (currently on mobile), but I believe this is caused by the player's model is not being rendered in first person view (the game still thinks the player is in first person view).

I would suggest to check out the rendering of the player in third person view (see references to GameSettings::thirdPersonView)

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

14 hours ago, diesieben07 said:

The logic for when an entity is being rendered or not is in WorldRenderer#updateCameraAndRender (look at the for loop at the end where it calls renderEntity). You have to make sure that the conditions there are met.

I don't think that's what I'm looking for, one of the conditions is !(entity instanceof ClientPlayerEntity), my issue is the player not rendering, the renderViewEntity renders just fine up to a certain distance from the player.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Link to comment
Share on other sites

9 minutes ago, diesieben07 said:

Breaking the check down an entity is being rendered if all the following are true:

  1. The entity is inside the view frustrum or being ridden by the player.
  2. The entity is not the renderViewEntity or third person mode is active or the entity is sleeping.
  3. The entity is not a player or is the renderViewEntity.

1 and two are satisfied (the player will be inside the view frustrum and it will not be the renderViewEntity).

The third one is the problem here, it is a player and not the renderViewEntity. There does not seem to be a way to bypass this.

What about making a custom entity and setting it's position to the player's?

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Link to comment
Share on other sites

  • Novârch changed the title to [KIND OF SOLVED][1.15.2] Using Minecraft#setRenderViewEntity without player disappearing

It might be better to manually render a player there instead of creating a new entity, as the effect is intended for visual only.

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

6 hours ago, DavidM said:

It might be better to manually render a player there instead of creating a new entity, as the effect is intended for visual only.

You can do that? How?

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Link to comment
Share on other sites

3 hours ago, Novârch said:

You can do that? How?

You can subscribe to RenderWorldLastEvent and render the player model in the subscriber.

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

18 hours ago, DavidM said:

You can subscribe to RenderWorldLastEvent and render the player model in the subscriber.

A few questions about that, do I make an instance of PlayerModel or PlayerRenderer, how do I set the model's position, how do I get an instance of IVertexBuilder, do I make my own if so how does it work?

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

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.