Something went wrong. Try again.
A Minecraft datapack generator written in go.
Something went wrong. Try again.
Go
1234567891011121314151617181920212223242526272829303132333435363738package function
type Function struct { name string commands []string}
func MkFunction(name string, commands ...string) Function { return Function{ name: name, commands: commands, }}
func (f Function) Type() string { return "function"}
func (f Function) Name() string { return f.name}
func (f Function) Commands() []string { commands := make([]string, len(f.commands)) copy(commands, f.commands) return commands}
func (f Function) AddCommand(command string) Function { f.commands = append(f.commands, command) return f}
func (f Function) AddCommands(commands ...string) Function { f.commands = append(f.commands, commands...) return f}