I need a way to make it so the player does not take fall damage for my next mod. I want the player to have the same health it had before.
Would it be possible to get the block below the player and if it turns to 0 get the current player healt and when the blocks changes to a block greater than 0 set the players health back to what it was?
Would it be possible to get the block below the player and if it turns to 0 get the current player healt and when the blocks changes to a block greater than 0 set the players health back to what it was?
Would it be possible to get the block below the player and if it turns to 0 get the current player healt and when the blocks changes to a block greater than 0 set the players health back to what it was?
Shouldn't this work?
var health=false;
var hearts;
function modTick()
{
if(getTile(Player.getX(), Player.getY()-2.5, Player.getZ())==0&&health==false)
{
hearts=Entity.getHealth(getPlayerEnt());
health=true;
}
if(Entity.getHealth(getPlayerEnt())<hearts&&health==true)
{
health=false;
Entity.setHealth(getPlayerEnt(), hearts);
}
}
var health;
var x;
var y;
var z;
function modTick(){
x = getPlayerX():
y = getPlayerY();
z = getPlayerZ();
if(getTile(x, y-2, z) == 0){
health = Entity.getHealth(getPlayerEnt());
ModPE.saveData("save", health);
}
if(getTile(x, y-2, z) != 0){
ModPE.readData("save");
Entity.setHealth(getPlayerEnt(), health);
}
}
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! ---------------->
How to not take fall damage: Don't be an idiot who falls to their death!
Subscribe to EasyHowTo's today! (not a legit YT channel)
But on a serious note, darkdiamondminer's script should work. Though it is pretty cheap if you get hit by an arrow while in mid air... you won't take the arrow damager.
How to not take fall damage: Don't be an idiot who falls to their death!
Subscribe to EasyHowTo's today! (not a legit YT channel)
But on a serious note, darkdiamondminer's script should work. Though it is pretty cheap if you get hit by an arrow while in mid air... you won't take the arrow damager.
I wonder..... ill be right back! Got to test to see if I can jump at the same exact time tnt explodes
var health;
var x;
var y;
var z;
function modTick(){
x = getPlayerX():
y = getPlayerY();
z = getPlayerZ();
if(getTile(x, y-2, z) == 0){
health = Entity.getHealth(getPlayerEnt());
ModPE.saveData("save", health);
}
if(getTile(x, y-2, z) != 0){
ModPE.readData("save");
Entity.setHealth(getPlayerEnt(), health);
}
}
thanks
Edit: actually this gives an error and I'm not sure why
var health;
var x;
var y;
var z;
function modTick(){
x = getPlayerX();
y = getPlayerY();
z = getPlayerZ();
if(getTile(x, y-2, z) == 0){
health = Entity.getHealth(getPlayerEnt());
ModPE.saveData("save", health);
}
if(getTile(x, y-2, z) != 0){
ModPE.readData("save");
Entity.setHealth(getPlayerEnt(), health);
}
}
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! ---------------->
Nope, if the Player just regularly walks on dirt his health would change all the time
var health;
var x;
var y;
var z;
var offGround = false;
function modTick(){
x = getPlayerX();
y = getPlayerY();
z = getPlayerZ();
if(getTile(x, y-2, z) == 0){
health = Entity.getHealth(getPlayerEnt());
ModPE.saveData("save", health);
iffGround = true;
}
if(getTile(x, y-2, z) != 0 && offGround){
ModPE.readData("save");
Entity.setHealth(getPlayerEnt(), health);
offGround = false;
}
}
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! ---------------->
so the effect will last longer because when I tested it, my game crashed because of the short time the effect is on me.
Like test your mod and make your Y height to something like 500 or so. Then the game will crash because of the effect's time which is too short (10 seconds to be exact while the time you fall to the ground is more likely to be 15 secs.).
But nonetheless , your idea's pretty good.
Rollback Post to RevisionRollBack
《==(-__-)==》
To post a comment, please login or register a new account.
Would it be possible to get the block below the player and if it turns to 0 get the current player healt and when the blocks changes to a block greater than 0 set the players health back to what it was?
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
Shouldn't this work?
var health=false; var hearts; function modTick() { if(getTile(Player.getX(), Player.getY()-2.5, Player.getZ())==0&&health==false) { hearts=Entity.getHealth(getPlayerEnt()); health=true; } if(Entity.getHealth(getPlayerEnt())<hearts&&health==true) { health=false; Entity.setHealth(getPlayerEnt(), hearts); } }Tested this. It doesn't work :/ im out of ideas. But its a good concept to dwell upon.
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
var health; var x; var y; var z; function modTick(){ x = getPlayerX(): y = getPlayerY(); z = getPlayerZ(); if(getTile(x, y-2, z) == 0){ health = Entity.getHealth(getPlayerEnt()); ModPE.saveData("save", health); } if(getTile(x, y-2, z) != 0){ ModPE.readData("save"); Entity.setHealth(getPlayerEnt(), health); } }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! ---------------->
Subscribe to EasyHowTo's today! (not a legit YT channel)
But on a serious note, darkdiamondminer's script should work. Though it is pretty cheap if you get hit by an arrow while in mid air... you won't take the arrow damager.
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]
I wonder..... ill be right back! Got to test to see if I can jump at the same exact time tnt explodes
Want Custom ModPE functions? Look here -> WolfyPE ModPE functions
Edit: actually this gives an error and I'm not sure why
var health; var x; var y; var z; function modTick(){ x = getPlayerX(); y = getPlayerY(); z = getPlayerZ(); if(getTile(x, y-2, z) == 0){ health = Entity.getHealth(getPlayerEnt()); ModPE.saveData("save", health); } if(getTile(x, y-2, z) != 0){ ModPE.readData("save"); Entity.setHealth(getPlayerEnt(), health); } }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! ---------------->
var health; var x; var y; var z; var offGround = false; function modTick(){ x = getPlayerX(); y = getPlayerY(); z = getPlayerZ(); if(getTile(x, y-2, z) == 0){ health = Entity.getHealth(getPlayerEnt()); ModPE.saveData("save", health); iffGround = true; } if(getTile(x, y-2, z) != 0 && offGround){ ModPE.readData("save"); Entity.setHealth(getPlayerEnt(), health); offGround = false; } }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! ---------------->
Use this
function modTick(){
var px = Player.getX();
var py = Player.getY();
var pz = Player.getZ();
if (Level.getTile(px, py-2, pz)==0){
Entity.addEffect(Player.getEntity(), 8, 10*20, 9999, false, true)
}else{
Entity.removeEffect(Player.getEntity(), 8)}}
Genius dude! I can approve that it perfectly work. But maybe you can make it like the effect added is:
so the effect will last longer because when I tested it, my game crashed because of the short time the effect is on me.
Like test your mod and make your Y height to something like 500 or so. Then the game will crash because of the effect's time which is too short (10 seconds to be exact while the time you fall to the ground is more likely to be 15 secs.).
But nonetheless , your idea's pretty good.