Documentation ¶
Overview ¶
package go_minecraft is an RCON client for minecraft built in Go
Index ¶
- Constants
- type Client
- type Difficulty
- type Mode
- type Player
- type PlayerService
- func (p *PlayerService) Give(ctx context.Context, name string, item items.Item, quantity int) (string, error)
- func (p *PlayerService) Kill(ctx context.Context, player string) string
- func (p *PlayerService) List(ctx context.Context) string
- func (p *PlayerService) Meetup(ctx context.Context, player1, player2 string) string
- func (p *PlayerService) Teleport(ctx context.Context, player, x, y, z string) string
- type Weather
- type World
- type WorldService
- func (ws *WorldService) Difficulty(ctx context.Context, d Difficulty) string
- func (ws *WorldService) Mode(ctx context.Context, m Mode) string
- func (ws *WorldService) Seed(ctx context.Context) string
- func (ws *WorldService) Time(ctx context.Context, time int) string
- func (ws *WorldService) Weather(ctx context.Context, w Weather) string
Constants ¶
View Source
const ( WeatherRain Weather = "rain" WeatherThunder Weather = "thunder" WeatherSnow Weather = "snow" ModeSurvival Mode = "survival" ModeCreative Mode = "creative" DifficultyEasy Difficulty = "easy" DifficultyMedium Difficulty = "normal" DifficultyHard Difficulty = "hard" DifficultyPeaceful Difficulty = "peaceful" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { *PlayerService *WorldService }
type Difficulty ¶
type Difficulty string
type Player ¶
type Player interface { Give(ctx context.Context, name string, item items.Item, quantity int) (string, error) List(ctx context.Context) string Meetup(ctx context.Context, player1, player2 string) string Teleport(ctx context.Context, player, x, y, z string) string Kill(ctx context.Context, player string) string }
Player is the primary interface for the all player-related commands
type PlayerService ¶
type PlayerService struct {
// contains filtered or unexported fields
}
func NewPlayerService ¶
func NewPlayerService(addr string, password string) *PlayerService
NewPlayerService creates a new instance of the PlayerService
func (*PlayerService) Give ¶
func (p *PlayerService) Give(ctx context.Context, name string, item items.Item, quantity int) (string, error)
Give adds the specified quantity of items into a player's inventory
func (*PlayerService) Kill ¶
func (p *PlayerService) Kill(ctx context.Context, player string) string
Kill kills the player with the provided name
func (*PlayerService) List ¶ added in v0.1.0
func (p *PlayerService) List(ctx context.Context) string
type World ¶
type World interface { Weather(ctx context.Context, w Weather) string Time(ctx context.Context, time int) string Seed(ctx context.Context) string Mode(ctx context.Context, m Mode) string Difficulty(ctx context.Context, d Difficulty) string }
World is the primary interface for the all world-related commands
type WorldService ¶
type WorldService struct {
// contains filtered or unexported fields
}
func NewWorldService ¶
func NewWorldService(addr string, password string) *WorldService
func (*WorldService) Difficulty ¶
func (ws *WorldService) Difficulty(ctx context.Context, d Difficulty) string
func (*WorldService) Seed ¶
func (ws *WorldService) Seed(ctx context.Context) string
Seed returns the world seed
Click to show internal directories.
Click to hide internal directories.