*sigh* ModPE.readData() and ModPE.saveData() are officially the most annoying ModPE functions. How in the world does it work???? In Darth377's risk mod, his is fine. In my enchantments mod when I use ModPE.saveData() on an integer, ModPE.readData() returns a string???? Is this supposed to happen??? Can someone give me a working example of ModPE.saveData() saving an integer from a variable and ModPE.readData() reading the variable. On Connor4898's GitHub Wiki functions list, there is nothing about ModPE.readData() converting an integer to a string.
Anyone who provides a working example/answer will be rewarded with a reputation point and early betas of my enchantments mod when it is perfected.
New Problem:
How can a set a variable to 0 when the player's health is 0. I have tried this with ModTick, but apparently when you leave the game, the player's health is set to 0. Is there any way to do what I want?
New Problem:
How can a set a variable to 0 when the player's health is 0. I have tried this with ModTick, but apparently when you leave the game, the player's health is set to 0. Is there any way to do what I want?
Maybe have it set the players health to what ever it was when they leave the game?
var health = Entity.getHealth(getPlayerEnt());
var variable = 1424;
function modTick() {
if(health == 0) {
variavble = 0;
}
}
Rollback Post to RevisionRollBack
Make sure you follow me on twitter! @DarkDiaMiner IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
Maybe have it set the players health to what ever it was when they leave the game?
modTick() is quicker then leaveGame(). If I could do this before modTick() then ModPE.saveData() would have worked before the experience was reset because the player "died" according to MCPE.
No, he wants an int to save when he leaves the game, the problem is it detects when the player dies, but when you leave pocket edition the player "dies".
Anyone who provides a working example/answer will be rewarded with a reputation point and early betas of my enchantments mod when it is perfected.
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
How can a set a variable to 0 when the player's health is 0. I have tried this with ModTick, but apparently when you leave the game, the player's health is set to 0. Is there any way to do what I want?
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
Maybe have it set the players health to what ever it was when they leave the game?
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
var health = Entity.getHealth(getPlayerEnt()); var variable = 1424; function modTick() { if(health == 0) { variavble = 0; } }IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
Wait then how can you save a integer?
Link:
http://www.minecraft.../#entry29816329
You can either do
if(ModPE.readData("experience")=="0"){experience = 0;}or you could just do parseInt()
That is the best solution I have found!!! I tried this and it didn't work, so this must work! (sorry for the sarcasm). Are people blind or something?
modTick() is quicker then leaveGame(). If I could do this before modTick() then ModPE.saveData() would have worked before the experience was reset because the player "died" according to MCPE.
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions