mcipc.rcon.commands package

Submodules

mcipc.rcon.commands.chat module

Chat-realted commands.

mcipc.rcon.commands.chat.me(self: Client, message: str) str

Sends a message from RCON in first-person perspective.

mcipc.rcon.commands.chat.say(self: Client, message: str) str

Broadcast a message to all players.

mcipc.rcon.commands.chat.send_url(self: Client, player: str, url: str, text: str | None = None) str

Sends a URL to the specified player. If no text is specified, it will default to the original URL.

mcipc.rcon.commands.chat.tell(self: Client, player: str, message: str) str

Whispers a message to the respective player.

mcipc.rcon.commands.chat.tellraw(self: Client, player: str, obj: dict) str

Sends a message represented by a JSON-ish dict.

mcipc.rcon.commands.execute module

Implementation of the execute command.

class mcipc.rcon.commands.execute.ConditionalProxy(client: Client, *args: str)

Bases: CommandProxy

Proxies if and unless conditionals.

block(pos: tuple[Union[int, str, float], Union[int, str, float], Union[int, str, float]] | str, block: str) ExecuteProxy

Compares the block at a given position to a given block ID.

blocks(start: tuple[Union[int, str, float], Union[int, str, float], Union[int, str, float]] | str, end: tuple[Union[int, str, float], Union[int, str, float], Union[int, str, float]] | str, destination: tuple[Union[int, str, float], Union[int, str, float], Union[int, str, float]] | str, scan_mode: ScanMode | str) ExecuteProxy

Compares the blocks in two equally sized volumes.

property data: DataProxy

Delegates to a mcipc.rcon.commands.execute.DataProxy

entity(entities: str) ExecuteProxy

Checks whether one or more <targets> exist.

predicate(predicate: str) ExecuteProxy

Checks whether the <predicate> evaluates to a positive result.

score(target: str, target_objective: str) ScoreProxy

Delegates to a score proxy.

class mcipc.rcon.commands.execute.DataProxy(client: Client, *args: str)

Bases: CommandProxy

Checks whether the targeted block, entity or storage has any data for a given tag.

block(pos: tuple[Union[int, str, float], Union[int, str, float], Union[int, str, float]] | str, path: str) ExecuteProxy

Checks a block.

entity(target: str, path: str) ExecuteProxy

Checks an entity.

storage(source: str, path: str) ExecuteProxy

Checks a storage.

class mcipc.rcon.commands.execute.ExecuteProxy(client: Client, *args: str)

Bases: CommandProxy

A proxy for execute sub-commands.

align(axes: str) ExecuteProxy

Aligns with the given axes and returns a sub-proxy.

anchored(anchor: str) ExecuteProxy

Stores the distance from the feet to the eyes of the entity that is executing the command in the anchor, which is part of the command context.

as_(targets: str) ExecuteProxy

Executes the command as the given targets.

at(targets: str) ExecuteProxy

Executes the command at the given targets.

facing(*, pos: tuple[Union[int, str, float], Union[int, str, float], Union[int, str, float]] | str | None = None, targets: str | None = None, anchor: Anchor | str | None = None) ExecuteProxy

Faces a position or entity.

property if_: ConditionalProxy

Delegates to a mcipc.rcon.commands.execute.ConditionalProxy

in_(dimension: str) ExecuteProxy

Executes in the given dimension.

positioned(*, pos: tuple[Union[int, str, float], Union[int, str, float], Union[int, str, float]] | str | None = None, targets: str | None = None) ExecuteProxy

Runs the command with a given positioning.

rotated(*, rot: tuple[Union[int, str], Union[int, str]] | str | None = None, targets: str | None = None) ExecuteProxy

Executes the command with the given rotation.

run(*arguments: str) str

Runs the a command with arguments in the current execution context.

store(what: StorageType | str)

Stores the result or success.

property unless: ConditionalProxy

Delegates to a mcipc.rcon.commands.execute.ConditionalProxy

class mcipc.rcon.commands.execute.ScoreProxy(client: Client, *args: str)

Bases: CommandProxy

Check a score against either another score or a given range.

eq(source: str, objective: str) ExecuteProxy

Returns a == comparison.

ge(source: str, objective: str) ExecuteProxy

Returns a >= comparison.

gt(source: str, objective: str) ExecuteProxy

Returns a > comparison.

le(source: str, objective: str) ExecuteProxy

Returns a <= comparison.

lt(source: str, objective: str) ExecuteProxy

Returns a < comparison.

matches(range: range | str) ExecuteProxy

