中文
A plugin for player behavior logging and query, compatible with the Endstone plugin loader.
The Tianyan plugin uses Endstone's event API to record behavior events. It supports logging the following types of behavior events:
Logs player interactions with containers like chests, trapped chests, shulker boxes, ender chests, barrels, furnaces, blast furnaces, hoppers, dispensers, and droppers. It also records player interactions with blocks using items like flint and steel, lava buckets, fire charges, water buckets (including buckets with mobs), and powdered snow buckets. Interactions with beds and respawn anchors are also recorded.
- When only artificial blocks are logged: Records the destruction of all player-placed blocks and certain natural blocks (cannot log farmland trampled by players).
- When logging all blocks: Records all block destruction events caused by players (trampling farmland still cannot be logged).
- When logging only important entities: Logs hit events for specific entities such as horses, pigs, wolves, cats, sniffers, parrots, donkeys, mules, and villagers (even if not hit by a player).
- When logging all entities: Logs all hit events for all entities, including attacks by players, entity attacks on players, and attacks by non-player entities.
Logs all interactions between players and entities.
Logs all block placement events performed directly by players.
The Tianyan plugin displays player system names and device IDs when they join the server.
- Ban Players by Name: Prevent specific players from joining the server.
- Ban Players by Device ID: Blocks any player using a banned device (with the same device ID) from joining the server.
- Anti-Spam: Automatically bans players who send excessive messages (more than 6 within 10 seconds) or commands (more than 12 within 10 seconds). An administrator must be contacted to lift the ban.
The Tianyan plugin supports restoring blocks destroyed or placed directly by players. This feature uses the setblock
command to restore blocks based on data from the database. However, it cannot recover specific details such as the contents of chests. As an experimental feature, full restoration cannot be guaranteed.
The Tianyan plugin allows viewing the items in a player's inventory.
Refer to the official Endstone documentation for installation instructions.
Download the latest plugin version from the release section and place it in the plugins
directory of the server. Start the server to activate the plugin.
After running the plugin, a tianyan_data
folder will be created in the plugins
directory. Inside, there is a configuration file named config.json
with the following default configuration:
{
"record_nature_block": true,
"record_human_block": true,
"only_record_important_animal": true,
"10s_message_max": 6,
"10s_command_max": 12
}
From top to bottom, these options respectively represent: logging natural blocks, logging artificial blocks, logging only significant entities, the maximum number of messages a player can send within 10 seconds, and the maximum number of commands a player can execute within 10 seconds.
- To log all entity hit events instead of just important ones, change
"Record only significant entities": true
to"false"
. - The plugin defaults to Chinese but supports English via a language configuration file (
lang.json
). A pre-translated English configuration file made by ChatGPT is available for download in the release section.
Use /ty
to query player and entity behavior logs. Format:
/ty x y z time (hours) radius
Use /tygui
to query logs using a graphical menu. Format:
/tygui
Use /tys
to search for specific keywords. Format:
/tys search_type keyword time (hours)
- Search types:
player
,action
,object
(e.g., player name, action type, or target object). - Keywords: Examples include player names, action types (
Interact
,Destroy
,Attack
,Place
), or object names in-game IDs.
Use /tysgui
to perform keyword searches with a graphical menu. Format:
/tysgui
- Ban a player:
/tyban player_name reason (optional)
- Unban a player:
/tyunban player_name
- List banned players:
/tybanlist
- Ban a device:
/banid device_id
- Unban a device:
/unbanid device_id
- List banned devices:
/banidlist
Use /tyclean command to clean database
/tyclean time(hours)
- Use
/tyback
to restore block placement and destruction actions. Format:/tyback coordinates time (hours) radius player_name (optional)
Ensure endstone
and pipx
are installed in your Python environment.
git clone https://github.com/yuhangle/endstone_TianyanPlugin.git
cd endstone_TianyanPlugin
pipx run build --wheel