Files

26 lines
690 B
C++
Raw Permalink Normal View History

2026-03-01 12:16:08 +08:00
#include "stdafx.h"
#include "net.minecraft.commands.h"
#include "net.minecraft.world.entity.player.h"
#include "net.minecraft.world.damagesource.h"
#include "BasicTypeContainers.h"
2026-03-01 12:16:08 +08:00
#include "KillCommand.h"
EGameCommand KillCommand::getId()
{
return eGameCommand_Kill;
}
int KillCommand::getPermissionLevel()
{
return LEVEL_ALL;
}
void KillCommand::execute(shared_ptr<CommandSender> source, byteArray commandData)
2026-03-01 12:16:08 +08:00
{
shared_ptr<Player> player = dynamic_pointer_cast<Player>(source);
2026-03-01 12:16:08 +08:00
player->hurt(DamageSource::outOfWorld, Float::MAX_VALUE);
2026-03-01 12:16:08 +08:00
source->sendMessage(L"Ouch. That look like it hurt.");
//source.sendMessage(ChatMessageComponent.forTranslation("commands.kill.success"));
2026-03-01 12:16:08 +08:00
}