atconf#

Modifying server and world options

AternosConfig #

Class for editing server settings

__init__(atserv) #

Class for editing server settings

Parameters:

Name Type Description Default
atserv python_aternos.atserver.AternosServer

atserver.AternosServer object

required

get_java() #

Parses Java version from options page

Returns:

Type Description
int

Java image version

get_server_props(proptyping=True) #

Parses all server.properties from options page

Parameters:

Name Type Description Default
proptyping bool

If the returned dict should contain value that matches property type (e.g. max-players will be int) instead of string

True

Returns:

Type Description
Dict[str, Any]

server.properties dictionary

get_timezone() #

Parses timezone from options page

Returns:

Type Description
str

Area/Location

get_world_props(world='world', proptyping=True) #

Parses level.dat from specified world's options page

Parameters:

Name Type Description Default
world str

Name of the worl

'world'
proptyping bool

If the returned dict should contain the value that matches property type (e.g. randomTickSpeed will be bool) instead of string

True

Returns:

Type Description
Dict[str, Any]

level.dat options dictionary

set_java(value) #

Sets new Java version

Parameters:

Name Type Description Default
value int

New Java image version

required

set_server_prop(option, value) #

Sets server.properties option

Parameters:

Name Type Description Default
option str

Option name

required
value Any

New value

required

set_server_props(props) #

Updates server.properties options with the given dict

Parameters:

Name Type Description Default
props Dict[str, Any]

Dictionary with {key:value} properties

required

set_timezone(value) #

Sets new timezone

Parameters:

Name Type Description Default
value str

New timezone

required

Raises:

Type Description
ValueError

If given string doesn't match Area/Location format

set_world_prop(option, value, gamerule=False, world='world') #

Sets level.dat option for specified world

Parameters:

Name Type Description Default
option Union[WorldOpts, WorldRules]

Option name

required
value Any

New value

required
gamerule bool

If the option is a gamerule

False
world str

Name of the world which level.dat must be edited

'world'

set_world_props(props, world='world') #

Sets level.dat options from the dictionary for the specified world

Parameters:

Name Type Description Default
props Dict[Union[WorldOpts, WorldRules], Any]

level.dat options

required
world str

name of the world which level.dat must be edited

'world'

Difficulty #

Bases: enum.IntEnum

/difficulty numeric list

Gamemode #

Bases: enum.IntEnum

/gamemode numeric list

ServerOpts #

Bases: enum.Enum

server.options file

WorldOpts #

Bases: enum.Enum

level.dat file

WorldRules #

Bases: enum.Enum

/gamerule list