endstone.ban

Classes relevant to bans.

Classes relevant to bans.

Classes

NameDescription
BanEntry

A single entry from a ban list.

IpBanEntry

Represents a ban entry for an IP address.

IpBanList

Represents a ban list containing banned IP addresses.

PlayerBanEntry

Represents a ban entry for a player.

PlayerBanList

Represents a ban list containing banned players.

classBanEntry

BanEntry()

A single entry from a ban list.

Attributes

NameTypeDescription
createddatetime

Gets or sets the date this ban entry was created.

expirationdatetime | None

Gets or sets the date this ban expires on.

reasonstr

Gets or sets the reason for this ban.

sourcestr

Gets or sets the source of this ban.

attrcreatedproperty

created: datetime

Gets or sets the date this ban entry was created.

attrexpirationproperty

expiration: datetime | None

Gets or sets the date this ban expires on.

attrreasonproperty

reason: str

Gets or sets the reason for this ban.

attrsourceproperty

source: str

Gets or sets the source of this ban.

classIpBanEntry

Bases: BanEntry

IpBanEntry(address: str)

Represents a ban entry for an IP address.

Attributes

NameTypeDescription
addressstr

Gets the banned IP address.

attraddressproperty

address: str

Gets the banned IP address.

classIpBanList

IpBanList()

Represents a ban list containing banned IP addresses.

Methods

NameDescription
add_ban

Adds a ban to this list, or updates an existing one.

get_ban_entry

Gets a BanEntry by IP address.

is_banned

Checks if a BanEntry exists for the target by IP address.

remove_ban

Removes an IP address from the ban list.

Attributes

NameTypeDescription
entrieslist[IpBanEntry]

Gets a vector of pointers to entries in the ban list.

attrentriesproperty

entries: list[IpBanEntry]

Gets a vector of pointers to entries in the ban list.

methadd_ban

add_ban(address: str, reason: str | None = None, expires: datetime | None = None, source: str | None = None) -> IpBanEntry

Adds a ban to this list, or updates an existing one.

methget_ban_entry

get_ban_entry(address: str) -> IpBanEntry | None

Gets a BanEntry by IP address.

methis_banned

is_banned(address: str) -> bool

Checks if a BanEntry exists for the target by IP address.

methremove_ban

remove_ban(address: str) -> None

Removes an IP address from the ban list.

classPlayerBanEntry

Bases: BanEntry

PlayerBanEntry(name: str, uuid: UUID | None = None, xuid: str | None = None)

Represents a ban entry for a player.

Attributes

NameTypeDescription
namestr

Gets the banned player's name.

unique_idUUID | None

Gets the banned player's unique ID, or None if not available.

xuidstr | None

Gets the banned player's Xbox user ID (XUID), or None if not available.

attrnameproperty

name: str

Gets the banned player's name.

attrunique_idproperty

unique_id: UUID | None

Gets the banned player's unique ID, or None if not available.

attrxuidproperty

xuid: str | None

Gets the banned player's Xbox user ID (XUID), or None if not available.

classPlayerBanList

PlayerBanList()

Represents a ban list containing banned players.

Methods

NameDescription
add_ban

Adds a ban to this list, or updates an existing one.

get_ban_entry

Gets a BanEntry by player name, UUID, or XUID.

is_banned

Checks if a BanEntry exists for the target by name, UUID, or XUID.

remove_ban

Removes a player from the ban list by name, UUID, or XUID.

Attributes

NameTypeDescription
entrieslist[PlayerBanEntry]

Gets a vector of pointers to entries in the ban list.

attrentriesproperty

Gets a vector of pointers to entries in the ban list.

methadd_ban

add_ban(name: str, uuid: UUID | None = None, xuid: str | None = None, reason: str | None = None, expires: datetime | None = None, source: str | None = None) -> PlayerBanEntry

Adds a ban to this list, or updates an existing one.

methget_ban_entry

get_ban_entry(name: str, uuid: UUID | None = None, xuid: str | None = None) -> PlayerBanEntry | None

Gets a BanEntry by player name, UUID, or XUID.

methis_banned

is_banned(name: str, uuid: UUID | None = None, xuid: str | None = None) -> bool

Checks if a BanEntry exists for the target by name, UUID, or XUID.

methremove_ban

remove_ban(name: str, uuid: UUID | None = None, xuid: str | None = None) -> None

Removes a player from the ban list by name, UUID, or XUID.

On this page