Matches a range.

class mcipc.rcon.commands.execute.StoreProxy(client: Client, *args: str)

Bases: CommandProxy

Proxy to handle store sub-command.

block(target_pos: tuple[Union[int, str, float], Union[int, str, float], Union[int, str, float]] | str, path: str, type: DataType | str, scale: float) ExecuteProxy

Saves the final command’s return value as tag data within a block entity.

bossbar(ident: str, value: BossbarSlot | str) ExecuteProxy

Saves the final command’s return value in either a bossbar’s current value or its maximum value.

entity(target: str, path: str, type: DataType | str, scale: float) ExecuteProxy

Save the final command’s return value in one of an entity’s data tags.

score(targets: str, objective: str) ExecuteProxy

Overrides the score held by <targets> on the given <objective> with the final command’s return value.

storage(target: str, path: str, type: DataType | str, scale: float) ExecuteProxy

Uses the <path> within storage <target> to store the return value in.

mcipc.rcon.commands.execute.execute(self: Client) ExecuteProxy

Delegates to a mcipc.rcon.commands.execute.ExecuteProxy

mcipc.rcon.commands.function module

Implementation of the function command.

mcipc.rcon.commands.function.function(self: Client, name: Path | str) str

Runs the given function.

mcipc.rcon.commands.gamerule module

Implementation of th gamerule command.

mcipc.rcon.commands.gamerule.gamerule(self: Client, rule: str, value: bool | int | None = None) str

Sets or queries a game rule value.

mcipc.rcon.commands.kick module

Implementation of the kick command.

mcipc.rcon.commands.kick.kick(self: Client, player: str, *reasons: str) KickedPlayer

Kicks the respective player.

mcipc.rcon.commands.kill module

Implementation of the kill command.

mcipc.rcon.commands.kill.kill(self: Client, targets: str)

Kills the targets.

mcipc.rcon.commands.op module

Operators management.

mcipc.rcon.commands.op.deop(self: Client, player: str) str

Revokes operator status from the respective player.

mcipc.rcon.commands.op.op(self: Client, player: str) str

Makes the respective player an operator.

mcipc.rcon.commands.reload module

Implementation of the reload command.

mcipc.rcon.commands.reload.reload(self: Client) str

Reloads data packs in Java Edition and functions in behavior packs in Bedrock Edition.

mcipc.rcon.commands.tag module

Implementation of the tag command.

class mcipc.rcon.commands.tag.TagProxy(client: Client, *args: str)

Bases: CommandProxy

Proxy for tag commands.

add(name: str) str

Adds a tag.

list() str

Lists tags.

remove(name: str) str

Removes a tag.

mcipc.rcon.commands.tag.tag(self: Client, targets: str) TagProxy

Delegates to a command proxy.

mcipc.rcon.commands.weather module

Common weather proxy implementation.

class mcipc.rcon.commands.weather.WeatherProxy(client: Client, *args: str)

Bases: CommandProxy

Proxy for weather commands.

clear(duration: int | None = None) str

Sets the weather to clear.

rain(duration: int | None = None) str

Sets the weather to raining.

thunder(duration: int | None = None) str

Sets the weather to a thunderstorm.

mcipc.rcon.commands.whitelist module

Implementation of the whitelist command.

class mcipc.rcon.commands.whitelist.WhitelistProxy(client: Client, *args: str)

Bases: CommandProxy

Proxy for whitelist commands.

add(name: str) -> functools.partial(<function parse_bool at 0x7f6a21f7f430>, true='Added (.+) to the whitelist', default=False)

Adds a player to the whitelist.

list() list[str]

Lists the whitelist.

off() -> functools.partial(<function parse_bool at 0x7f6a21f7f430>, true='Whitelist is now turned off', default=False)

Turns the whitelist checking off.

on() -> functools.partial(<function parse_bool at 0x7f6a21f7f430>, true='Whitelist is now turned on', default=False)

Turns the whitelist checking on.

reload() -> functools.partial(<function parse_bool at 0x7f6a21f7f430>, true='Reloaded the whitelist', default=False)

Reloads the whitelist from the file.

remove(name: str) -> functools.partial(<function parse_bool at 0x7f6a21f7f430>, true='Removed (.+) from the whitelist', default=False)

Removes a player from the whitelist.

mcipc.rcon.commands.whitelist.whitelist(self: Client) WhitelistProxy

Delegates to a mcipc.rcon.commands.whitelist.WhitelistProxy

Module contents

Commands for all Minecraft versions.