From b3a3509dfecab135577ac31aff3e1018b50a9ffe Mon Sep 17 00:00:00 2001 From: gingmzmzx <2417481092@qq.com> Date: Fri, 13 Jan 2023 20:56:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=95=E5=9B=BE=E4=BF=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flywars/commands/impl/killme.java | 24 +++++++++++++++++++ .../flywars/executor/CommandHandler.java | 1 + 2 files changed, 25 insertions(+) create mode 100644 src/main/java/top/mpt/xzystudio/flywars/commands/impl/killme.java diff --git a/src/main/java/top/mpt/xzystudio/flywars/commands/impl/killme.java b/src/main/java/top/mpt/xzystudio/flywars/commands/impl/killme.java new file mode 100644 index 0000000..5ac4117 --- /dev/null +++ b/src/main/java/top/mpt/xzystudio/flywars/commands/impl/killme.java @@ -0,0 +1,24 @@ +package top.mpt.xzystudio.flywars.commands.impl; + +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import top.mpt.xzystudio.flywars.commands.ICommand; + +/** + * 清空team指令 + */ +public class killme extends ICommand { + public killme() { + super("killme", "", "自杀"); + } + + public boolean onCommand(CommandSender sender, String[] args) { + Player p = (Player) sender; + p.setHealth(0); + return true; + } + + public String permission(){ + return "flywars.fw.killme"; + } +} \ No newline at end of file diff --git a/src/main/java/top/mpt/xzystudio/flywars/executor/CommandHandler.java b/src/main/java/top/mpt/xzystudio/flywars/executor/CommandHandler.java index 1701dd6..ba34123 100644 --- a/src/main/java/top/mpt/xzystudio/flywars/executor/CommandHandler.java +++ b/src/main/java/top/mpt/xzystudio/flywars/executor/CommandHandler.java @@ -58,6 +58,7 @@ private void initHandler() { registerCommand(new ride()); registerCommand(new clearteam()); registerCommand(new eject()); + registerCommand(new killme()); } /**