add player name selector

This commit is contained in:
Raptorox 2026-08-01 12:48:38 +02:00
parent 2ddd24fc82
commit 72a0cf8c69
No known key found for this signature in database
GPG key ID: 8B3556FC3ED1F6D8

View file

@ -8,7 +8,8 @@ pub enum Selector {
AllPlayers, // @a
AllEntities, // @e
Executor, // @s
NearestEntity // @n
NearestEntity, // @n,
Player(String)
}
impl Display for Selector {
@ -19,7 +20,8 @@ impl Display for Selector {
Self::AllPlayers => write!(f, "@a"),
Self::AllEntities => write!(f, "@e"),
Self::Executor => write!(f, "@s"),
Self::NearestEntity => write!(f, "@n")
Self::NearestEntity => write!(f, "@n"),
Self::Player(name) => write!(f, "{name}")
}
}
}
@ -27,6 +29,7 @@ impl Display for Selector {
mod say;
mod list;
mod kill;
mod ban;
impl Command {
pub fn raw(cmd: &str) -> Self {
@ -48,4 +51,8 @@ impl Command {
pub fn kill() -> kill::KillCommand {
kill::KillCommand::default()
}
pub fn ban() -> ban::BanCommand {
ban::BanCommand::default()
}
}