Skip to content

MulticraftAPI

Parameters

nametypedefault valuedescription
urlstr
userstr
keystr
user_agentstrmulticraft (https://github.com/legopitstop/multicraft-py/)

Methods

set_user_agent

Set the User-Agent string to be used for all requests.

Parameters

NameTypeDescription
strA string specifying the User-Agent header

get_current_user

Get the current user

get_user_role

Get the users role

Parameters

NameTypeDescription
user_idintThe id of the user to get
server_idintThe id of the server that this user belongs to

set_user_role

Sets the users role

Parameters

NameTypeDescription
user_idintThe id of the user to set
server_idintThe id of the server that this user belongs to
roleRoleThe role to set

get_user_ftp_access

Get the users ftp access

Parameters

NameTypeDescription
user_idintThe id of the user to get
server_idintThe id of the server that this user belongs to

set_user_ftp_access

Sets the users ftp access

Parameters

NameTypeDescription
user_idintThe id of the user to set
server_idintThe id of the server that this user belongs to
modeModeThe mode to set

get_user_id

Get the users id from name

Parameters

NameTypeDescription
namestrThe name of the user

get_own_api_key

Parameters

NameTypeDescription
``

list_players

Get a list of all players

Parameters

NameTypeDescription
server_idintThe id of the server

get_player

Get the player from id

Parameters

NameTypeDescription
player_idintThe id of the player to get

find_players

Get player from field-value

Parameters

NameTypeDescription
server_idintThe id of the server
fieldlist[str]The field to match
valuelist[str]The value to match

update_player

Update this player

Parameters

NameTypeDescription
player_idintThe id of the player to update
fieldlist[str]The field to update
valuelist[str]The value to update

create_player

Create a new player

Parameters

NameTypeDescription
server_idintThe id of the server to create the player for
namestrThe name of the player to create
op_commandintThe op command, defaults to 0

delete_player

Remove a player

Parameters

NameTypeDescription
player_idintThe id of the player to remove

assign_player_to_user

Assign a player to a user

Parameters

NameTypeDescription
player_idintThe id of the player to assign
user_idintThe id of the user to assign

list_commands

Get a list of all commands

Parameters

NameTypeDescription
server_idintThe id of the server

find_commands

Get command from field-value

Parameters

NameTypeDescription
server_idintThe id of the server
fieldlist[str]The field to match
valuelist[str]The value to match

get_command

Get the command from id

Parameters

NameTypeDescription
command_idintThe id of the command to get

update_command

Update this command

Parameters

NameTypeDescription
command_idintThe id of the command to update
fieldlist[str]The field to update
valuelist[str]The value to update

create_command

Create a new command

Parameters

| Name | Type | Description |
| ----------- | ---- | ---------------------------------------------- | ------------------ |
| server_id | int | The id of the server to create the command for |
| name | str | The name of the command |
| role | Role | The role of the command |
| chat | str | The chat command to run |
| response | str | The response text |
| run | | str | The command to run |

delete_command

Remove a command

Parameters

NameTypeDescription
command_idintThe id of the command to remove

list_servers_by_owner

Get a list of all servers that this user owns

Parameters

NameTypeDescription
user_idintThe id of the user

list_servers_by_connection

update_server

Update this server

Parameters

NameTypeDescription
server_idintThe id of the server to update
fieldlist[str]The field to update
valuelist[str]The value to update

start_server

Start this server

Parameters

NameTypeDescription
server_idintThe id of the server to start

stop_server

Stop this server

Parameters

NameTypeDescription
server_idintThe id of the server to stop

restart_server

Restart this server

Parameters

NameTypeDescription
server_idintThe id of the server to restart

kill_server

Kill this server

Parameters

NameTypeDescription
server_idintThe id of the server to kill

send_console_command

Send this command to console

Parameters

NameTypeDescription
server_idintThe id of the server to send the command to
commandstrThe command to run

run_command

Run a command from id

Parameters

NameTypeDescription
server_idintThe id of the server that this command belongs to
command_idintThe id of the command to run
run_forintThe id of the player to run this command for, defaults to 0

clear_server_log

Clear the server log history

Parameters

NameTypeDescription
server_idintThe id of the server log to clear

clear_server_chat

Clear the server chat history

Parameters

NameTypeDescription
server_idintThe id of the server chat to clear

get_server

Get the server from id

Parameters

NameTypeDescription
server_idintThe id of the server to get

get_server_status

Get the server's status

Parameters

NameTypeDescription
server_idintThe id of the server
player_listboolWhether or not it should include a list of online players, defaults to False

get_server_log

Get the server's log

Parameters

NameTypeDescription
server_idintThe id of the server

get_server_chat

Get the server's chat

Parameters

NameTypeDescription
server_idintThe id of the server

get_server_resources

Get the server's resources

Parameters

NameTypeDescription
server_idintThe id of the server

list_schedules

Get a list of all schedules

Parameters

NameTypeDescription
server_idintThe id of the server

find_schedules

Get schedule from field-value

Parameters

NameTypeDescription
server_idintThe id of the server
fieldlist[str]The field to match
valuelist[str]The value to match

update_schedules

Update this schedule

Parameters

NameTypeDescription
schedule_idintThe id of the schedule to update
fieldlist[str]The field to update
valuelist[str]The value to update

get_schedule

Get the schedule from id

Parameters

NameTypeDescription
scheudle_idintThe id of the schedule to get

create_schedule

Create a new schedule

Parameters

NameTypeDescription
server_idintThe id of the server to create the schedule for
namestrThe name of the schedule
tsdatetime.datetimeThe datetime to run this schedule
commandintThe id of the command to run for this schedule
intervalintTime (in seconds) before it runs this schedule again, defaults to 0
statusScheduleStatusThe schedule's status, defaults to ScheduleStatus.scheduled
_forintThe player to run this schedule for, defaults to 0

delete_schedule

Remove a schedule

Parameters

NameTypeDescription
schedule_idintThe id of the schedule to remove

get_database_info

Get info about the database

Parameters

NameTypeDescription
server_idintThe id of the server to get the database from

create_database

Create a new database (Limit of one database per server)

Parameters

NameTypeDescription
server_idintThe id of the server to create the database for
namestrThe name of the database (Autogenerated for some hosts), defaults to None
passwordstrThe password of the database (Autogenerated for some hosts), defaults to None

change_database_password

Change the database password

Parameters

NameTypeDescription
server_idintThe id of the server that the database belongs to
database_idintThe id of the database (For some hosts this is the same as the server id), defaults to server_id if None
passwordstrThe new password for the database (Autogenerated for some hosts), defaults to None

delete_database

Remove a database

Parameters

NameTypeDescription
server_idintThe id of the server that this database belongs to
database_idintThe id of the database (For some hosts this is the same as the server id), defaults to server_id if None

start_server_backup

Starts a backup of the server

Parameters

NameTypeDescription
server_idintThe id of the server to backup

get_server_backup_status

Get the backup status of the server

Parameters

NameTypeDescription
server_idintThe id of the server

Not associated with or approved by Mojang Studios or Microsoft