atserver#

Aternos Minecraft server

AternosServer #

Class for controlling your Aternos Minecraft server

__init__(servid, atconn, reqinfo=True) #

Class for controlling your Aternos Minecraft server

Parameters:

Name Type Description Default
servid str

Unique server IDentifier

required
atconn AternosConnect

AternosConnect instance with initialized Aternos session

required
reqinfo bool

Automatically call fetch() to get all info

True

address() property #

Full server address including domain and port

Returns:

Type Description
str

Server address

atserver_request(url, method, params=None, data=None, headers=None, sendtoken=False) #

Sends a request to Aternos API with server IDenitfier parameter

Parameters:

Name Type Description Default
url str

Request URL

required
method str

Request method, must be GET or POST

required
params Optional[Dict[Any, Any]]

URL parameters

None
data Optional[Dict[Any, Any]]

POST request data, if the method is GET, this dict will be combined with params

None
headers Optional[Dict[Any, Any]]

Custom headers

None
sendtoken bool

If the ajax and SEC token should be sent

False

Returns:

Type Description
requests.Response

API response

cancel() #

Cancels server launching

config() #

Returns AternosConfig instance for editing server settings

Returns:

Type Description
AternosConfig

AternosConfig object

confirm() #

Confirms server launching

css_class() property #

CSS class for server status block on official web site (offline, loading, loading starting, queueing)

Returns:

Type Description
str

CSS class

domain() property #

Server domain (e.g. test.aternos.me). In other words, address without port number

Returns:

Type Description
str

Domain

edition() property #

Server software edition: Java or Bedrock

Returns:

Type Description
Edition

Software edition

eula() #

Accepts the Mojang EULA

fetch() #

Send a request to Aternos API to get all server info

files() #

Returns FileManager instance for file operations

Returns:

Type Description
FileManager

FileManager object

is_bedrock() property #

Check if server software is Bedrock Edition

Returns:

Type Description
bool

Is it Minefcraft BE

is_java() property #

Check if server software is Java Edition

Returns:

Type Description
bool

Is it Minecraft JE

motd() property writable #

Server message of the day which is shown below its name in the Minecraft servers list

Returns:

Type Description
str

MOTD

players(lst) #

Returns PlayersList instance for managing operators, whitelist and banned players lists

Parameters:

Name Type Description Default
lst Lists

Players list type, must be the atplayers.Lists enum value

required

Returns:

Type Description
PlayersList

PlayersList object

players_count() property #

How many players are connected

Returns:

Type Description
int

Connected players count

players_list() property #

List of connected players' nicknames

Returns:

Type Description
List[str]

Connected players

port() property #

Server port number

Returns:

Type Description
int

Port

ram() property #

Server used RAM in MB

Returns:

Type Description
int

Used RAM

restart() #

Restarts the server

slots() property #

Server slots, how many players can connect

Returns:

Type Description
int

Slots count

software() property #

Server software name (e.g. Vanilla)

Returns:

Type Description
str

Software name

start(headstart=False, accepteula=True) #

Starts a server

Parameters:

Name Type Description Default
headstart bool

Start a server in the headstart mode which allows you to skip all queue

False
accepteula bool

Automatically accept the Mojang EULA

True

Raises:

Type Description
ServerStartError

When Aternos is unable to start the server

status() property #

Server status string (offline, loading, preparing)

Returns:

Type Description
str

Status string

status_num() property #

Server numeric status. It is highly recommended to use status string instead of a number

Returns:

Type Description
Status

Status code

stop() #

Stops the server

subdomain() property writable #

Server subdomain (the part of domain before .aternos.me)

Returns:

Type Description
str

Subdomain

version() property #

Server software version (1.16.5)

Returns:

Type Description
str

Software version

wss(autoconfirm=False) #

Returns AternosWss instance for listening server streams in real-time

Parameters:

Name Type Description Default
autoconfirm bool

Automatically start server status listener when AternosWss connects to API to confirm server launching

False

Returns:

Type Description
AternosWss

AternosWss object

Edition #

Bases: enum.IntEnum

Server edition type enum (java, bedrock)

Status #

Bases: enum.IntEnum

Server numeric status enum. It is highly recommended to use AternosServer.status instead of AternosServer.status_num