Using Actions Outside of a Button
zMenu actions are not limited to button clicks β you can execute them independently in your own plugin logic. This is useful for reusing features like sending messages, teleporting, executing commands
Step 1: Load Actions from Configuration
List<Map<String, Object>> rawActions = config.getMapList("custom-actions");custom-actions:
- type: console command
commands:
- "eco give %player% 1000 %reason%"Step 2: Load Action Instances
List<Action> actions = buttonManager.loadActions(rawActions, "custom-actions", configFile);Step 3: Prepare Execution Context
Step 4: Execute the Actions
Use Case Examples
Result
Last updated