Class Enhancement Wiki › Guides › Run Automatic Commands When Selecting a Class
Run Automatic Commands When Selecting a Class
Understand Command Execution
The Class Enhancement Mod automatically runs commands from your class configuration the moment a player selects that class. Commands execute without requiring manual input.
Add Commands to Your Class
In class_enhancement.toml, locate your custom class and find the commands list. Add commands without the leading / symbol. Use %player% as a placeholder for the player's name:
`
commands = [
"tp %player% 100 64 200",
"effect give %player% minecraft:speed infinite 1 false",
"scale set %player% 1.5"
]
`
Common Use Cases
- Teleport: Send players to a spawn location
- Team Assignment: Add players to teams automatically
- Size Changes: Modify player scale (requires Pehkui mod)
- Potion Effects: Grant permanent buffs or debuffs
Test Your Commands
Save the file, restart, and select your class. Watch the chat or action bar for command feedback. Verify the intended effect occurs.