From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.World/KillCommand.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Minecraft.World/KillCommand.cpp (limited to 'Minecraft.World/KillCommand.cpp') diff --git a/Minecraft.World/KillCommand.cpp b/Minecraft.World/KillCommand.cpp new file mode 100644 index 00000000..30a7880e --- /dev/null +++ b/Minecraft.World/KillCommand.cpp @@ -0,0 +1,19 @@ +#include "stdafx.h" +#include "net.minecraft.commands.h" +#include "net.minecraft.world.entity.player.h" +#include "net.minecraft.world.damagesource.h" +#include "KillCommand.h" + +EGameCommand KillCommand::getId() +{ + return eGameCommand_Kill; +} + +void KillCommand::execute(shared_ptr source, byteArray commandData) +{ + shared_ptr player = dynamic_pointer_cast(source); + + player->hurt(DamageSource::outOfWorld, 1000); + + source->sendMessage(L"Ouch. That look like it hurt."); +} \ No newline at end of file -- cgit v1.2.3