{"record":{"id":"0c9d85fca8c46ee4","repo":"Pumpkin-MC/Pumpkin","slug":"cannot-construct-blockmultiplaceevent-from-wasm","errorCode":null,"errorMessage":"Cannot construct BlockMultiPlaceEvent from WASM","messagePattern":"Cannot construct BlockMultiPlaceEvent from WASM","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/pumpkin/src/plugin/loader/wasm/wasm_host/wit/v0_1/events/block.rs","lineNumber":942,"sourceCode":"        Event::BlockMultiPlaceEvent(BlockMultiPlaceEventData {\n            player,\n            target_world,\n            placed_blocks,\n            cancelled: self.cancelled,\n        })\n    }\n\n    fn apply_wasm_event(&mut self, event: Event, state: &mut PluginHostState) {\n        cleanup_event(&event, state);\n        if let Event::BlockMultiPlaceEvent(data) = event {\n            self.cancelled = data.cancelled;\n        }\n    }\n\n    fn from_wasm_event(event: Event, _state: &mut PluginHostState) -> Self {\n        match event {\n            Event::BlockMultiPlaceEvent(_) => {\n                panic!(\"Cannot construct BlockMultiPlaceEvent from WASM\")\n            }\n            _ => panic!(\"unexpected event type\"),\n        }\n    }\n}\n\nimpl ToFromWasmEvent for BlockReceiveGameEvent {\n    fn to_wasm_event(&self, state: &mut PluginHostState) -> Event {\n        let target_world = state\n            .add_world(self.world.clone())\n            .expect(\"failed to add world resource\");\n        Event::BlockReceiveGameEvent(BlockReceiveGameEventData {\n            block_pos: to_wasm_block_position(self.block_pos),\n            target_world,\n            game_event: self.game_event.clone(),\n            source_entity_id: self\n                .source_entity\n                .as_ref()","sourceCodeStart":924,"sourceCodeEnd":960,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/plugin/loader/wasm/wasm_host/wit/v0_1/events/block.rs#L924-L960","documentation":"A panic in `BlockMultiPlaceEvent`'s from_wasm_event: reconstructing this native event from the WASM Event enum is intentionally unsupported, mirroring BlockFertilizeEvent. Any attempt to convert a WASM-side BlockMultiPlaceEvent back to native panics.","triggerScenarios":"Calling from_wasm_event with Event::BlockMultiPlaceEvent, i.e. requesting native reconstruction of a WASM-originated multi-place event.","commonSituations":"Plugin/bridge code attempting a round-trip conversion the trait does not support; dispatch table routing this event down an unsupported path; version mismatch in generated bindings.","solutions":["Treat BlockMultiPlaceEvent as native-to-WASM only; never reconstruct it from WASM","Handle such events natively at the source instead of through the bridge","Implement from_wasm_event support if bidirectional flow is required","Confirm event dispatch tables don't route this event through from_wasm_event"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// before conversion\nfn convertible_from_wasm(ev: &Event) -> bool { !matches!(ev, Event::BlockMultiPlaceEvent(_)) }","typeGuard":"fn is_block_multi_place(ev: &Event) -> bool { matches!(ev, Event::BlockMultiPlaceEvent(_)) } // handle natively, never via from_wasm_event","tryCatchPattern":null,"preventionTips":["Treat BlockMultiPlaceEvent as native->WASM only","Keep dispatch tables from routing it through from_wasm_event","Add tests asserting each event's supported conversion direction"],"tags":["panic","wasm","events","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"8d4639e25a57c15e47448ec327c780d41bbf2356","analyzedAt":"2026-09-09T15:32:22.916Z","contentChangedAt":"2026-09-09T15:32:22.916Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}