JUNON . IO
Username
Would you like to play another round?
A function call looks like this
$getGold($player)
Basically, given an input (player), it returns an output (gold of the player). Functions can be used in commands or in ifelse conditions.
| Function | Arguments | Returns |
|---|---|---|
| $getGold | $player | The amount of gold player currently has. Ex. /chat @a $getGold($player) /g |
| $getTeam | $player | The name of team player belongs to. Ex. /chat $player %success% Your team is $getTeam($player) |
| $getRole | $player | The name of role that player belongs to. Ex. /chat $player %success% Your role is $getRole($player) |
| $getScore | $player | The score of player. Ex. /variable set score $getScore($player) |
| $getEquip | $player | The name of current equip player is holding. Ex. /clear $player $getEquip($player) |
| $getEquipId | $player | The id of current equip player is holding. Ex. /stat $getEquipId($player) damage:250 |
| $getRow | $player | The row position of player. Ex. /tp @a[role=Admin] $getRow($player) 64 |
| $getCol | $player | The col position of player. Ex. /tp @a[role=Admin] 64 $getCol($player) |
| $getSpeed | $player | The speed of player. Ex. /score gain $player $getSpeed($player) |
| $getHealth | $player | The amount of health player currently has. Ex. /chat @a $player now has $getHealth($player) health. |
| $getStamina | $player | The amount of stamina player currently has. Ex. /chat @a $player now has $getStamina($player) stamina. |
| $getOxygen | $player | The amount of oxygen player currently has. Ex. /chat @a $player now has $getOxygen($player) oxygen. |
| $getHunger | $player | The amount of hunger player currently has. Ex. /chat @a $player now has $getHunger($player) hunger. |
| $getMaxHealth | $player | The max amount of health player currently has. Ex. /chat @a $player now has maximum health of $getMaxHealth($player) |
| $getMaxStamina | $player | The max amount of stamina player currently has (usually 100). Ex. /chat @a $player now has maximum stamina of $getMaxStamina($player) |
| $getMaxOxygen | $player | The max amount of oxygen player currently has (usually 100). Ex. /chat @a $player now has maximum oxygen of $getMaxOxygen($player) |
| $getMaxHunger | $player | The max amount of hunger player currently has (usually 100). Ex. /chat @a $player now has maximum hunger of $getMaxHunger($player) |
| $getOwner | buildingId | The id of owner. Ex. /setowner @b[type=wall] $getOwner(2917) |
| $random | min, max | A random number between min and max. Ex. $random(2,5) |
| $formatTime | seconds | A formatted time. Ex. $formatTime(60) |
| $getTeamMemberCount | teamName | Number of members in a team. Ex. $getTeamMemberCount(owner) |
| $getRoleMemberCount | roleName | Number of members with role. Ex. $getRoleMemberCount(innocent) |
| $getRegionPlayerCount | regionName | Number of players in a region. Ex. $getRegionPlayerCount(cafe) |
| $getPlayerCount | None | Number of players in game. Ex. $getPlayerCount() |
| $getRegion | playerName or entityId | name of region for player or entity. Ex. /tp @a $getRegion($player) |
| $getEquipCount | playerName | count of equipped item. Ex. /sethealth $player $getEquipCount(kuroro) |
| $getInventoryItemCount | playerName, itemName | total count of item in inventory. Ex. $getInventoryItemCount(kuroro,steak) |
| $getArmorEquip | playerName | name of equipped armor. Ex. /setequipment armor $player $getArmorEquip(kuroro) |
| $add | value1, value2, ... , valueN | Sums all given values. Ex. $add(2,5,8) = 15 |
| $subtract | value1, value2, ... , valueN | Subtracts subsequent values from the first. Ex. $subtract(2,5,1) = -4 |
| $multiply | value1, value2, ... , valueN | Multiplies all given values. Ex. $multiply(2,5,6,7) = 420 |
| $divide | value1, value2, ... , valueN | Divides first value by subsequent values. Ex. $divide(2,4,1) = 0.5 |
| $modulo | value1, value2 | modulo gives the remaining of a division |
| $round | value | Rounds a number to the nearest value at specified precision (including tens, hundreds). Ex. $round(1.2) = 1 |
| $floor | value | Rounds a number down to the specified precision. (including tens, hundreds)Ex. $floor(12.34,-1 ) = 12.3 |
| $ceil | value | Rounds a number up to the specified precision. (including tens, hundreds)Ex. $ceil(56.78,1) = 60 |
| $pow | value1, value2 | Calculates the power of a base raised to an exponent. Ex. $pow(3,2) = 9 |
| $root | value1, value2 | Calculates the nth root of a number. Ex. $root(8,3) = 2 |
| $log | value1, value2 | Calculates the logarithm of a number with optional base. Ex. $log(100,10) = 2 |
| $abs | value | Returns the absolute value of a number. Ex. $abs(-4.5) = 4.5 |
| $max | value1, value2, ... , valueN | Returns the largest value among the given arguments. Ex. $max(9,2,15) = 15 |
| $min | value1, value2, ... , valueN | Returns the smallest value among the given arguments. Ex. $min(1,2,3,4,5) = 1 |
| $isLoggedIn | $player | true if logged in. false if not. |
| $getBuildingType | $entityId | the type name of a building or entity. Ex. /chat @a The building type of entity number 2017 is $getBuildingType(2017) |
| $getDay | None | Gives the daycount of your world back. Ex. /chat @a The daycount of this world is $getDay() |
| $getHour | None | Gives the hourcount of your world back. Ex. /chat @a The hourcount of this world is $getHour() |
| $getContent | $entityId | Gives the content of a sign/beacon/lamp. Ex. /chat The sign says $getContent(191) |
| $getStructureByCoords | $row, $col | Returns the id of a structure based on the row and col specified. Ex. /chat @a the id of the building at 2, 2 is $getStructureByCoords(2,2) |
| $getPlatformByCoords | $row, $col | Returns the id of a platform based on the row and col specified. Ex. /chat @a the id of the floor at 2, 2 is $getPlatformByCoords(2,2)td> |
| $hasEffect | $entityId, effectName | true if the entity, player, or building gets the specified effect. false if not. |
| $getTotalMobCount | None | Returns the total count of all mobs in the game sector (hostile + neutral). |
| $getAngle | $player | Returns the angle of the specified player. Ex. /chat @a $getAngle($player) |
| $getUsage | $itemId | Returns the usage level of an item |
| $getCapacity | $itemId | Returns the usage capacity of an item |
On a PlayerDestroyed trigger, you can run this command:
/caption subtitle $player was killed with $getEquip($killingPlayer)
On an InteractBuilding trigger, you can run these two commands:
/give $player potato 1
/chat @a $player has gotten a potato from $entityId
On a PlayerJoined trigger, you can set up a welcoming script:
/chat @a %green% Welcome our newest player, $player !
You can alarm everyone that a player has bought the ultimate weapon from the trader on a ItemBuy trigger:
(if [$itemType] == [RocketLauncher])
/caption title $player has bought the rocket launcher!
At the end of the timer 'healthreset', loop and reset everyone's health (Timer:healthreset:end):
/timer start healthreset 10
/sethealth @a 100
Access denied