I am making a mod that adds a new block, and when you stand on it it you lose damage until you get off of it. I tested my code, and I got no errors but nothing happens. I've tried changing the code and thinking of solutions, but nothing works. Any help? Here is my code.
function modTick(){
var playerX = Player.getX();
var playerY = Player.getY();
var playerZ = Player.getZ();
var blockY = playerY - 1;
if(Level.getTile(playerX,blockY,playerZ) == 255){
As far as I can tell, it looks like you're setting the health to nothing, and then checking health and subtracting from what is shown instead of actually doing damage
Hello!
I am making a mod that adds a new block, and when you stand on it it you lose damage until you get off of it. I tested my code, and I got no errors but nothing happens. I've tried changing the code and thinking of solutions, but nothing works. Any help? Here is my code.
function modTick(){
var playerX = Player.getX();
var playerY = Player.getY();
var playerZ = Player.getZ();
var blockY = playerY - 1;
if(Level.getTile(playerX,blockY,playerZ) == 255){
Entity.setHealth(getPlayerEnt(), Entity.getHealth(getPlayerEnt()) - 0.5);
}
}
As far as I can tell, it looks like you're setting the health to nothing, and then checking health and subtracting from what is shown instead of actually doing damage
Nvm I've already figured that problem out, but do you know any way to make animated block textures?
No idea :/
ok