commands

package module
v0.0.0-...-bf33021 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2022 License: MIT Imports: 4 Imported by: 0

README

Saddle Commands

A plugin that implements a set of commonly used commands. They resemble vanilla commands, but are not necessarily a 1:1 recreation. They are all configurable in the plugin config.

To install this plugin, simply add the following to your saddle.toml file and run the launcher:

[[plugin]]
module  = "github.com/saddlemc/commands"
version = "latest"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandInfo

type CommandInfo struct {
	// Runnables is not an actual configuration entry. It is used for the plugin to associate a certain command with a
	// CommandInfo instance.
	Runnables []cmd.Runnable `toml:"-"`

	// Disable will make the plugin not register the command on startup if set to true.
	Disable bool `toml:"disable"`
	// Name is what the player types in to execute the command, without the slash. For example, /give is named "give".
	Name string `toml:"name"`
	// Description is a short message that explains what the command does. Will show up to a user when typing in a
	// command name.
	Description string `toml:"description"`
	// Aliases are different ways to type a command. They are alternative names for the command. For example, /gamemode
	// has a /gm alias. Once again, the slash should not be part of the string.
	Aliases []string `toml:"aliases"`
}

CommandInfo is a config entry for a command. Here it can be customized in order to fit the rest of the server.

type Plugin

type Plugin struct{}

func (Plugin) Name

func (p Plugin) Name() string

func (Plugin) Run

func (p Plugin) Run(ctx context.Context, this *plugin.Plugin)

func (Plugin) Setup

func (p Plugin) Setup(this *plugin.Plugin) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL