Use extended properties to save the name. It will persist for that player in that world save even if you close Minecraft. Just follow the tutorial.
I don't think what you want is possible, at least not without storing the data online and retrieving it each time the player logs in. That is well beyond the scope of this tutorial, sorry.
Hmmm... I think that NEI did it with creating new txt files in mc directory. Whatever. I'll look into it some more maybe go on stackoverflow.com or something!
Next to the play button click the dropdown window and click "Run Configurations". Than click on client (there are 2 of them and it they are the same) than click on "Arguments" and place the --username=XYZXYZXY under the "program arguments"
Rollback Post to RevisionRollBack
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
Next to the play button click the dropdown window and click "Run Configurations". Than click on client (there are 2 of them and it they are the same) than click on "Arguments" and place the --username=XYZXYZXY under the "program arguments"
Hmmm... I think that NEI did it with creating new txt files in mc directory. Whatever. I'll look into it some more maybe go on stackoverflow.com or something!
Sure, that could work, too. You just need somewhere outside of the standard save directory structure that you can easily access, but there are limitations: what happens if the player/server migrates a world save directory somewhere else? Suddenly, whatever data you were storing is potentially lost. What if I log in to a different server? They don't have my file. Thus my suggestion of an online repository such as Minecraft uses for player skins.
Sure, that could work, too. You just need somewhere outside of the standard save directory structure that you can easily access, but there are limitations: what happens if the player/server migrates a world save directory somewhere else? Suddenly, whatever data you were storing is potentially lost. What if I log in to a different server? They don't have my file. Thus my suggestion of an online repository such as Minecraft uses for player skins.
Yeah I might try that out.
Thanks!
Rollback Post to RevisionRollBack
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
Am i right, that i have to make a new instance of IExtendedEnttyProperties for each variable? I want to let the player have a Name and a Surname. Is there a way to do that in one class?
Am i right, that i have to make a new instance of IExtendedEnttyProperties for each variable? I want to let the player have a Name and a Surname. Is there a way to do that in one class?
Please learn basic Java. Even in the tutorial examples I have more than one variable in a class (max and current mana).
Am i right, that i have to make a new instance of IExtendedEnttyProperties for each variable? I want to let the player have a Name and a Surname. Is there a way to do that in one class?
Your question clearly contradicts your latter claim. Adding class members is so fundamentally basic, not just to Java, but any Object Oriented language, that it is a dead giveaway if you don't know it. Please don't claim to know what you don't - it is not only absurd, but preventing yourself from trying to learn more by thinking you already know 'enough'.
Your question clearly contradicts your latter claim. Adding class members is so fundamentally basic, not just to Java, but any Object Oriented language, that it is a dead giveaway if you don't know it. Please don't claim to know what you don't - it is not only absurd, but preventing yourself from trying to learn more by thinking you already know 'enough'.
No! I just wasnt finished reading your tutorial! I am coding Java since 4 years.
No! I just wasnt finished reading your tutorial! I am coding Java since 4 years.
You must be joking, right? How have you coded for 4 years and not yet learned how to add more members to a class? You shouldn't be expecting to learn that in my tutorial, it is taken as a given. I'm not trying to be rude here, but you have a major disconnect between what you think you know and what you truly know, and the error is not in your favor.
I suggest you to stop all modding (temporarily), forget everything you think you know about Java (surely you aren't confusing it what JavaScript?!), and start from square one. I'm being totally serious, here. Go through the entire tutorial, not just reading it but using it. Make a few simple programs. Read more. After a month or two of that, come back and try again - hopefully it will be much easier, comprehensible, and fun.
You must be joking, right? How have you coded for 4 years and not yet learned how to add more members to a class? You shouldn't be expecting to learn that in my tutorial, it is taken as a given. I'm not trying to be rude here, but you have a major disconnect between what you think you know and what you truly know, and the error is not in your favor.
I suggest you to stop all modding (temporarily), forget everything you think you know about Java (surely you aren't confusing it what JavaScript?!), and start from square one. I'm being totally serious, here. Go through the entire tutorial, not just reading it but using it. Make a few simple programs. Read more. After a month or two of that, come back and try again - hopefully it will be much easier, comprehensible, and fun.
NOOOOOOOOOOOOOOOOOOOOOO!I was not joking . I now exactly how to add new members, new variables and all that. I just was a bit confused by your tutorial, because first you make the IExtendedEntityProperties, then some other things and then you change some things in the properties.
The Meaning of Life, the Universe, and Everything.
Join Date:
8/20/2014
Posts:
51
Location:
In The Cloud
Minecraft:
MESSpace
Member Details
How would I go about getting the value of Mana a player has, and then outputting it into the chat using an item? I know how to use the onItemRightClick and player.addChatMessage, but I can't seem to get the player Mana value.
How would I go about getting the value of Mana a player has, and then outputting it into the chat using an item? I know how to use the onItemRightClick and player.addChatMessage, but I can't seem to get the player Mana value.
EDIT: I'm running minecraft 1.7.10
It's the same for any MC version: get the extended properties instance for the player you have, then call the getCurrentMana or whatever method you need.
It's the same for any MC version: get the extended properties instance for the player you have, then call the getCurrentMana or whatever method you need.
So would the getCurrentMana just return the currentMana variable? Or would it read from NBT? Because With the currentMana variable it just returns a zero, even when I have your test item set up (which works perfectly fine).
Rollback Post to RevisionRollBack
If you need help with modding, feel free to message me!
Click The Achievement Below To See My Stuff!
So would the getCurrentMana just return the currentMana variable? Or would it read from NBT? Because With the currentMana variable it just returns a zero, even when I have your test item set up (which works perfectly fine).
That depends which implementation you are using: are you using a variable for currentMana, or storing it in DataWatcher? In the end, it shouldn't matter - getCurrentMana should return the current mana, but it sounds like you didn't code your method correctly.
That depends which implementation you are using: are you using a variable for currentMana, or storing it in DataWatcher? In the end, it shouldn't matter - getCurrentMana should return the current mana, but it sounds like you didn't code your method correctly.
Show your code.
Here is my method:
public int getMana() {
return this.currentMana;
}
It's pretty simple, and just returns the value of currentMana.
Rollback Post to RevisionRollBack
If you need help with modding, feel free to message me!
Click The Achievement Below To See My Stuff!
To post a comment, please login or register a new account.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumConfigure your run configuration's arguments and add '--username yourname' to have a specified name each time.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumWhere are the run configurations arguments?
- YouTube - -Twitter - - Facebook - -Website-
Hmmm... I think that NEI did it with creating new txt files in mc directory. Whatever. I'll look into it some more maybe go on stackoverflow.com or something!
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
Next to the play button click the dropdown window and click "Run Configurations". Than click on client (there are 2 of them and it they are the same) than click on "Arguments" and place the --username=XYZXYZXY under the "program arguments"
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumSuper! Thanks
- YouTube - -Twitter - - Facebook - -Website-
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumSure, that could work, too. You just need somewhere outside of the standard save directory structure that you can easily access, but there are limitations: what happens if the player/server migrates a world save directory somewhere else? Suddenly, whatever data you were storing is potentially lost. What if I log in to a different server? They don't have my file. Thus my suggestion of an online repository such as Minecraft uses for player skins.
Yeah I might try that out.
Thanks!
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
-
View User Profile
-
View Posts
-
Send Message
Curse Premium- YouTube - -Twitter - - Facebook - -Website-
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumPlease learn basic Java. Even in the tutorial examples I have more than one variable in a class (max and current mana).
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYes sorry, i havent read your tutorial properly the moment i wrote. And i can code Java quite well
- YouTube - -Twitter - - Facebook - -Website-
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYour question clearly contradicts your latter claim. Adding class members is so fundamentally basic, not just to Java, but any Object Oriented language, that it is a dead giveaway if you don't know it. Please don't claim to know what you don't - it is not only absurd, but preventing yourself from trying to learn more by thinking you already know 'enough'.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumNo! I just wasnt finished reading your tutorial! I am coding Java since 4 years.
- YouTube - -Twitter - - Facebook - -Website-
lol #wrekt
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYou must be joking, right? How have you coded for 4 years and not yet learned how to add more members to a class? You shouldn't be expecting to learn that in my tutorial, it is taken as a given. I'm not trying to be rude here, but you have a major disconnect between what you think you know and what you truly know, and the error is not in your favor.
I suggest you to stop all modding (temporarily), forget everything you think you know about Java (surely you aren't confusing it what JavaScript?!), and start from square one. I'm being totally serious, here. Go through the entire tutorial, not just reading it but using it. Make a few simple programs. Read more. After a month or two of that, come back and try again - hopefully it will be much easier, comprehensible, and fun.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumNOOOOOOOOOOOOOOOOOOOOOO!I was not joking
- YouTube - -Twitter - - Facebook - -Website-
EDIT: I'm running minecraft 1.7.10
Click The Achievement Below To See My Stuff!
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIt's the same for any MC version: get the extended properties instance for the player you have, then call the getCurrentMana or whatever method you need.
So would the getCurrentMana just return the currentMana variable? Or would it read from NBT? Because With the currentMana variable it just returns a zero, even when I have your test item set up (which works perfectly fine).
Click The Achievement Below To See My Stuff!
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThat depends which implementation you are using: are you using a variable for currentMana, or storing it in DataWatcher? In the end, it shouldn't matter - getCurrentMana should return the current mana, but it sounds like you didn't code your method correctly.
Show your code.
Here is my method:
public int getMana() { return this.currentMana; }It's pretty simple, and just returns the value of currentMana.
Click The Achievement Below To See My Stuff!