Cmdibuzz Scripting

If/elif/else conditionals for advanced command logic

Updated July 21, 2026

Overview

Cmdibuzz supports basic scripting with if/elif/else/endif blocks inside runcmd. Use the $Script$ prefix with directives.

Directives

| Directive | Format | Description | |---|---|---| | %if% | $Script$%if%$condition | Start an if block | | %elif% | $Script$%elif%$condition | Else-if branch | | %else% | $Script$%else% | Else branch | | %endif% | $Script$%endif% | End of conditional block |

Conditions

Conditions support these operators: ==, !=, >, <, >=, <=

  • String comparison — wrap values in quotes: $player.Gamemode=="creative"
  • Numeric comparison — bare numbers: %PlayerData%$rep_points>49
  • Truthy check — bare non-empty value without operator is treated as true

All placeholders and custom variables are resolved before evaluation.

Example: Toggle Creative Mode

runcmd:
  - $Script$%if%$player.Gamemode!="creative"
  - text: <green>Switching to creative mode...
  - $run_console$gamemode creative $player
  - $Script$%else%
  - text: <yellow>You are already in creative mode!
  - $Script$%endif%

Example: Multi-branch with elif

runcmd:
  - $Script$%if%$player.Gamemode=="survival"
  - text: <green>Switching from Survival to Creative
  - $run_console$gamemode creative $player
  - $Script$%elif%$player.Gamemode=="adventure"
  - text: <green>Switching from Adventure to Creative
  - $run_console$gamemode creative $player
  - $Script$%elif%$player.Gamemode=="spectator"
  - text: <green>Switching from Spectator to Creative
  - $run_console$gamemode creative $player
  - $Script$%else%
  - text: <yellow>You are already in creative mode!
  - $Script$%endif%

Example: Kit with Reputation Points

runcmd:
  - $Script$%if%%PlayerData%$rep_points>49
  - $Script$%PlayerData%$rep_points-50
  - $run_console$give $player minecraft:diamond 10
  - $Script$%else%
  - text: <red>You do not have enough reputation points to claim this kit!
  - $Script$%endif%

The %PlayerData%$varname-50 syntax in the true branch decrements the variable. This is handled by resolving the placeholder and parsing the assignment from the condition-like syntax on $Script$%PlayerData% lines.