Jump to content

eatthenight

Members
  • Posts

    43
  • Joined

  • Last visited

Everything posted by eatthenight

  1. you change the data with the methods in your capability class.
  2. so first of all you could just replace every bat that spawns with your custom entity in the EntityJoinWorld event. second you set the attack target but the entity doesnt do anything, it also needs an AI to actually attack i think its EntityAIAttackMelee.
  3. dont use EntityPlayerSP thats the client player use EntityPlayer -> check if the world is not remote do your stuff and then send a packet to do the same on the client.
  4. first of all why are you doing it on the client side? do it on the server side and then send a packet to the client to sync.
  5. as i said look at the LayerArmor or LayerElytra class for example, you add the layer in the EntityConstruct event.
  6. you create a custom render layer class and do your render code in there you can check if the player has the item in his inventory also add the layer e.g in the entity construct event if the entity is an instance of entityplayer. you can also look how the armor layer does it if you’re unsure.
  7. look at the LayerElytra class -> create your own layer class for your cloaks and then add your layer in the RenderPlayerEvent, i think that should work but im not sure. you can probably copy all the code and check if the chest armor is your cloak instead and change the texture.
  8. i tried to make a custom inventory via player capability which stores all the abilities but i didnt like to have all my abilities as items it worked though. maybe i should go back and make a custom inventory which stores all the abilities but honestly dont know what approach would be better though.
  9. so basically i have a player capability which stores abilities/skills (not items) for every player ingame (array of 20) you have a hotbar with 5 skills these are the skills in your first five slots but now i want the player to change his skills in the hotbar with a custom gui. the player should be able to interact with the gui and switch the abilities in these slots just like in a inventory BUT i guess i have to use container so the player can interact with the gui and switch the abilities... the problem is container and slots work only with items as far as i know. do i have to completely rewrite my own container and slot class etc. or does anyone have an idea how i would go about this? my idea: i have a custom class for abilities -> create slots that store a object of my ability class by getting the value from the player capability (or an empty slot if the slot in the player capability is empty) -> container add slots with the abilities -> selecting 2 slots in the container will switch position of abilities -> change player capability data -> sync with client but as you see this is rly simplified and i dont know if there is a better way to do this thanks for any help
  10. you could e.g send a packet to the server when you close the gui or press a button. the server will handle the message do something (or not) and will then (if it was succesful) send a packet back to the client. this is important to prevent cheating and stuff all changes should be made on the server and then synced with the client. for packets look up SimpleNetworkWrapper: https://mcforge.readthedocs.io/en/latest/networking/simpleimpl/ you have to send a packet to the server with the data -> server checks the data, if its valid -> do something -> send a packet back to the client to update the data in the packets you send the data and in the handler you decide what happens with that data
  11. thanks man thats exactly what i needed! ill update later if i have any problems understanding.
  12. 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?
  13. 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
  14. 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: i know the dragon block c mod does this somewhat close to what im trying to do: 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
×
×
  • Create New...

Important Information

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