ExcellentChallenges
  • 🏠 General
    • 🔌 Getting Started
    • 📄 Commands
    • ⛔ Permissions
    • 🧩 Compatibility
    • ❓ Common Questions
    • ❗ Common Issues
    • 🪛 Developer API
  • ⭐ Features
    • 🔨 Action Types
    • 🪝 Conditions
    • 🧬 Generators
    • 🪜 Difficulties
    • 📚 Categories
    • 🎡 Reroll Tokens
  • 🧰 Utility
    • Placeholders
Powered by GitBook
On this page
  1. ⭐ Features

🪝 Conditions

Conditions in generators are optional, but can be useful & interesting to have! They will make challenges more difficult for players to complete.

Each condition config can have multiple condition sections. It will be passed when all conditions from, at least, one of the sections are met. This means you can create simple "if-else" statements in your condition configs!

Syntax for all conditions is as follows:

[condition] [operator] [value]

Comparing order in condition is always as in its syntax! So [conditon] object is compared by [operator] with your [value]. Example: [player_health] > 5 will return true if player's health is above 5.

When having multiple condition sections, the check order of them is undefined. It may not evaluate the predicate on all sections if not necessary for determining the result.

Operators

  • = (EQUAL) - Checks if both objects are equal. Applicable to all objects.

  • != (NOT_EQUAL) - Checks if both objects are not equal. Applicable to all objects.

  • > (GREATER) - Checks if condition object is greater than provided value. Applicable to numbers only.

  • < (SMALLER) - Checks if condition object is smaller than provided value. Applicable to numbers only.

  • % (EACH) - Checks if condition object can be divided by provided value without remainder. Applicable to numbers only.

  • !% (EACH NOT) - Checks if condition object divided by provided value will have remainder. Applicable to numbers only.

List of Conditions

Condition
Returns
Comment
Example

world

World name.

[world] = world_nether

world_storm

true or false

Checks if there is rain in the world.

[world_storm] = true

server_time

Current server real world time.

[server_time] > 17:25

player_level

Current player's XP level.

[player_level] > 10

player_health

Current player's health.

[player_health] < 10 [player_health] > 50%

hand_item

Material of the item in main hand.

[hand_item] = diamond_sword

offhand_item

Material of the item in off hand.

[offhand_item] = shield

head_item

Material of the item on head.

[head_item] = diamond_helmet

chest_item

Material of the item on chest.

[chest_item] = diamond_chestplate

legs_item

Material of the item on legs.

[legs_item] = diamond_leggings

feet_item

Material of the item on feet.

[feet_item] = diamond_boots

Last updated 1 year ago