minecraft_command_types/command/
trigger.rs

1use minecraft_command_types_derive::HasMacro;
2use std::fmt::{Display, Formatter};
3
4#[derive(Debug, Clone, Eq, PartialEq, Hash, HasMacro)]
5pub enum TriggerAction {
6    Add(i32),
7    Set(i32),
8}
9
10impl Display for TriggerAction {
11    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
12        match self {
13            TriggerAction::Add(amount) => write!(f, "add {}", amount),
14            TriggerAction::Set(amount) => write!(f, "set {}", amount),
15        }
16    }
17}