pub enum TrapTrigger {
PressurePlate,
Tripwire,
TrappedChest,
}Expand description
The mechanism that springs a Trap (DSL v0.6, spec-0011). All three are
redstone-native — the hardware fires without any command — so the compiler
emits no detection for them; it only models the trigger cell as a hazard and
fills the dispenser payload. (approach, the compiler-detected v0.4 primitive,
is deliberately not a trap trigger: it is already fully expressible as an
EnvTrigger, so admitting it here would only duplicate that surface.)
Variants§
PressurePlate
A pressure plate: any entity stepping on the cell. Auto-rearms on step-off.
Tripwire
A tripwire line: any entity crossing it. Auto-rearms.
TrappedChest
A trapped chest: a player opening it (comparator pulse). The only player-distinct trigger — a controlled mob cannot spring it.
Implementations§
Source§impl TrapTrigger
impl TrapTrigger
Sourcepub fn is_trigger_block(&self, block: &str) -> bool
pub fn is_trigger_block(&self, block: &str) -> bool
Whether block (an id, with or without its blockstate) is the hardware
this trigger kind names: the block the party sees and springs. A plate
is any *_pressure_plate, a tripwire is the string itself
(minecraft:tripwire, not the hook), a trapped chest is
minecraft:trapped_chest.
Sourcepub fn trigger_block_name(&self) -> &'static str
pub fn trigger_block_name(&self) -> &'static str
The block TrapTrigger::is_trigger_block accepts, as a refusal names it.
Source§impl TrapTrigger
impl TrapTrigger
Sourcepub const STEPPED: [TrapTrigger; 2]
pub const STEPPED: [TrapTrigger; 2]
The trigger kinds a body fires by walking onto them — a plate and a tripwire. A trapped chest is opened, not stepped on.
Trait Implementations§
Source§impl Clone for TrapTrigger
impl Clone for TrapTrigger
impl Copy for TrapTrigger
Source§impl Debug for TrapTrigger
impl Debug for TrapTrigger
Source§impl<'de> Deserialize<'de> for TrapTrigger
impl<'de> Deserialize<'de> for TrapTrigger
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for TrapTrigger
Source§impl JsonSchema for TrapTrigger
impl JsonSchema for TrapTrigger
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more