Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Integer Variables

1cec0ld edited this page Jan 16, 2013 · 9 revisions

Integer variables allow a huge amount of flexibility in ModDamage that would be impossible otherwise. You can use them as additional conditions for when damage should be applied, or use them to alter the damage being dealt. Many of them can even be changed with the Change Value Routine. In addition to the integers listed in Events, are these properties for vanilla ModDamage:

  • {entity}_airticks - Entity's current number of air ticks. These only decrease while an entity's head is submerged in a water block, and are reset in any other case. 1 second of effect per 20 ticks.
  • {entity}_falldistance - How many blocks the entity has currently fallen. Not settable.
  • {entity}_fireticks - Entity's current remaining fire ticks. 1 second of effect per 20 ticks.
  • {entity}_health - Amount of health the entity currently has.
  • {entity}_maxhealth - Maximum amount of health the entity can have.
  • {entity}_nodamageticks - Since damage events are fired when there are still NoDamageTicks left on an entity, configurers might like this to reduce some overhead in conjunction with a conditional switch. Tinker at your leisure with this one.
  • {entity}_light - The light level of the block the entity is located at. Not settable.
  • {entity}_size - Returns the size of a Slime. Can't be used anywhere else.
  • {entity}_x - Entity's X coordinate.
  • {entity}_y - Entity's Y coordinate.
  • {entity}_z - Entity's Z coordinate.
  • {player}_exhaustion - When the level reaches above 4 it will decrease by 4 and subtract 1 point either from Saturation or, if Saturation equals zero, from foodLevel
  • {player}_experience - Percentage of experience gained towards the next level
  • {player}_level - This governs the level of enchantments you can do.
  • {player}_totalExperience - This is all the experience gathered by the player
  • {player}_foodLevel - Points in the food bar. Max is 20. See here.
  • {player}_gameMode - 0 for survival, 1 for creative.
  • {player}_saturation - Saturation is a type of tick that delays the food bar decreasing after eating some food. See here.
  • {player}_sleepTicks _ How long a player has been asleep in bed?
  • {player}_held_slot - The current slot a player is selecting as their held item. 1-9. Not settable.
  • {item}_{property} where {property} is durability, max_durability (not settable), data, amount, max_amount (not settable), dropchance
  • {world}_time - Time of day in the event world. 24000 is the max time.
  • {world}_{property} - where {property} is fulltime, day, and moonphase. moonphase not settable.
  • {world}_onlineplayers - Number of players currently in the world. Not settable.
  • {chunk}_x - The location on the chunk grid. Should be {block}_x/16 for each block inside the chunk.
  • {chunk}_z - The location on the chunk grid. Should be {block}_z/16 for each block inside the chunk.
  • server_onlineplayers - Number of players currently in the server. Not settable.
  • server_maxplayers - What does it sound like? Not settable.
  • interact_block_(type|data) - Only usable in the Interact event. Not settable.
  • {item}_enchant[ment]level_{enchantment name} - The level of the specified enchantment on the item. The level is 0 if the enchantment is not on the item. Setting this variable will give that enchantment to the item.
  • {block}_{property} - where {property} is power, light, blocklight, skylight, type, and data. type and data are both settable.
  • {string}_length - The amount of characters, including spaces, of the given "string"
  • toInt({string}) - Tries to convert the string into an integer, if it is comprised of only numbers.

Servers also using McMMO will have access to the following number references:

  • {player}_skill_{skill} - Possible {skills}: Acrobatics, All, Archery, Axes, Excavation, Herbalism, Mining, Repair, Sorcery, Swords, Taming, Unarmed, Woodcutting
  • {player}_bleedTicks
Clone this wiki locally