Compatibility
Minecraft: Java Edition
Platforms
Supported environments
75% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Links
Creators
Details
Note: this mod is server side only and won't work on clients and Mod require LuckPerms mod!
A Fabric mod that executes and sends configurable commands (with custom permissions), actions (such as playing sound, give items) and messages respectively on certain events triggered by a player, such as Dying, Joining a server, Killing another player, getting achievements, etc. Also, this mod removes vanilla messages about death, entry/exit of players.
The config file is located in the config directory (config/player_events.json) and looks like this:
{
"first_death": {
"actions": [
"${player} died for the first time"
],
"broadcast_to_everyone": true,
"pick_message_randomly": false
},
"death": {
"actions": [
"${player} just died!"
],
"broadcast_to_everyone": true,
"pick_message_randomly": false
},
"first_join": {
"actions": [
"Welcome to the server ${player}! Remember to read the rules", "*minecraft:entity.experience_orb.pickup"
],
"broadcast_to_everyone": false,
"pick_message_randomly": false
},
"join": {
"actions": [
"Welcome ${player}",
"/say Hello ${player}",
"<Red>You received 64 stone blocks and 64 planks!",
"#minecraft:stone:64",
"#minecraft:planks:64"
],
"broadcast_to_everyone": true,
"pick_message_randomly": false
},
"kill_entity": {
"actions": [
"${player} <Green>killed ${killedEntity}"
],
"broadcast_to_everyone": true,
"pick_message_randomly": false
},
"kill_player": {
"actions": [
"${player} killed ${killedPlayer}",
"F ${killedPlayer}"
],
"broadcast_to_everyone": true,
"pick_message_randomly": true
},
"leave": {
"actions": [
"Goodbye ${player}!",
"/say Hope to see you soon ${player}", "*minecraft:block.note_block.bass"
],
"broadcast_to_everyone": true,
"pick_message_randomly": false
},
"get_advancement": {
"actions": ["<yellow>> <gold>${player} <yellow>got an achievement ${advancement}!"],
"broadcast_to_everyone": true,
"pick_message_randomly": false
},
"custom_commands": [
{
"command": "/plugins",
"actions": [
"Hey! We don't use plugins"
],
"broadcast_to_everyone": false,
"pick_message_randomly": false
},
{
"command": "/spawn",
"actions": [
"/tp ${player} 0 64 0 0 0"
],
"broadcast_to_everyone": true,
"pick_message_randomly": false
},
{
"command": "@gm 0",
"actions": [
"/gamemode survival ${player}"],
"broadcast_to_everyone": false,
"pick_message_randomly": false
},
{
"command": "@gm 1",
"actions": [
"/gamemode survival ${player}"],
"broadcast_to_everyone": false,
"pick_message_randomly": false
}
]
}
On the JSON file you can declare, under the actions array on each <event> object, what is going to be sent and/or executed on that event. You can also set these messages to be sent only to the player by setting broadcast_to_everyone to false (if you have audio playback set up, then it will only be played to the player), but this won't work with events like leave (because the player isn't in the server anymore). Use /pe reload or /player_events reload to reload the mod config.
Since 2.2.0 You can choose to randomly send one of the defined messages for a given event by setting pick_message_randomly to true.
Every event has a ${player} token, and each instance of this token will be replaced with the player that triggers the event. Other events have extra tokens that work the same way. Most (if not all) tokens have properties that can be accessed with something like ${player.name}. Here is a list of all the properties:
display Entity's display name, the one you see in the player list/chat. Example: "[Team blue] Tom421" entityName Entity's name, for players it's the player's name, for other entities it's the entity's uuid x y z Entity coordinates More coming soonâ„¢ Only for event get_advancement has a ${advancement} - returns the clickable name of the achievement. Use Simple Text Format to brighten up your messages (like this <Red>). Also auto-detecting links in the messages works (but you can only apply one color at the beginning of the message, other colors will not apply).
2.4.8 supported events
first_death - Executed when a player dies for first time.
death - Executed when a player dies.
first_join - Executed when a player joins for first time.
join - Executed when a player joins.
kill_entity - Executed when a player kills an entity. Extra tokens:
${killedEntity} - the killed entity.
kill_player - Executed when a player kills another player. Extra tokens:
${killedPlayer} - the killed player.
leave - Executed when a player leaves.
get_advancement - Executed when the player receives an achievement. Extra tokens:
${advancement} - the text of advancement.
custom_commands - Custom defined events triggered by using a defined command. Note: This event does not support datapack functions
2.4.7 and later supported custom actions
#you_item_id_value(for example minecraft:stone:3) - Gives you 3 stone block
*sound_id - Play sound locally to player or global (its depends on boolean
broadcast_to_everyone value)
@you_command_without_/ - Registering custom command with permission luckperms (for example
@gm1 executing command /gamemode 1, in lp editor you need to add @gm1 permission)