{"record":{"id":"cc2f37515d83b3a1","repo":"Pumpkin-MC/Pumpkin","slug":"cannot-construct-blockfertilizeevent-from-wasm","errorCode":null,"errorMessage":"Cannot construct BlockFertilizeEvent from WASM","messagePattern":"Cannot construct BlockFertilizeEvent 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":904,"sourceCode":"            block_pos: to_wasm_block_position(self.block_pos),\n            target_world,\n            player,\n            changed_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::BlockFertilizeEvent(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::BlockFertilizeEvent(_) => {\n                panic!(\"Cannot construct BlockFertilizeEvent from WASM\")\n            }\n            _ => panic!(\"unexpected event type\"),\n        }\n    }\n}\n\nimpl ToFromWasmEvent for BlockMultiPlaceEvent {\n    fn to_wasm_event(&self, state: &mut PluginHostState) -> Event {\n        let player = state\n            .add_player(self.player.clone())\n            .expect(\"failed to add player resource\");\n        let target_world = state\n            .add_world(self.world.clone())\n            .expect(\"failed to add world resource\");\n        let placed_blocks = self\n            .placed_blocks\n            .iter()\n            .map(|(pos, id)| (to_wasm_block_position(*pos), id.as_u16()))","sourceCodeStart":886,"sourceCodeEnd":922,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/plugin/loader/wasm/wasm_host/wit/v0_1/events/block.rs#L886-L922","documentation":"A panic in `BlockFertilizeEvent`'s `from_wasm_event` implementation of the ToFromWasmEvent trait. The host-side event enum contains a BlockFertilizeEvent, which cannot be reconstructed from a WASM-side event representation, so the code intentionally panics — this direction of conversion is unsupported for this event.","triggerScenarios":"Host code calls from_wasm_event with Event::BlockFertilizeEvent, i.e. attempting to convert a WASM-originated BlockFertilizeEvent back into the native type for a plugin.","commonSituations":"Plugin infrastructure routing a fertilizer-use event through the WASM event bridge that only supports native->wasm for this event type; server/plugin version mismatch exercising an unsupported conversion path.","solutions":["Do not route BlockFertilizeEvent through from_wasm_event; use to_wasm_event only","Handle the event natively instead of round-tripping it through WASM","Report/implement from_wasm_event support if bidirectional conversion is needed","Check plugin/server versions for an unsupported event-flow path"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// before conversion\nfn convertible_from_wasm(ev: &Event) -> bool { !matches!(ev, Event::BlockFertilizeEvent(_)) }","typeGuard":"fn is_block_fertilize(ev: &Event) -> bool { matches!(ev, Event::BlockFertilizeEvent(_)) } // handle natively, never via from_wasm_event","tryCatchPattern":null,"preventionTips":["Never round-trip BlockFertilizeEvent through the WASM bridge","Route unsupported-direction events to native handlers only","Add a debug assertion/tests covering 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"}