-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from mcdreforged.api.all import * | ||
|
||
def kill(server: ServerInterface,player: str): | ||
if player != '(Console)': | ||
server.execute('kill '+player) | ||
|
||
def player_name(is_player: bool,player: str): | ||
if is_player: | ||
return player | ||
else: | ||
return '(Console)' | ||
|
||
def on_load(server: PluginServerInterface, old): | ||
server.register_help_message('!!kill','自杀') | ||
server.register_command( | ||
Literal('!!kill') | ||
.runs(lambda src: kill(server,player_name(src.is_player,src.player))) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"id": "allow_suicide", | ||
"version": "1.0.0", | ||
"name": "allow_suicide", | ||
"description": { | ||
"en_us": "allow player suicide with no op", | ||
"zh_cn": "允许玩家在没有op权限时自杀" | ||
}, | ||
"dependencies": { | ||
"mcdreforged": ">=2.1.0" | ||
}, | ||
"author": "JAs0n", | ||
"link": "https://github.com/JAs0n319/allow_suicide" | ||
} |