Download BlanketConditionalText — Minecraft Mods — MetaMods
BlanketConditionalText

BlanketConditionalText

Active

Downloads

2

Last update

10 months ago

Versions

1.21 — 1.21.4
Server
Fabric
Control
Social
Utils

BlanketConditionalText

🔍 Overview: The BlanketConditionalText modification provides server owners with the ability to display dynamic messages that change based on player statistics, time of day, and other customizable parameters. Using placeholders defined in JSON files, you can control what players see on scoreboards, in chat, holograms, and other locations — all based on flexible rules!

Perfect solution for informing players, entertainment, and displaying key statistics and events!

📜 Main Features:

  • Creating placeholders with conditions to display specific messages based on game values
  • Support for multiple rules for each placeholder with different messages
  • Simple configuration through JSON with options for text color, permissions, and custom placeholders

📂 How It Works: Placeholders are defined in JSON files located in the config/blanketct/placeholders folder. Each placeholder contains:

  • placeholderid — unique identifier for use in the game
  • Source placeholder that retrieves values (for example, %player:health% or %server:time H%)
  • Custom rules with conditions and messages to display when conditions are met

📋 Explanation of Conditions: Conditions are the foundation of how BlanketConditionalText displays context-sensitive messages. Using conditions, you can decide which message to show based on the placeholder value (for example, player health or server time).

Each condition includes:

  • Operator: Defines the type of comparison:
    • < (less than)
    • > (greater than)
    • = (equal to)
    • != (not equal to)
  • Value: Threshold value against which the placeholder value is compared

The mod checks conditions in the order they are defined in the JSON configuration. It starts from the top of the list, checks each condition, and stops at the first matching condition. If no conditions match, a fallback message is displayed (the last rule without a condition).

Step-by-Step Principle of Condition Operation

  1. Retrieving Placeholder Value: The mod retrieves the current placeholder value, for example, player health or time of day
  2. Checking Each Condition: Starting from the top, it compares the placeholder value with each rule's condition
  3. Displaying First Matching Text: As soon as a matching condition is found, the corresponding text is displayed and further checking stops
  4. Fallback Message: If none of the conditions match, the mod shows text from the rule with null as the condition (if it exists)

Examples:

1️⃣ Health Status Placeholder

  • Shows different messages depending on the player's health level
{
"placeholderid": "health_status",
"placeholder": "%player:health%",
"rules": [
  { "condition": "<3", "text": "§cYou're about to die!" },
  { "condition": "<6", "text": "§eYou're still fine..." },
  { "condition": null, "text": "§aHealthy as ever!" }
]
}
  • Usage: %blanketct:health_status%
  • Display:
    • You're about to die! (when health < 3)
    • You're still fine... (when 3 ≤ health < 6)
    • Healthy as ever! (when health ≥ 6)

2️⃣ Time of Day Placeholder

  • Shows messages depending on server time
{
"placeholderid": "time_of_day",
"placeholder": "%server:time H%",
"rules": [
  { "condition": "<12", "text": "§6Good morning!" },
  { "condition": "<18", "text": "§eGood afternoon!" },
  { "condition": null, "text": "§9Good evening!" }
]
}
  • Usage: %blanketct:time_of_day%
  • Display:
    • Good morning! (when time < 12)
    • Good afternoon! (when 12 ≤ time < 18)
    • Good evening! (when time ≥ 18)

Reload Command:

  • Use /bct reload to reload configuration files without restarting the server (requires bct.reload permission)

⚙️ Customizability and Expandability: Simply add new JSON files to the configuration folder to expand your set of placeholders and rules.

Project members
KrripeYT

KrripeYT

Developer

Created: 12 Nov 2024

ID: 63962