Posted April 27, 20169 yr Hello guys,how to add a mana setting to the player character? Like this Each casting spell will consume a certain amount of mana,and mana will slowly recover over time. I have done the part of casting spells within onitemrightclick(),but where should i edit the mana setting?Should i put it in Entityplayer? What should i do next?Is there any function to do that with Entityplayer? --- I'm sorry I forgot 1.7.10 - 10.13.4.1558 Recommended
April 27, 20169 yr 1.8.9+: http://mcforge.readthedocs.org/en/latest/datastorage/capabilities/ -1.8.9: http://mcforge.readthedocs.org/en/latest/datastorage/extendedentityproperties/ Make object, attach it, store mana, edit it when needed. Regeneration can be done with PlayerTickEvent (pick event.phase). You will NEED packets: http://www.minecraftforge.net/forum/index.php/topic,20135.0.html Rendering can be done with RenderGameOverlayEvent (pick sub event, most likely Post and event.type). 1.7.10 is no longer supported by forge, you are on your own.
April 27, 20169 yr Something to make note of if you run in to render issues. I had to remove my getType check for my bar to render properly. I tried with every ElementType and every single one of them made my bar render with the wrong colors. So start out using it but if you have issues keep in mind that you may have a similar problem. Current Project: Armerger Planned mods: Light Drafter | Ore Swords Looking for help getting a mod off the ground? Coding | Textures
April 27, 20169 yr Since you didn't specify Minecraft version: adding mana via IEEP tutorial for 1.6.4 through 1.8.0 can be found here. It helps people respond with more appropriate advice when you include the Minecraft version for which you are coding in your thread's title. http://i.imgur.com/NdrFdld.png[/img]
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.