This repository was archived by the owner on Sep 29, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
src/internal/behavior-pack Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,4 +9,5 @@ export * from "./item";
99export * from "./feature" ;
1010export * from "./feature_rule" ;
1111export * from './item_catalog' ;
12- export * from './recipe' ;
12+ export * from './recipe' ;
13+ export * from './spawn_rule' ;
Original file line number Diff line number Diff line change 1+ import { ComponentContainer } from 'bc-minecraft-bedrock-types/lib/minecraft/components' ;
2+ import { FormatVersion } from "../types/format-version" ;
3+
4+ /** */
5+ export interface SpawnRule extends Readonly < FormatVersion > {
6+ /** */
7+ format_version : string ;
8+ /** */
9+ "minecraft:spawn_rules" : {
10+ description : {
11+ identifier : string
12+ population_control : string
13+ } ,
14+ conditions : ComponentContainer [ ]
15+ } ;
16+ }
17+
18+ /**
19+ *
20+ */
21+ export namespace SpawnRule {
22+ /**
23+ *
24+ * @param value
25+ * @returns
26+ */
27+ export function is ( value : any ) : value is SpawnRule {
28+ if ( typeof value === "object" && typeof value . format_version === "string" && typeof value [ "minecraft:spawn_rules" ] === "object" ) {
29+ const desc = value [ "minecraft:spawn_rules" ] . description ;
30+
31+ if ( typeof desc === "object" && typeof desc . identifier === "string" && Array . isArray ( value [ 'minecraft:spawn_rules' ] . conditions ) ) {
32+ return true ;
33+ }
34+ }
35+
36+ return false ;
37+ }
38+ }
You can’t perform that action at this time.
0 commit comments