-
Notifications
You must be signed in to change notification settings - Fork 38
Functions and If statements
Lawrence G edited this page May 24, 2016
·
1 revision
- eatHook()
- Called whenever a player eats a specific item
- useItem()
- Adds a function to any item/block.
- Example:
function useItem(x, y, z, itemId, blockId, side)
- Example:
- Adds a function to any item/block.
- modTick()
- Launches a specific function every second(20Ticks)
- Example: `function modTick()
- Launches a specific function every second(20Ticks)
Called after every function
if(operand0 == operand1){
// code when the two operands are equal
}
var lowhealth = 0;
function modTick() {
if(Player.getHealth() == 1 && lowhealth == 0) {
lowhealth = 1;
clientMessage("ur gonna die skrub");
}
else if(Player.getHealth() == 0 && lowhealth == 1) {
lowhealth = 0;
clientMessage("DID U EVEN LISTEN?!");
}
}