Jump to content

Recommended Posts

Posted

so basically i wanna render an aura around the player when the player activates his aura, i created a capability for the player which stores all the information about the aura (how much he has left, has activated his aura and stuff)

now im wondering what would be the best approach to do this? i thought you could either just render it on every client when the player has his aura activated based on the value stored in the capability but for that i think you need to inform every other player via packets that the player activated his aura to render it properly on every client player, but wouldnt that be much data traffic to send it every time a player activates/deactives his aura e.g. when you have a server with alot of players? another possibility could be just to spawn an entity which moves with the player that would automatically sync with every client when done properly and i would spawn the entity based on the value stored in the player capability for that player and kill it when the player deactivates it (server side). so any ideas what would be the best approach?

 

but NOW to my main question as i never rly did much with rendering and stuff how would i render it are there any render tutorials or stuff i could read for that? i never rendered stuff in minecraft besides like custom guis so how does it work?

cuz i will have to write my own render(er) code for this.

im tryin to recreate this in minecraft:

 

232324831_HunterXHunter-89-Large02.thumb.jpg.dac50fe17d51a03b064ccb89a5f5c7fe.jpg

 

i know the dragon block c mod does this somewhat close to what im trying to do:

screen-2.thumb.jpg.ccb659812e95f62575a1ea4f04b46f2d.jpg

 

but how do you render stuff like this in minecraft do you use a custom model and render it like an entity or how do you do it?

would be glad if someone can help me out to how to LEARN to do this as i want to understand what im doing 

 

i know basic to advanced java coding so i think that should be no problem as long as i have something where i actually understand what everything does.

thanks for any help

-eatthenight <33

 

Posted

Subscribe toRenderPlayerEvent.Post and do your render there.

You might want to look up on OpenGL basics in order to do the rendering, then check out Minecraft’s Tessellator and BufferBuilder.

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.

 

 

Posted
2 hours ago, DavidM said:

Subscribe toRenderPlayerEvent.Post and do your render there.

You might want to look up on OpenGL basics in order to do the rendering, then check out Minecraft’s Tessellator and BufferBuilder.

hi thanks first of all!

now the thing is when i do it in renderplayerevent would it automatically sync with every other client or how would that work? i was wondering because later on i want every player to be able to change the color of the aura too i was also thinkin about adding like tails n stuff based on the players race.. so when you add new render stuff to that specific player it will be visible for every other player too or would i have to send packets to all clients to let them know when to render and what..? i will try to look up some opengl basics :))

Posted (edited)

RenderPlayerEvent is fired when a player is rendered. This includes the rendering of other players in multiplayer. You will have fetch data from the player in the event and determine the color of the aura.

Edited by DavidM

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.

 

 

Posted

thanks that sounds perfect! i will try it out after learning the opengl stuff. still one question i dont want to change the player model due to compatibility with other mods but is it also possible to add models to the player like a tail, hats and so on based on the capability data? what would be the best approach there?

  • 1 year later...
Posted

😃 Man, this topic is exactly what I need! I'm trying to create an aura for my mod (It would look exactly like the one from Dragon Block C... Yet, I'm still very confused... is there any way someone could relate this to me in baby language? 😅 

Quote
On 8/20/2019 at 8:56 AM, eatthenight said:

thanks man thats exactly what i needed! ill update later if i have any problems understanding.

 

Did you ever get what you needed? If so, can you tell me how to make this for my mod? (I use Mcreator, but you can still make stuff by custom code) Thanks so much! It's greatly appreciated!

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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