@mbler/mcx-core 0.1.1-rc.1 → 0.1.2-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as t from "@babel/types";
2
2
  import { ArgumentPlaceholder, CallExpression, ExportAllDeclaration, ExportDefaultDeclaration, ExportNamedDeclaration, Expression, ImportDeclaration, SpreadElement } from "@babel/types";
3
3
  import * as Parser from "@babel/parser";
4
+ import { BlockComponent, BlockComponent as BlockComponent$1, EnchantableSlot, EntityComponent, EntityComponent as EntityComponent$1, EntityComponentOptions, EntityJson, FoodEffect, GIFImageComponent, GIFImageComponent as GIFImageComponent$1, ItemComponent, ItemComponent as ItemComponent$1, ItemComponentOptions, ItemJson, JPGImageComponent, JPGImageComponent as JPGImageComponent$1, PNGImageComponent, PNGImageComponent as PNGImageComponent$1, ParticleType, Rarity, SVGImageComponent, SVGImageComponent as SVGImageComponent$1, SoundEvent } from "@mbler/mcx-component";
4
5
  import { Plugin, TransformPluginContext } from "rollup";
5
6
  import { CompileOpt, CompileOpt as CompileOpt$1 } from "@mbler/mcx-types";
6
7
  import { Plugin as Plugin$1 } from "rolldown";
@@ -261,1870 +262,15 @@ declare const compileJSFn: ((code: string) => JsCompileData) & {
261
262
  declare const compileMCXFn: ((mcxCode: string) => MCXCompileData) & {
262
263
  cache: Record<string, MCXCompileData>;
263
264
  };
264
- //#endregion
265
- //#region src/mcx-component/types/ParticleType.d.ts
266
- /**
267
- * @description Particle Type List
268
- * @description Update time UTC 2026/4/8
269
- */
270
- declare const ParticleTypeEnum: readonly ["balloongas", "bleach", "blockforcefield", "blueflame", "breezewindexplosion", "bubble", "bubblecolumndown", "bubblecolumnup", "bubblemanual", "campfiresmoke", "campfiresmoketall", "candleflame", "carrotboost", "coloredflame", "conduit", "creakingcrumble", "crit", "dragonbreath", "dragonbreathfire", "dragonbreathtrail", "dragondestroyblock", "driphoney", "driplava", "dripwater", "dustplume", "electricspark", "enchantingtable", "endrod", "evaporation", "explode", "eyeblossomclose", "eyeblossomopen", "fallingborderdust", "fallingdust", "fireworks", "fireworksoverlay", "fireworksstarter", "flame", "food", "greenflame", "heart", "hugeexplosion", "iconcrack", "ink", "largeexplode", "largesmoke", "lava", "mobappearance", "mobflame", "mobspell", "mobspellambient", "mobspellinstantaneous", "myceliumdust", "none", "note", "obsidiantear", "paleoakleaves", "pausemobgrowth", "portal", "portalreverse", "rainsplash", "reddust", "resetmobgrowth", "risingborderdust", "sculksoul", "shriek", "shulkerbullet", "slime", "smoke", "sneeze", "snowballpoof", "snowflake", "sonicexplosion", "soul", "sparkler", "spit", "stalactitedriplava", "stalactitedripwater", "terrain", "totem", "townaura", "trackingemitter", "vaultconnection", "villagerangry", "villagerhappy", "watersplash", "watersplashmanual", "waterwake", "wax", "whitesmoke", "windexplosion", "witchspell", "wolfarmorcrack"];
271
- type ParticleType = (typeof ParticleTypeEnum)[number];
272
- //#endregion
273
- //#region src/mcx-component/types/SoundEvent.d.ts
274
- /**
275
- * @description Sound Event Choose List
276
- * @description Update time UTC 2026/4/8
277
- */
278
- declare const SoundEventEnum: string[];
279
- type SoundEvent = (typeof SoundEventEnum)[number];
280
- //#endregion
281
- //#region src/mcx-component/types/EnchantableSlot.d.ts
282
- /**
283
- * Enchantable slot types for minecraft:enchantable component
284
- * Specifies which types of enchantments can be applied to items
285
- * @description Update time UTC 2026/4/8
286
- */
287
- declare const EnchantableSlotArray: readonly ["none", "all", "g_armor", "armor_head", "armor_torso", "armor_feet", "armor_legs", "sword", "bow", "spear", "crossbow", "melee_spear", "g_tool", "hoe", "shears", "flintsteel", "shield", "g_digging", "axe", "pickaxe", "shovel", "fishing_rod", "carrot_stick", "elytra", "cosmetic_head"];
288
- type EnchantableSlot = (typeof EnchantableSlotArray)[number];
289
- declare const EnchantableSlotEnum: readonly ["none", "all", "g_armor", "armor_head", "armor_torso", "armor_feet", "armor_legs", "sword", "bow", "spear", "crossbow", "melee_spear", "g_tool", "hoe", "shears", "flintsteel", "shield", "g_digging", "axe", "pickaxe", "shovel", "fishing_rod", "carrot_stick", "elytra", "cosmetic_head"];
290
- //#endregion
291
- //#region src/mcx-component/components/block.d.ts
292
- declare class BlockComponent {
293
- toJSON(): {};
294
- }
295
- //#endregion
296
- //#region src/mcx-component/components/entity.d.ts
297
- declare class EntityComponent {
298
- #private;
299
- constructor(opt: EntityComponentOptions);
300
- toJSON(): EntityJson;
301
- setId(newValue: string): void;
302
- setFormat(newValue: string): void;
303
- setIsSpawnable(value: boolean): void;
304
- setIsSummonable(value: boolean): void;
305
- setAddrider(config: {
306
- entity_type?: string;
307
- riders?: Array<{
308
- entity_type: string;
309
- spawn_event?: string;
310
- }>;
311
- spawn_event?: string;
312
- }): void;
313
- setAdmireItem(config: {
314
- cooldown_after_being_attacked?: number;
315
- duration?: number;
316
- }): void;
317
- setAgeable(config: {
318
- drop_items?: string[];
319
- duration?: number;
320
- feed_items?: string | string[] | Array<{
321
- growth?: number;
322
- item: string;
323
- }>;
324
- grow_up?: string | {
325
- event: string;
326
- target: string;
327
- };
328
- interact_filters?: any;
329
- pause_growth_items?: string[];
330
- reset_growth_items?: string[];
331
- }): void;
332
- setAngerLevel(config: {
333
- anger_decrement_interval?: number;
334
- angry_boost?: number;
335
- angry_threshold?: number;
336
- broadcast_anger?: boolean;
337
- broadcast_anger_on_attack?: boolean;
338
- broadcast_filters?: any;
339
- broadcast_range?: number;
340
- broadcast_targets?: string[];
341
- calm_event?: string;
342
- default_annoyingness?: number;
343
- default_projectile_annoyingness?: number;
344
- duration?: number;
345
- duration_delta?: number;
346
- filters?: any;
347
- max_anger?: number;
348
- nuisance_filter?: any;
349
- on_increase_sounds?: Array<{
350
- condition?: string;
351
- sound?: string;
352
- }>;
353
- remove_targets_below_angry_threshold?: boolean;
354
- sound_interval?: {
355
- min: number;
356
- max: number;
357
- };
358
- }): void;
359
- setAngry(config: {
360
- angry_sound?: string;
361
- broadcast_anger?: boolean;
362
- broadcast_anger_on_attack?: boolean;
363
- broadcast_anger_on_being_attacked?: boolean;
364
- broadcast_anger_when_dying?: boolean;
365
- broadcast_filters?: any;
366
- broadcast_range?: number;
367
- broadcast_targets?: string[];
368
- calm_event?: string | {
369
- event: string;
370
- target: string;
371
- };
372
- duration?: number;
373
- duration_delta?: number;
374
- filters?: any;
375
- sound_interval?: {
376
- min: number;
377
- max: number;
378
- };
379
- }): void;
380
- setAnnotationBreakDoor(config: {
381
- break_time?: number;
382
- min_difficulty?: 'hard' | 'normal' | 'easy' | 'peaceful';
383
- }): void;
384
- setAnnotationOpenDoor(): void;
385
- setAttack(config: {
386
- damage?: number | [number, number] | {
387
- range_min: number;
388
- range_max: number;
389
- };
390
- effect_duration?: number;
391
- effect_name?: string;
392
- }): void;
393
- setAreaAttack(config: {
394
- cause?: string;
395
- damage_cooldown?: number;
396
- damage_per_tick?: number;
397
- damage_range?: number;
398
- entity_filter?: any;
399
- play_attack_sound?: boolean;
400
- }): void;
401
- setAttackCooldown(config: {
402
- attack_cooldown_complete_event?: string | {
403
- event: string;
404
- target?: string;
405
- };
406
- attack_cooldown_time?: number | {
407
- min: number;
408
- max: number;
409
- };
410
- }): void;
411
- setBalloonable(config: {
412
- mass?: number;
413
- max_distance?: number;
414
- on_balloon?: any;
415
- on_unballoon?: any;
416
- soft_distance?: number;
417
- }): void;
418
- setBarter(config: {
419
- barter_table?: string;
420
- cooldown_after_being_attacked?: {
421
- min: number;
422
- max: number;
423
- };
424
- }): void;
425
- setBlockClimber(): void;
426
- setBlockSensor(config: {
427
- on_break?: Array<{
428
- block_list?: string[];
429
- on_block_broken?: string;
430
- }>;
431
- sensor_radius?: number;
432
- sources?: any;
433
- }): void;
434
- setBodyRotationAxisAligned(): void;
435
- setBodyRotationAlwaysFollowsHead(): void;
436
- setBodyRotationBlocked(): void;
437
- setBodyRotationLockedToVehicle(): void;
438
- setBoostable(config: {
439
- boost_items?: Array<{
440
- damage?: number;
441
- item: string;
442
- replace_item?: string;
443
- }>;
444
- duration?: number;
445
- speed_multiplier?: number;
446
- }): void;
447
- setBoss(config: {
448
- hud_range?: number;
449
- name?: string;
450
- should_darken_sky?: boolean;
451
- }): void;
452
- setBreakBlocks(config: {
453
- breakable_blocks?: string[];
454
- }): void;
455
- setBreathable(config: {
456
- breathe_blocks?: string[];
457
- breathes_air?: boolean;
458
- breathes_lava?: boolean;
459
- breathes_solids?: boolean;
460
- breathes_water?: boolean;
461
- generates_bubbles?: boolean;
462
- inhale_time?: number;
463
- non_breathe_blocks?: string[];
464
- suffocate_time?: number;
465
- suffocateTime?: number;
466
- total_supply?: number;
467
- totalSupply?: number;
468
- }): void;
469
- setBribeable(config: {
470
- bribe_cooldown?: number;
471
- bribe_items?: string[] | string;
472
- }): void;
473
- setBreedable(config: {
474
- allow_sitting?: boolean;
475
- blend_attributes?: boolean;
476
- breed_cooldown?: number;
477
- breed_items?: string[] | string;
478
- breeds_with?: Array<{
479
- baby_type?: string;
480
- breed_event?: string | {
481
- event: string;
482
- filters?: any;
483
- };
484
- mate_type?: string;
485
- }> | {
486
- baby_type?: string;
487
- breed_event?: string | {
488
- event: string;
489
- filters?: any;
490
- };
491
- mate_type?: string;
492
- };
493
- causes_pregnancy?: boolean;
494
- deny_parents_variant?: {
495
- chance?: number;
496
- max_variant?: string;
497
- min_variant?: string;
498
- };
499
- environment_requirements?: Array<{
500
- block_types?: string[];
501
- count?: number;
502
- radius?: number;
503
- }>;
504
- extra_baby_chance?: {
505
- min: number;
506
- max: number;
507
- };
508
- inherit_tamed?: boolean;
509
- love_filters?: any;
510
- mutation_factor?: {
511
- color?: {
512
- min: number;
513
- max: number;
514
- } | number;
515
- extra_variant?: {
516
- min: number;
517
- max: number;
518
- } | number;
519
- variant?: {
520
- min: number;
521
- max: number;
522
- } | number;
523
- };
524
- require_full_health?: boolean;
525
- require_tame?: boolean;
526
- }): void;
527
- setBuoyant(config: {
528
- apply_gravity?: boolean;
529
- base_buoyancy?: number;
530
- big_wave_probability?: number;
531
- big_wave_speed?: number;
532
- can_auto_step_from_liquid?: boolean;
533
- drag_down_on_buoyancy_removed?: number;
534
- liquid_blocks?: string[];
535
- movement_type?: 'waves' | 'bobbing' | 'none';
536
- }): void;
537
- setBurnsInDaylight(config?: {
538
- protection_slot?: 'slot.armor.body' | 'slot.armor.chest' | 'slot.armor.feet' | 'slot.armor.head' | 'slot.armor.legs' | 'slot.weapon.mainhand' | 'slot.weapon.offhand';
539
- }): void;
540
- setCannotBeAttacked(): void;
541
- setCanClimb(): void;
542
- setCanFly(): void;
543
- setCanJoinRaid(): void;
544
- setCanPowerJump(): void;
545
- setCelebrateHunt(config: {
546
- broadcast?: boolean;
547
- celeberation_targets?: any;
548
- celebrate_sound?: string;
549
- duration?: number;
550
- radius?: number;
551
- sound_interval?: {
552
- min: number;
553
- max: number;
554
- };
555
- }): void;
556
- setCollisionBox(config?: {
557
- height?: number;
558
- width?: number;
559
- }): void;
560
- setColor(config?: {
561
- value?: number;
562
- }): void;
563
- setColor2(config?: {
564
- value?: number;
565
- }): void;
566
- setCombatRegeneration(config?: {
567
- apply_to_family?: boolean;
568
- apply_to_self?: boolean;
569
- regeneration_duration?: number | 'infinite';
570
- }): void;
571
- setConditionalBandwidthOptimization(config?: {
572
- conditional_values?: Array<{
573
- conditional_values?: any;
574
- max_dropped_ticks?: number;
575
- max_optimized_distance?: number;
576
- use_motion_prediction_hints?: boolean;
577
- }>;
578
- default_values?: {
579
- max_dropped_ticks?: number;
580
- max_optimized_distance?: number;
581
- use_motion_prediction_hints?: boolean;
582
- };
583
- }): void;
584
- setCustomHitTest(config?: {
585
- hitboxes?: Array<{
586
- height?: number;
587
- pivot?: [number, number, number];
588
- width?: number;
589
- }>;
590
- }): void;
591
- setDamageOverTime(config?: {
592
- damage_per_hurt?: number;
593
- time_between_hurt?: number;
594
- }): void;
595
- setDamageSensor(config?: {
596
- deals_damage?: boolean | 'yes' | 'no' | 'no_but_side_effects_apply';
597
- triggers?: Array<{
598
- cause?: string;
599
- damage_modifier?: number;
600
- damage_multiplier?: number;
601
- deals_damage?: boolean | string;
602
- event?: string;
603
- filters?: any;
604
- on_damage?: {
605
- filters?: any;
606
- };
607
- on_damage_sound_event?: string;
608
- }> | {
609
- cause?: string;
610
- damage_modifier?: number;
611
- damage_multiplier?: number;
612
- deals_damage?: boolean | string;
613
- event?: string;
614
- filters?: any;
615
- on_damage?: {
616
- filters?: any;
617
- };
618
- on_damage_sound_event?: string;
619
- };
620
- }): void;
621
- setDash(config?: {
622
- cooldown_time?: number;
623
- horizontal_momentum?: number;
624
- vertical_momentum?: number;
625
- }): void;
626
- setDashAction(config?: {
627
- can_dash_underwater?: boolean;
628
- cooldown_time?: number;
629
- direction?: 'entity' | 'passenger';
630
- horizontal_momentum?: number;
631
- vertical_momentum?: number;
632
- }): void;
633
- setDefaultLookAngle(config?: {
634
- value?: number;
635
- }): void;
636
- setDespawn(config?: {
637
- despawn_from_chance?: boolean;
638
- despawn_from_distance?: {
639
- max_distance?: number;
640
- min_distance?: number;
641
- };
642
- despawn_from_inactivity?: boolean;
643
- despawn_from_simulation_edge?: boolean;
644
- filters?: any;
645
- min_range_inactivity_timer?: number;
646
- min_range_random_chance?: number;
647
- remove_child_entities?: boolean;
648
- }): void;
649
- setDimensionBound(): void;
650
- setDryingOutTimer(config?: {
651
- dried_out_event?: string | {
652
- event: string;
653
- target?: string;
654
- };
655
- recover_after_dried_out_event?: string | {
656
- event: string;
657
- target?: string;
658
- };
659
- stopped_drying_out_event?: string | {
660
- event: string;
661
- target?: string;
662
- };
663
- total_time?: number;
664
- water_bottle_refill_time?: number;
665
- }): void;
666
- setDweller(config?: {
667
- can_find_poi?: boolean;
668
- can_migrate?: boolean;
669
- dweller_role?: string;
670
- dwelling_bounds_tolerance?: number;
671
- dwelling_role?: string;
672
- dwelling_type?: string;
673
- first_founding_reward?: number;
674
- preferred_profession?: string;
675
- update_interval_base?: number;
676
- update_interval_variant?: number;
677
- }): void;
678
- setEconomyTradeTable(config?: {
679
- convert_trades_economy?: boolean;
680
- cured_discount?: number | [number, number];
681
- display_name?: string;
682
- hero_demand_discount?: number;
683
- max_cured_discount?: number | [number, number];
684
- max_nearby_cured_discount?: number;
685
- nearby_cured_discount?: number;
686
- new_screen?: boolean;
687
- persist_trades?: boolean;
688
- show_trade_screen?: boolean;
689
- table?: string;
690
- use_legacy_price_formula?: boolean;
691
- }): void;
692
- setEntityArmorEquipmentSlotMapping(config?: {
693
- armor_slot?: string;
694
- }): void;
695
- setEntitySensor(config?: {
696
- find_players_only?: boolean;
697
- relative_range?: boolean;
698
- subsensors?: Array<{
699
- cooldown?: number;
700
- event?: string | {
701
- event: string;
702
- target?: string;
703
- };
704
- event_filters?: any;
705
- maximum_count?: number;
706
- minimum_count?: number;
707
- range?: [number, number] | [number, number, number];
708
- require_all?: boolean;
709
- y_offset?: number;
710
- }>;
711
- }): void;
712
- setEnvironmentSensor(config?: {
713
- triggers?: {
714
- event?: string | {
715
- event: string;
716
- target?: string;
717
- };
718
- filters?: any;
719
- } | Array<{
720
- event?: string | {
721
- event: string;
722
- target?: string;
723
- };
724
- filters?: any;
725
- }>;
726
- }): void;
727
- /**
728
- * Sets the Equipment table to use for this Entity
729
- * @param config Equipment configuration
730
- */
731
- setEquipment(config?: {
732
- slot_drop_chance?: Array<string | {
733
- drop_chance?: number;
734
- slot?: string;
735
- }>;
736
- table?: string;
737
- }): void;
738
- /**
739
- * Defines an entity's behavior for having items equipped to it
740
- * @param config Equippable configuration
741
- */
742
- setEquippable(config?: {
743
- slots?: Array<{
744
- accepted_items?: string[];
745
- interact_text?: string;
746
- item?: string;
747
- on_equip?: any;
748
- on_unequip?: any;
749
- slot?: number;
750
- [key: string]: any;
751
- }>;
752
- }): void;
753
- /**
754
- * The entity puts on the desired equipment
755
- * @param config Equip Item configuration
756
- */
757
- setEquipItem(config?: {
758
- can_wear_armor?: boolean;
759
- excluded_items?: Array<{
760
- item?: string;
761
- [key: string]: any;
762
- }>;
763
- }): void;
764
- /**
765
- * Defines how much exhaustion each player action should take
766
- * @param config Exhaustion values configuration
767
- */
768
- setExhaustionValues(config?: {
769
- attack?: number;
770
- damage?: number;
771
- heal?: number;
772
- jump?: number;
773
- lunge?: number;
774
- mine?: number;
775
- sprint?: number;
776
- sprint_jump?: number;
777
- swim?: number;
778
- walk?: number;
779
- [key: string]: any;
780
- }): void;
781
- /**
782
- * Defines experience rewards for entity interactions
783
- * @param config Experience reward configuration
784
- */
785
- setExperienceReward(config?: {
786
- on_bred?: string | number | {
787
- expression?: string;
788
- version?: number;
789
- };
790
- on_death?: string | number | {
791
- expression?: string;
792
- version?: number;
793
- };
794
- [key: string]: any;
795
- }): void;
796
- /**
797
- * Defines how the entity explodes
798
- * @param config Explode configuration
799
- */
800
- setExplode(config?: {
801
- add?: {
802
- component_groups?: string[];
803
- [key: string]: any;
804
- };
805
- allow_underwater?: boolean;
806
- breaks_blocks?: boolean;
807
- causes_fire?: boolean;
808
- damage_scaling?: number;
809
- destroy_affected_by_griefing?: boolean;
810
- fire_affected_by_griefing?: boolean;
811
- fuse_length?: number | [number, number];
812
- fuse_lit?: boolean;
813
- knockback_scaling?: number;
814
- max_resistance?: number;
815
- negates_fall_damage?: boolean;
816
- particle_effect?: string;
817
- power?: number;
818
- sound_effect?: string;
819
- toggles_blocks?: boolean;
820
- [key: string]: any;
821
- }): void;
822
- /**
823
- * Sets that this entity doesn't take damage from fire
824
- */
825
- setFireImmune(config?: {}): void;
826
- /**
827
- * Sets that this entity can float in liquid blocks
828
- */
829
- setFloatsInLiquid(config?: {}): void;
830
- /**
831
- * Allows entities to flock in groups in water or not
832
- */
833
- setFlocking(config?: {
834
- block_distance?: number;
835
- block_weight?: number;
836
- breach_influence?: number;
837
- cohesion_threshold?: number;
838
- cohesion_weight?: number;
839
- goal_weight?: number;
840
- high_flock_limit?: number;
841
- in_water?: boolean;
842
- influence_radius?: number;
843
- innner_cohesion_threshold?: number;
844
- loner_chance?: number;
845
- low_flock_limit?: number;
846
- match_variants?: boolean;
847
- max_height?: number;
848
- min_height?: number;
849
- separation_threshold?: number;
850
- separation_weight?: number;
851
- use_center_of_mass?: boolean;
852
- }): void;
853
- /**
854
- * Sets the flying speed in blocks that this entity flies at
855
- */
856
- setFlyingSpeed(config?: {
857
- value?: number;
858
- }): void;
859
- /**
860
- * Defines the maximum range, in blocks, that a mob will pursue a target
861
- */
862
- setFollowRange(config?: {
863
- max?: number;
864
- value?: number;
865
- }): void;
866
- /**
867
- * When configured as a rideable entity, the entity will be controlled using WASD controls
868
- */
869
- setFreeCameraControlled(config?: {
870
- backwards_movement_modifier?: number;
871
- strafe_speed_modifier?: number;
872
- }): void;
873
- /**
874
- * Defines how much friction affects this entity
875
- */
876
- setFrictionModifier(config?: {
877
- value?: number;
878
- }): void;
879
- /**
880
- * Allows an entity to emit entityMove, swim and flap game events
881
- */
882
- setGameEventMovementTracking(config?: {
883
- emit_flap?: boolean;
884
- emit_move?: boolean;
885
- emit_swim?: boolean;
886
- }): void;
887
- /**
888
- * Defines the way a mob's genes and alleles are passed on to its offspring
889
- */
890
- setGenetics(config?: {
891
- mutation_rate?: number;
892
- genes?: Array<{
893
- name: string;
894
- use_simplified_breeding?: boolean;
895
- mutation_rate?: number;
896
- allele_range?: number | {
897
- range_min: number;
898
- range_max: number;
899
- };
900
- genetic_variants?: Array<{
901
- birth_event?: string | {
902
- event: string;
903
- target?: string;
904
- };
905
- main_allele?: number | {
906
- range_min: number;
907
- range_max: number;
908
- };
909
- hidden_allele?: number | {
910
- range_min: number;
911
- range_max: number;
912
- };
913
- both_allele?: number | {
914
- range_min: number;
915
- range_max: number;
916
- };
917
- either_allele?: number | {
918
- range_min: number;
919
- range_max: number;
920
- };
921
- }>;
922
- }>;
923
- }): void;
924
- /**
925
- * Defines sets of items that can be used to trigger events when used on this entity
926
- */
927
- setGiveable(config?: {
928
- cooldown?: number;
929
- items?: string | string[];
930
- on_give?: string | {
931
- event: string;
932
- target?: string;
933
- };
934
- }): void;
935
- /**
936
- * Sets the offset from the ground that the entity is actually at
937
- */
938
- setGroundOffset(config?: {
939
- value?: number;
940
- }): void;
941
- /**
942
- * Keeps track of entity group size in the given radius
943
- */
944
- setGroupSize(config?: {
945
- radius?: number;
946
- filters?: any;
947
- }): void;
948
- /**
949
- * Could increase crop growth when entity walks over crop
950
- */
951
- setGrowsCrop(config?: {
952
- chance?: number;
953
- charges?: number;
954
- }): void;
955
- /**
956
- * Defines the health pool for an entity, measured in health points (1 point = half a heart)
957
- */
958
- setHealth(config?: {
959
- max?: number;
960
- value?: number | {
961
- range_min?: number;
962
- range_max?: number;
963
- };
964
- }): void;
965
- /**
966
- * Defines the entity's heartbeat
967
- */
968
- setHeartbeat(config?: {
969
- interval?: string;
970
- sound_event?: string;
971
- }): void;
972
- /**
973
- * Moves to and hides at their owned POI or the closest nearby
974
- */
975
- setHide(): void;
976
- /**
977
- * Saves a home position for when the entity is spawned
978
- */
979
- setHome(config?: {
980
- home_block_list?: string[];
981
- restriction_radius?: number;
982
- restriction_type?: 'none' | 'random_movement' | 'all_movement';
983
- }): void;
984
- /**
985
- * Determines the jump height for a horse or similar entity
986
- */
987
- setHorseJumpStrength(config?: {
988
- value?: number | {
989
- range_min?: number;
990
- range_max?: number;
991
- };
992
- }): void;
993
- /**
994
- * Defines a set of conditions under which an entity should take damage
995
- */
996
- setHurtOnCondition(config?: {
997
- damage_conditions?: Array<{
998
- cause?: string;
999
- damage_per_tick?: number;
1000
- filters?: {
1001
- subject?: string;
1002
- test?: string;
1003
- value?: any;
1004
- operator?: string;
1005
- [key: string]: any;
1006
- };
1007
- }>;
1008
- }): void;
1009
- /**
1010
- * Prevents entities from attacking the owner entity unless explicitly allowed
1011
- */
1012
- setIgnoreCannotBeAttacked(config?: {
1013
- filters?: {
1014
- subject?: string;
1015
- test?: string;
1016
- value?: any;
1017
- operator?: string;
1018
- [key: string]: any;
1019
- };
1020
- }): void;
1021
- /**
1022
- * Applies WASD controls for rideable entities in air (3D movement control)
1023
- */
1024
- setInputAirControlled(config?: Record<string, any>): void;
1025
- /**
1026
- * Applies WASD controls for rideable entities on ground
1027
- */
1028
- setInputGroundControlled(): void;
1029
- /**
1030
- * Monitors when the entity enters or exits specific blocks and triggers events
1031
- */
1032
- setInsideBlockNotifier(config?: {
1033
- block_list?: Array<{
1034
- block?: {
1035
- name?: string;
1036
- states?: {
1037
- [key: string]: string | number | boolean;
1038
- };
1039
- };
1040
- entered_block_event?: {
1041
- event?: string;
1042
- target?: string;
1043
- };
1044
- exited_block_event?: {
1045
- event?: string;
1046
- target?: string;
1047
- };
1048
- }>;
1049
- }): void;
1050
- /**
1051
- * Adds a timer since last rested to see if phantoms should spawn
1052
- */
1053
- setInsomnia(config?: {
1054
- days_until_insomnia?: number;
1055
- }): void;
1056
- /**
1057
- * Despawns the Actor immediately
1058
- */
1059
- setInstantDespawn(config?: {
1060
- remove_child_entities?: boolean;
1061
- }): void;
1062
- /**
1063
- * Defines interactions with this entity
1064
- */
1065
- setInteract(config?: {
1066
- cooldown?: number;
1067
- cooldown_after_being_attacked?: number;
1068
- drop_item_slot?: string | number;
1069
- drop_item_y_offset?: number;
1070
- equip_item_slot?: string | number;
1071
- health_amount?: number;
1072
- hurt_item?: number;
1073
- interact_text?: string;
1074
- interactions?: Array<{
1075
- give_item?: boolean;
1076
- hurt_item?: number;
1077
- interact_text?: string;
1078
- on_interact?: string | {
1079
- filters?: {
1080
- subject?: string;
1081
- test?: string;
1082
- value?: any;
1083
- operator?: string;
1084
- [key: string]: any;
1085
- };
1086
- };
1087
- particle_on_start?: Array<{
1088
- particle_offset_towards_interactor?: boolean;
1089
- particle_type?: string;
1090
- particle_y_offset?: number;
1091
- }>;
1092
- play_sounds?: string;
1093
- repair_entity_item?: Array<{
1094
- amount?: number;
1095
- slot?: string | number;
1096
- }>;
1097
- spawn_entities?: string;
1098
- spawn_items?: Array<{
1099
- table?: string;
1100
- y_offset?: number;
1101
- }>;
1102
- swing?: boolean;
1103
- take_item?: boolean;
1104
- transform_to_item?: string;
1105
- use_item?: boolean;
1106
- vibration?: 'none' | 'shear' | 'entity_die' | 'entity_act' | 'entity_interact';
1107
- }>;
1108
- }): void;
1109
- setInventory(config?: {
1110
- additional_slots_per_strength?: number;
1111
- can_be_siphoned_from?: boolean;
1112
- container_type?: string;
1113
- inventory_size?: number;
1114
- private?: boolean;
1115
- restrict_to_owner?: boolean;
1116
- }): void;
1117
- setIsBaby(): void;
1118
- setIsCharged(): void;
1119
- setIsChested(): void;
1120
- setIsDyeable(config?: {
1121
- interact_text?: string;
1122
- }): void;
1123
- setIsIgnited(): void;
1124
- setIsPregnant(): void;
1125
- setItemControllable(config?: {
1126
- control_items?: string | string[];
1127
- }): void;
1128
- /**
1129
- * Makes the entity leashable with customized spring behavior
1130
- */
1131
- setLeashable(config?: {
1132
- can_be_cut?: boolean;
1133
- can_be_stolen?: boolean;
1134
- hard_distance?: number;
1135
- max_distance?: number;
1136
- on_leash?: string | {
1137
- event: string;
1138
- target?: string;
1139
- };
1140
- on_unleash?: string | {
1141
- event: string;
1142
- target?: string;
1143
- };
1144
- soft_distance?: number;
1145
- presets?: Array<{
1146
- filter?: {
1147
- subject?: string;
1148
- test?: string;
1149
- value?: any;
1150
- operator?: string;
1151
- [key: string]: any;
1152
- };
1153
- spring_type?: 'bouncy' | 'dampened' | 'quad_dampened';
1154
- }>;
1155
- }): void;
1156
- /**
1157
- * Allows entities to be leashed to this entity with retrieval option
1158
- */
1159
- setLeashableTo(config?: {
1160
- can_retrieve_from?: boolean;
1161
- }): void;
1162
- /**
1163
- * Defines behavior when entities look at the owner entity
1164
- */
1165
- setLookedAt(config?: {
1166
- field_of_view?: number;
1167
- filters?: {
1168
- subject?: string;
1169
- test?: string;
1170
- value?: any;
1171
- operator?: string;
1172
- [key: string]: any;
1173
- };
1174
- find_players_only?: boolean;
1175
- line_of_sight_obstruction_type?: 'outline' | 'collision' | 'collision_for_camera';
1176
- look_at_locations?: string[];
1177
- looked_at_cooldown?: {
1178
- min: number;
1179
- max: number;
1180
- };
1181
- looked_at_event?: string | {
1182
- event: string;
1183
- target?: string;
1184
- };
1185
- min_looked_at_duration?: number;
1186
- not_looked_at_event?: string | {
1187
- event: string;
1188
- target?: string;
1189
- };
1190
- scale_fov_by_distance?: boolean;
1191
- search_radius?: number;
1192
- set_target?: boolean | 'never' | 'once_and_stop_scanning' | 'once_and_keep_scanning';
1193
- }): void;
1194
- /**
1195
- * Sets the loot table for the entity
1196
- */
1197
- setLoot(config: {
1198
- table: string;
1199
- }): void;
1200
- /**
1201
- * Enables wandering trader management for the entity
1202
- */
1203
- setManagedWanderingTrader(): void;
1204
- /**
1205
- * Sets the mark variant for the entity (visual differentiation)
1206
- */
1207
- setMarkVariant(value: number): void;
1208
- /**
1209
- * Applies a mob effect to entities within range
1210
- */
1211
- setMobEffect(config: {
1212
- ambient?: boolean;
1213
- cooldown_time?: number;
1214
- effect_range?: number;
1215
- effect_time?: number | 'infinite';
1216
- entity_filter?: {
1217
- subject?: string;
1218
- test?: string;
1219
- value?: any;
1220
- operator?: string;
1221
- [key: string]: any;
1222
- };
1223
- mob_effect: string;
1224
- }): void;
1225
- /**
1226
- * Sets mob effect immunity for the entity
1227
- */
1228
- setMobEffectImmunity(mob_effects: string[]): void;
1229
- setItemHopper(): void;
1230
- /**
1231
- * Sets the base movement speed for the entity
1232
- */
1233
- setMovement(config?: {
1234
- max?: number;
1235
- value?: number | {
1236
- range_min: number;
1237
- range_max: number;
1238
- };
1239
- }): void;
1240
- /**
1241
- * Sets amphibious movement control (swim in water and walk on land)
1242
- */
1243
- setMovementAmphibious(max_turn?: number): void;
1244
- /**
1245
- * Sets basic movement control
1246
- */
1247
- setMovementBasic(max_turn?: number): void;
1248
- /**
1249
- * Note: This component is not currently being used in game
1250
- */
1251
- setMovementDolphin(): void;
1252
- /**
1253
- * Sets fly movement control
1254
- */
1255
- setMovementFly(config?: {
1256
- max_turn?: number;
1257
- speed_when_turning?: number;
1258
- start_speed?: number;
1259
- }): void;
1260
- /**
1261
- * Sets generic movement control (fly, swim, climb, etc.)
1262
- */
1263
- setMovementGeneric(max_turn?: number): void;
1264
- /**
1265
- * Sets glide movement control
1266
- */
1267
- setMovementGlide(config?: {
1268
- max_turn?: number;
1269
- speed_when_turning?: number;
1270
- }): void;
1271
- /**
1272
- * Sets hover movement control
1273
- */
1274
- setMovementHover(max_turn?: number): void;
1275
- /**
1276
- * Sets jump movement control (requires minecraft:behavior.slime_attack for target following)
1277
- */
1278
- setMovementJump(config?: {
1279
- jump_delay?: number | [number, number] | {
1280
- range_min: number;
1281
- range_max: number;
1282
- };
1283
- max_turn?: number;
1284
- }): void;
1285
- /**
1286
- * Sets skip movement control
1287
- */
1288
- setMovementSkip(max_turn?: number): void;
1289
- /**
1290
- * Sets movement sound distance offset
1291
- */
1292
- setMovementSoundDistanceOffset(value?: number): void;
1293
- /**
1294
- * Sets sway movement control
1295
- */
1296
- setMovementSway(config?: {
1297
- max_turn?: number;
1298
- sway_amplitude?: number;
1299
- sway_frequency?: number;
1300
- }): void;
1301
- /**
1302
- * Makes the entity nameable with customization options
1303
- */
1304
- setNameable(config?: {
1305
- allow_name_tag_renaming?: boolean;
1306
- always_show?: boolean;
1307
- default_trigger?: string;
1308
- name_actions?: Array<{
1309
- name_filter?: string[];
1310
- on_named?: string | {
1311
- event: string;
1312
- target?: string;
1313
- };
1314
- }>;
1315
- }): void;
1316
- /**
1317
- * Sets climb navigation for the entity (like vanilla spiders)
1318
- */
1319
- setNavigationClimb(config?: {
1320
- avoid_damage_blocks?: boolean;
1321
- avoid_portals?: boolean;
1322
- avoid_sun?: boolean;
1323
- avoid_water?: boolean;
1324
- blocks_to_avoid?: string[];
1325
- can_breach?: boolean;
1326
- can_break_doors?: boolean;
1327
- can_jump?: boolean;
1328
- can_open_doors?: boolean;
1329
- can_open_iron_doors?: boolean;
1330
- can_pass_doors?: boolean;
1331
- can_path_from_air?: boolean;
1332
- can_path_over_lava?: boolean;
1333
- can_path_over_water?: boolean;
1334
- can_sink?: boolean;
1335
- can_swim?: boolean;
1336
- can_walk?: boolean;
1337
- can_walk_in_lava?: boolean;
1338
- is_amphibious?: boolean;
1339
- }): void;
1340
- /**
1341
- * Sets float navigation for the entity
1342
- */
1343
- setNavigationFloat(config: {
1344
- avoid_damage_blocks?: boolean;
1345
- avoid_portals?: boolean;
1346
- avoid_sun?: boolean;
1347
- avoid_water?: boolean;
1348
- blocks_to_avoid?: string[];
1349
- can_breach?: boolean;
1350
- can_break_doors?: boolean;
1351
- can_jump?: boolean;
1352
- can_open_doors?: boolean;
1353
- can_open_iron_doors?: boolean;
1354
- can_pass_doors?: boolean;
1355
- can_path_from_air?: boolean;
1356
- can_path_over_water?: boolean;
1357
- can_sink?: boolean;
1358
- can_swim?: boolean;
1359
- can_walk?: boolean;
1360
- can_walk_in_lava?: boolean;
1361
- is_amphibious?: boolean;
1362
- using_door_annotation?: boolean;
1363
- }): void;
1364
- /**
1365
- * Sets fly navigation for the entity
1366
- */
1367
- setNavigationFly(config: {
1368
- avoid_damage_blocks?: boolean;
1369
- avoid_portals?: boolean;
1370
- avoid_sun?: boolean;
1371
- avoid_water?: boolean;
1372
- blocks_to_avoid?: string[];
1373
- can_breach?: boolean;
1374
- can_break_doors?: boolean;
1375
- can_jump?: boolean;
1376
- can_open_doors?: boolean;
1377
- can_open_iron_doors?: boolean;
1378
- can_pass_doors?: boolean;
1379
- can_path_from_air?: boolean;
1380
- can_path_over_water?: boolean;
1381
- can_sink?: boolean;
1382
- can_swim?: boolean;
1383
- can_walk?: boolean;
1384
- can_walk_in_lava?: boolean;
1385
- is_amphibious?: boolean;
1386
- using_door_annotation?: boolean;
1387
- }): void;
1388
- /**
1389
- * Sets generic navigation for the entity
1390
- */
1391
- setNavigationGeneric(config: {
1392
- avoid_damage_blocks?: boolean;
1393
- avoid_portals?: boolean;
1394
- avoid_sun?: boolean;
1395
- avoid_water?: boolean;
1396
- blocks_to_avoid?: string[];
1397
- can_breach?: boolean;
1398
- can_break_doors?: boolean;
1399
- can_jump?: boolean;
1400
- can_open_doors?: boolean;
1401
- can_open_iron_doors?: boolean;
1402
- can_pass_doors?: boolean;
1403
- can_path_from_air?: boolean;
1404
- can_path_over_water?: boolean;
1405
- can_sink?: boolean;
1406
- can_swim?: boolean;
1407
- can_walk?: boolean;
1408
- can_walk_in_lava?: boolean;
1409
- is_amphibious?: boolean;
1410
- using_door_annotation?: boolean;
1411
- }): void;
1412
- /**
1413
- * Sets hover navigation for the entity
1414
- */
1415
- setNavigationHover(config: {
1416
- avoid_damage_blocks?: boolean;
1417
- avoid_portals?: boolean;
1418
- avoid_sun?: boolean;
1419
- avoid_water?: boolean;
1420
- blocks_to_avoid?: string[];
1421
- can_breach?: boolean;
1422
- can_break_doors?: boolean;
1423
- can_jump?: boolean;
1424
- can_open_doors?: boolean;
1425
- can_open_iron_doors?: boolean;
1426
- can_pass_doors?: boolean;
1427
- can_path_from_air?: boolean;
1428
- can_path_over_water?: boolean;
1429
- can_sink?: boolean;
1430
- can_swim?: boolean;
1431
- can_walk?: boolean;
1432
- can_walk_in_lava?: boolean;
1433
- is_amphibious?: boolean;
1434
- using_door_annotation?: boolean;
1435
- }): void;
1436
- /**
1437
- * Sets swim navigation for the entity
1438
- */
1439
- setNavigationSwim(config: {
1440
- avoid_damage_blocks?: boolean;
1441
- avoid_portals?: boolean;
1442
- avoid_sun?: boolean;
1443
- avoid_water?: boolean;
1444
- blocks_to_avoid?: string[] | Array<{
1445
- name?: string;
1446
- tags?: string;
1447
- }>;
1448
- can_breach?: boolean;
1449
- can_break_doors?: boolean;
1450
- can_jump?: boolean;
1451
- can_open_doors?: boolean;
1452
- can_open_iron_doors?: boolean;
1453
- can_pass_doors?: boolean;
1454
- can_path_from_air?: boolean;
1455
- can_path_over_lava?: boolean;
1456
- can_path_over_water?: boolean;
1457
- can_sink?: boolean;
1458
- can_swim?: boolean;
1459
- can_walk?: boolean;
1460
- can_walk_in_lava?: boolean;
1461
- is_amphibious?: boolean;
1462
- }): void;
1463
- /**
1464
- * Sets walk navigation for the entity
1465
- */
1466
- setNavigationWalk(config: {
1467
- avoid_damage_blocks?: boolean;
1468
- avoid_portals?: boolean;
1469
- avoid_sun?: boolean;
1470
- avoid_water?: boolean;
1471
- blocks_to_avoid?: string[] | Array<{
1472
- name?: string;
1473
- tags?: string;
1474
- }>;
1475
- can_breach?: boolean;
1476
- can_break_doors?: boolean;
1477
- can_float?: boolean;
1478
- can_jump?: boolean;
1479
- can_open_doors?: boolean;
1480
- can_open_iron_doors?: boolean;
1481
- can_pass_doors?: boolean;
1482
- can_path_from_air?: boolean;
1483
- can_path_over_lava?: boolean;
1484
- can_path_over_water?: boolean;
1485
- can_sink?: boolean;
1486
- can_swim?: boolean;
1487
- can_walk?: boolean;
1488
- can_walk_in_lava?: boolean;
1489
- is_amphibious?: boolean;
1490
- using_door_annotation?: boolean;
1491
- }): void;
1492
- /**
1493
- * Sets out_of_control configuration for the entity, defining the entity's 'out of control' state
1494
- */
1495
- setOutOfControl(): void;
1496
- /**
1497
- * Sets peek configuration for the entity, defining the events that should be called during it
1498
- */
1499
- setPeek(config: {
1500
- on_close?: {
1501
- event?: string;
1502
- };
1503
- on_open?: {
1504
- event?: string;
1505
- };
1506
- on_target_open?: {
1507
- event?: string;
1508
- };
1509
- }): void;
1510
- /**
1511
- * Sets persistent configuration for the entity, defining whether an entity should be persistent
1512
- */
1513
- setPersistent(): void;
1514
- /**
1515
- * Sets physics configuration for the entity, defining physics properties
1516
- */
1517
- setPhysics(config: {
1518
- has_collision?: boolean;
1519
- has_gravity?: boolean;
1520
- push_towards_closest_space?: boolean;
1521
- }): void;
1522
- /**
1523
- * Sets player.exhaustion configuration for the player, defining the player's exhaustion level
1524
- */
1525
- setPlayerExhaustion(config: {
1526
- max?: number;
1527
- value?: number;
1528
- }): void;
1529
- /**
1530
- * Sets offspring configuration for the entity
1531
- */
1532
- setOffspring(config: {
1533
- blend_attributes?: boolean;
1534
- deny_parents_variant?: Array<{
1535
- chance?: number;
1536
- max_variant?: number;
1537
- min_variant?: number;
1538
- }>;
1539
- inherit_tamed?: boolean;
1540
- mutation_factor?: {
1541
- color?: number;
1542
- extra_variant?: number;
1543
- variant?: number;
1544
- };
1545
- offspring_pairs?: Record<string, string>;
1546
- parent_centric_attribute_blending?: {
1547
- attribute?: string;
1548
- dampening?: number;
1549
- };
1550
- property_inheritance?: Record<string, any>;
1551
- random_extra_variant_mutation_interval?: {
1552
- range_max?: number;
1553
- range_min?: number;
1554
- };
1555
- random_variant_mutation_interval?: {
1556
- range_max?: number;
1557
- range_min?: number;
1558
- };
1559
- }): void;
1560
- }
1561
- //#endregion
1562
- //#region src/mcx-component/components/item.d.ts
1563
- declare class ItemComponent {
1564
- #private;
1565
- constructor(opt: ItemComponentOptions);
1566
- toJSON(): ItemJson;
1567
- /**
1568
- * set name
1569
- * @throws {Error}&
1570
- * @param {string} newValue
1571
- * @returns {void}
1572
- */
1573
- setName(newValue: string): void;
1574
- setIcon(newValue: string): void;
1575
- setIcon(newValue: PNGImageComponent): void;
1576
- /**
1577
- * get name
1578
- * @returns {string} name
1579
- */
1580
- getName(): string;
1581
- /**
1582
- * set identifier
1583
- * @param {string} newValue
1584
- */
1585
- setId(newValue: string): void;
1586
- /**
1587
- * get item component identifier
1588
- */
1589
- getId(): string;
1590
- /**
1591
- * setAllowOffHand
1592
- * @param vl {boolean} allow off hand
1593
- */
1594
- setAllowOffHand(vl: boolean): void;
1595
- /**
1596
- * setBlockPlacer
1597
- * @param config {object} Block placer configuration
1598
- */
1599
- setBlockPlacer(config: {
1600
- aligned_placement?: boolean;
1601
- block: string;
1602
- replace_block_item?: boolean;
1603
- use_on?: Array<string | {
1604
- name: string;
1605
- states?: Record<string, number | string | boolean>;
1606
- tags?: string;
1607
- }>;
1608
- }): void;
1609
- /**
1610
- * setCooldown
1611
- * @param config {object} Cooldown configuration
1612
- */
1613
- setCooldown(config: {
1614
- category: string;
1615
- duration: number;
1616
- type?: 'use' | 'attack';
1617
- }): void;
1618
- /**
1619
- * setCompostable
1620
- * @param config {object} Compostable configuration
1621
- */
1622
- setCompostable(config: {
1623
- composting_chance: number;
1624
- }): void;
1625
- /**
1626
- * setBundleInteraction
1627
- * @param config {object} Bundle interaction configuration
1628
- */
1629
- setBundleInteraction(config: {
1630
- num_viewable_slots?: number;
1631
- }): void;
1632
- /**
1633
- * setGlint
1634
- * @param value {boolean} Whether the item has glint effect
1635
- */
1636
- setGlint(value: boolean): void;
1637
- /**
1638
- * setHandEquipped
1639
- * @param value {boolean} Whether the item is hand equipped
1640
- */
1641
- setHandEquipped(value: boolean): void;
1642
- /**
1643
- * setDigger
1644
- * @param config {object} Digger configuration
1645
- */
1646
- setDigger(config: {
1647
- use_efficiency?: boolean;
1648
- destroy_speeds?: Array<{
1649
- block: string | {
1650
- name?: string;
1651
- states?: Record<string, number | string | boolean>;
1652
- tags?: string;
1653
- };
1654
- speed: number;
1655
- }>;
1656
- }): void;
1657
- /**
1658
- * setDamageAbsorption
1659
- * @param config {object} Damage absorption configuration
1660
- */
1661
- setDamageAbsorption(config: {
1662
- absorbable_causes: string[];
1663
- }): void;
1664
- /**
1665
- * setDurability
1666
- * @param config {object} Durability configuration
1667
- */
1668
- setDurability(config: {
1669
- max_durability: number;
1670
- damage_chance?: {
1671
- min: number;
1672
- max: number;
1673
- };
1674
- }): void;
1675
- /**
1676
- * setDurabilitySensor
1677
- * @param config {object} Durability Sensor configuration
1678
- */
1679
- setDurabilitySensor(config: {
1680
- durability?: number;
1681
- durability_thresholds?: Array<{
1682
- durability: number;
1683
- particle_type?: ParticleType;
1684
- sound_event?: SoundEvent;
1685
- }>;
1686
- particle_type?: ParticleType;
1687
- sound_event?: SoundEvent;
1688
- }): void;
1689
- /**
1690
- * setDyeable
1691
- * @param config {object} Dyeable configuration
1692
- */
1693
- setDyeable(config: {
1694
- default_color?: string | [number, number, number];
1695
- }): void;
1696
- /**
1697
- * setEnchantable
1698
- * @param config {object} Enchantable configuration
1699
- */
1700
- setEnchantable(config: {
1701
- slot?: EnchantableSlot;
1702
- value?: number;
1703
- }): void;
1704
- /**
1705
- * setFood
1706
- * @param config {object} Food configuration
1707
- */
1708
- setFood(config: {
1709
- can_always_eat?: boolean;
1710
- cooldown_time?: number;
1711
- cooldown_type?: string;
1712
- effects?: Array<{
1713
- amplifier?: number;
1714
- chance?: number;
1715
- duration?: number;
1716
- name?: string;
1717
- }>;
1718
- is_meat?: boolean;
1719
- nutrition?: number;
1720
- on_use_action?: string;
1721
- on_use_range?: [number, number, number];
1722
- saturation_modifier?: number | 'poor' | 'low' | 'normal' | 'good' | 'supernatural';
1723
- using_converts_to?: string;
1724
- remove_effects?: string[];
1725
- }): void;
1726
- /**
1727
- * setFireResistant
1728
- * @param config {object} Fire resistant configuration
1729
- */
1730
- setFireResistant(config: {
1731
- value?: boolean;
1732
- }): void;
1733
- /**
1734
- * setEntityPlacer
1735
- * @param config {object} Entity placer configuration
1736
- */
1737
- setEntityPlacer(config: {
1738
- dispense_on?: Array<string | {
1739
- name: string;
1740
- states?: Record<string, number | string | boolean>;
1741
- tags?: string;
1742
- }>;
1743
- entity: string;
1744
- use_on?: Array<string | {
1745
- name: string;
1746
- states?: Record<string, number | string | boolean>;
1747
- tags?: string;
1748
- }>;
1749
- }): void;
1750
- /**
1751
- * setFuel
1752
- * @param config {object} Fuel configuration
1753
- */
1754
- setFuel(config: {
1755
- duration: number;
1756
- }): void;
1757
- /**
1758
- * setKineticWeapon
1759
- * @param config {object} Kinetic weapon configuration
1760
- */
1761
- setKineticWeapon(config: {
1762
- creative_reach?: {
1763
- max?: number;
1764
- min?: number;
1765
- };
1766
- damage_conditions?: {
1767
- max_duration?: number;
1768
- min_relative_speed?: number;
1769
- min_speed?: number;
1770
- };
1771
- damage_modifier?: number;
1772
- damage_multiplier?: number;
1773
- delay?: number;
1774
- dismount_conditions?: {
1775
- max_duration?: number;
1776
- min_relative_speed?: number;
1777
- min_speed?: number;
1778
- };
1779
- hitbox_margin?: number;
1780
- knockback_conditions?: {
1781
- max_duration?: number;
1782
- min_relative_speed?: number;
1783
- min_speed?: number;
1784
- };
1785
- kinetic_effect_conditions?: {
1786
- max_duration?: number;
1787
- min_relative_speed?: number;
1788
- min_speed?: number;
1789
- };
1790
- reach?: {
1791
- max?: number;
1792
- min?: number;
1793
- };
1794
- }): void;
1795
- /**
1796
- * setInteractButton
1797
- * @param config {boolean | string} Interact button configuration - boolean to enable/disable, or string for custom text
1798
- */
1799
- setInteractButton(config: boolean | string): void;
1800
- /**
1801
- * setHoverTextColor
1802
- * @param config {object | string} Hover text color configuration - object with value property, or string color value
1803
- */
1804
- setHoverTextColor(config: {
1805
- value?: string;
1806
- } | string): void;
1807
- /**
1808
- * setLiquidClipped
1809
- * @param config {boolean | { value?: boolean }} Liquid clipped configuration - boolean to enable/disable, or object with value property
1810
- */
1811
- setLiquidClipped(config: boolean | {
1812
- value?: boolean;
1813
- }): void;
1814
- /**
1815
- * setMaxStackSize
1816
- * @param config {number | { value?: number }} Max stack size configuration - number for direct value, or object with value property
1817
- */
1818
- setMaxStackSize(config: number | {
1819
- value?: number;
1820
- }): void;
1821
- /**
1822
- * setPiercingWeapon
1823
- * @param config {{ creative_reach?: { max?: number; min?: number }; hitbox_margin?: number; reach?: { max?: number; min?: number } }} Piercing weapon configuration
1824
- */
1825
- setPiercingWeapon(config: {
1826
- creative_reach?: {
1827
- max?: number;
1828
- min?: number;
1829
- };
1830
- hitbox_margin?: number;
1831
- reach?: {
1832
- max?: number;
1833
- min?: number;
1834
- };
1835
- }): void;
1836
- /**
1837
- * setProjectile
1838
- * @param config {{ minimum_critical_power?: number; projectile_entity: string }} Projectile configuration
1839
- */
1840
- setProjectile(config: {
1841
- minimum_critical_power?: number;
1842
- projectile_entity: string;
1843
- }): void;
1844
- /**
1845
- * setRecord
1846
- * @param config {{ comparator_signal?: number; duration?: number; sound_event: string }} Record configuration
1847
- */
1848
- setRecord(config: {
1849
- comparator_signal?: number;
1850
- duration?: number;
1851
- sound_event: string;
1852
- }): void;
1853
- /**
1854
- * setRarity
1855
- * @param config {{ value: 'common' | 'uncommon' | 'rare' | 'epic' }} Rarity configuration
1856
- */
1857
- setRarity(config: {
1858
- value: 'common' | 'uncommon' | 'rare' | 'epic';
1859
- }): void;
1860
- /**
1861
- * setRepairable
1862
- * @param config {{ on_repaired?: string; repair_items?: Array<string | { items: string[]; repair_amount?: string | number }> }} Repairable configuration
1863
- */
1864
- setRepairable(config: {
1865
- on_repaired?: string;
1866
- repair_items?: Array<string | {
1867
- items: string[];
1868
- repair_amount?: string | number;
1869
- }>;
1870
- }): void;
1871
- /**
1872
- * setSeed
1873
- * @param config {{ crop_result: string; plant_at?: string[]; plant_at_any_solid_surface?: boolean; plant_at_face?: 'UP' | 'DOWN' }} Seed configuration
1874
- */
1875
- setSeed(config: {
1876
- crop_result: string;
1877
- plant_at?: string[];
1878
- plant_at_any_solid_surface?: boolean;
1879
- plant_at_face?: 'UP' | 'DOWN';
1880
- }): void;
1881
- /**
1882
- * setStackedByData
1883
- * @param config {{ value?: boolean }} StackedByData configuration
1884
- */
1885
- setStackedByData(config: {
1886
- value?: boolean;
1887
- }): void;
1888
- /**
1889
- * setShouldDespawn
1890
- * @param config {{ value?: boolean }} ShouldDespawn configuration
1891
- */
1892
- setShouldDespawn(config: {
1893
- value?: boolean;
1894
- }): void;
1895
- /**
1896
- * setShooter
1897
- * @param config {{
1898
- * ammunition: Array<string | { item: string; launch_power_scale?: number; max_draw_duration?: number; charge_on_draw?: boolean }>;
1899
- * charge_on_draw?: boolean;
1900
- * max_draw_duration?: number;
1901
- * auto_charge?: boolean;
1902
- * launch_power?: number;
1903
- * scale_power_by_draw_duration?: boolean;
1904
- * }} Shooter configuration
1905
- */
1906
- setShooter(config: {
1907
- ammunition: Array<string | {
1908
- item: string;
1909
- launch_power_scale?: number;
1910
- max_draw_duration?: number;
1911
- charge_on_draw?: boolean;
1912
- }>;
1913
- charge_on_draw?: boolean;
1914
- max_draw_duration?: number;
1915
- auto_charge?: boolean;
1916
- launch_power?: number;
1917
- scale_power_by_draw_duration?: boolean;
1918
- }): void;
1919
- /**
1920
- * setStorageWeightModifier
1921
- * @param config {{ weight_in_storage_item: number }} Storage weight modifier configuration
1922
- */
1923
- setStorageWeightModifier(config: {
1924
- weight_in_storage_item: number;
1925
- }): void;
1926
- /**
1927
- * setStorageWeightLimit
1928
- * @param config {{ storage_capacity_per_slot: number; }} Storage weight limit configuration
1929
- */
1930
- setStorageWeightLimit(config: {
1931
- storage_capacity_per_slot: number;
1932
- }): void;
1933
- /**
1934
- * setStorageItem (enhanced existing method)
1935
- * @param config {object} Storage item configuration
1936
- */
1937
- setStorageItem(config: {
1938
- max_slots?: number;
1939
- max_weight_limit?: number;
1940
- weight_in_storage_item?: number;
1941
- allow_nested_storage_items?: boolean;
1942
- allowed_items?: string[];
1943
- banned_items?: string[];
1944
- }): void;
1945
- /**
1946
- * Set minecraft:throwable component
1947
- * @param config {object} Throwable configuration
1948
- */
1949
- setThrowable(config: {
1950
- do_swing_animation?: boolean;
1951
- launch_power_scale?: number;
1952
- max_draw_duration?: number;
1953
- max_launch_power?: number;
1954
- min_draw_duration?: number;
1955
- scale_power_by_draw_duration?: boolean;
1956
- }): void;
1957
- /**
1958
- * Set minecraft:tags component
1959
- * @param tags {string[]} Array of item tags
1960
- */
1961
- setTags(tags: string[]): void;
1962
- /**
1963
- * Set minecraft:swing_duration component
1964
- * @param duration {number} Swing animation duration in seconds
1965
- */
1966
- setSwingDuration(duration: number): void;
1967
- /**
1968
- * Set minecraft:use_animation component
1969
- * @param animation {string | { value?: string }} Animation configuration - can be string ("eat", "drink", etc.) or object ({ value: "eat" })
1970
- */
1971
- setUseAnimation(animation: string | {
1972
- value?: string;
1973
- }): void;
1974
- /**
1975
- * Set minecraft:wearable component
1976
- * @param config {object} Wearable configuration
1977
- */
1978
- setWearable(config: {
1979
- slot: 'slot.armor.head' | 'slot.armor.chest' | 'slot.armor.legs' | 'slot.armor.feet' | 'slot.armor.body' | 'slot.weapon.mainhand' | 'slot.weapon.offhand';
1980
- protection?: number;
1981
- hides_player_location?: boolean;
1982
- dispensable?: boolean;
1983
- }): void;
1984
- /**
1985
- * Set minecraft:use_modifiers component
1986
- * @param config {object} Use modifiers configuration
1987
- */
1988
- setUseModifiers(config: {
1989
- use_duration: number;
1990
- movement_modifier?: number;
1991
- emit_vibrations?: boolean;
1992
- start_sound?: string;
1993
- }): void;
1994
- getIcon(): string | PNGImageComponent | undefined;
1995
- getAllowOffHand(): boolean | undefined;
1996
- getTags(): {
1997
- tags?: string[];
1998
- } | undefined;
1999
- getDamageAbsorption(): {
2000
- absorbable_causes: string[];
2001
- } | undefined;
2002
- getDurability(): {
2003
- max_durability: number;
2004
- damage_chance?: {
2005
- min: number;
2006
- max: number;
2007
- };
2008
- } | undefined;
2009
- getMaxStackSize(): number | {
2010
- value?: number;
2011
- } | undefined;
2012
- getShouldDespawn(): any;
2013
- getHandEquipped(): boolean | undefined;
2014
- getRepairable(): any;
2015
- getFuel(): {
2016
- duration: number;
2017
- } | undefined;
2018
- getStorageWeightModifier(): {
2019
- weight_in_storage_item: number;
2020
- } | undefined;
2021
- getStorageWeightLimit(): {
2022
- max_weight_limit: number;
2023
- } | undefined;
2024
- getStorageItem(): {
2025
- allow_nested_storage_items?: boolean;
2026
- allowed_items?: string[];
2027
- banned_items?: string[];
2028
- max_slots?: number;
2029
- max_weight_limit?: number;
2030
- weight_in_storage_item?: number;
2031
- } | undefined;
2032
- getBundleInteraction(): {
2033
- num_viewable_slots?: number;
2034
- } | undefined;
2035
- getCooldown(): {
2036
- category: string;
2037
- duration: number;
2038
- type?: "use" | "attack";
2039
- } | undefined;
2040
- getCompostable(): {
2041
- composting_chance: number;
2042
- } | undefined;
2043
- getBlockPlacer(): {
2044
- aligned_placement?: boolean;
2045
- block: string;
2046
- replace_block_item?: boolean;
2047
- use_on?: Array<string | {
2048
- name: string;
2049
- states?: Record<string, number | string | boolean>;
2050
- tags?: string;
2051
- }>;
2052
- } | undefined;
2053
- getThrowable(): {
2054
- do_swing_animation?: boolean;
2055
- launch_power_scale?: number;
2056
- max_draw_duration?: number;
2057
- max_launch_power?: number;
2058
- min_draw_duration?: number;
2059
- scale_power_by_draw_duration?: boolean;
2060
- } | undefined;
2061
- getProjectile(): any;
2062
- getRecord(): any;
2063
- getGlint(): any;
2064
- getUseAnimation(): string | {
2065
- value?: string;
2066
- } | undefined;
2067
- getWearable(): {
2068
- slot: "slot.armor.head" | "slot.armor.chest" | "slot.armor.legs" | "slot.armor.feet" | "slot.armor.body" | "slot.weapon.mainhand" | "slot.weapon.offhand" | "slot.hotbar" | "slot.inventory" | "slot.enderchest" | "slot.saddle" | "slot.armor" | "slot.chest";
2069
- protection?: number;
2070
- hides_player_location?: boolean;
2071
- dispensable?: boolean;
2072
- } | undefined;
2073
- getUseModifiers(): {
2074
- use_duration: number;
2075
- movement_modifier?: number;
2076
- emit_vibrations?: boolean;
2077
- start_sound?: string;
2078
- } | undefined;
2079
- }
2080
- //#endregion
2081
- //#region src/mcx-component/lib.d.ts
2082
- declare class ImageComponent {
2083
- filePath: string;
2084
- imageType: string[];
2085
- classId: string;
2086
- constructor(filePath: string, imageType: string[]);
2087
- }
2088
- declare class PNGImageComponent extends ImageComponent {
2089
- classId: "mcx_png_2340192";
2090
- constructor(filePath: string);
2091
- }
2092
- declare class JPGImageComponent extends ImageComponent {
2093
- classId: "mcx_jpg/jpeg_019173";
2094
- constructor(filePath: string);
2095
- }
2096
- declare class SVGImageComponent extends ImageComponent {
2097
- classId: "mcx_svg_129371";
2098
- constructor(filePath: string);
2099
- }
2100
- declare class GIFImageComponent extends ImageComponent {
2101
- classId: "mcx_git_019723";
2102
- constructor(filePath: string);
2103
- }
2104
265
  declare namespace types_d_exports {
2105
- export { BaseJson as BaseJSON, BaseJson, BlockPattern, DefineEntry, FileBindSource as EditFileBindSourceExpression, FileEditExpression as EditFileEditExpression, FileEditOption as EditFileOption, EnchantableSlot, EnchantableSlotEnum, EntityComponentOptions as EntityComponentOpt, EntityComponentOptions, EntityJson as EntityJSON, EntityJson, FileBindSource, FileEditExpression, FileEditOption, FilePoint, ItemComponentOptions as ItemComponentOpt, ItemComponentOptions, ItemGroupEnum, ItemJson as ItemJSON, ItemJson, ParticleType, ParticleTypeEnum, PlantFace, PlantFaceEnum, Rarity, RarityEnum, RepairAmountExpression, RepairItem, RepairItemSchema, SeedProperties, SeedPropertiesSchema, SoundEvent, SoundEventEnum, createFileEdit };
266
+ export { BaseJson, DefineEntry, EnchantableSlot, EntityComponentOptions, EntityJson, FileBindSource, FileEditExpression, FileEditOption, FilePoint, FoodEffect, ItemComponentOptions, ItemJson, ParticleType, Rarity, SoundEvent, createFileEdit };
2106
267
  }
2107
268
  interface FilePoint {
2108
- /**
2109
- * Edit file path base
2110
- */
2111
269
  base: 'behavior' | 'resources' | 'root';
2112
- /**
2113
- * <BASE>/$file
2114
- */
2115
270
  file: string;
2116
271
  }
2117
272
  interface FileBindSource {
2118
- /**
2119
- * Bind some value
2120
- * Mcx can write to file
2121
- */
2122
273
  bind: 'item_texture';
2123
- /**
2124
- * Set bind value mode
2125
- * @example type = "append"; bind value => array (append expression return)
2126
- * @example type = "all_replace" bind value => unknown (all replace)
2127
- */
2128
274
  type: 'append' | 'all_replace';
2129
275
  }
2130
276
  type DefineEntry = {
@@ -2165,2907 +311,15 @@ interface BaseJson {
2165
311
  })[];
2166
312
  };
2167
313
  }
2168
- interface ItemComponentOptions {
2169
- id: string;
2170
- name: string;
2171
- format: string;
2172
- components: Partial<{
2173
- offHand: boolean;
2174
- damage: number;
2175
- canDestroyInCreative: boolean;
2176
- icon: string | PNGImageComponent;
2177
- block_placer?: {
2178
- aligned_placement?: boolean;
2179
- block: string;
2180
- replace_block_item?: boolean;
2181
- use_on?: Array<string | {
2182
- name: string;
2183
- states?: Record<string, number | string | boolean>;
2184
- tags?: string;
2185
- }>;
2186
- };
2187
- cooldown?: {
2188
- category: string;
2189
- duration: number;
2190
- type?: 'use' | 'attack';
2191
- };
2192
- compostable?: {
2193
- composting_chance: number;
2194
- };
2195
- bundle_interaction?: {
2196
- num_viewable_slots?: number;
2197
- };
2198
- /**
2199
- * Enables an item to store data of the dynamic container associated with it.
2200
- * A dynamic container is a container for storing items that is linked to an item instead of a block or an entity.
2201
- *
2202
- * Tip:While this component can be defined on its own, to be able to interact with the item's storage container
2203
- * the item must have a minecraft:bundle_interaction item component defined.
2204
- *
2205
- * Tip:This item requires a format version of at least 1.21.40.
2206
- *
2207
- * @example {
2208
- * "max_slots": 64,
2209
- * "max_weight_limit": 64,
2210
- * "weight_in_storage_item": 4,
2211
- * "allow_nested_storage_items": true,
2212
- * "banned_items": ["minecraft:shulker_box", "minecraft:undyed_shulker_box"]
2213
- * }
2214
- */
2215
- 'minecraft:storage_item'?: {
2216
- /**
2217
- * Determines whether another Storage Item is allowed inside of this item.
2218
- * @default true
2219
- */
2220
- allow_nested_storage_items?: boolean;
2221
- /**
2222
- * List of items that are exclusively allowed in this Storage Item.
2223
- * If empty all items are allowed.
2224
- * @default []
2225
- */
2226
- allowed_items?: string[];
2227
- /**
2228
- * List of items that are not allowed in this Storage Item.
2229
- * @default []
2230
- * @example ["minecraft:shulker_box", "minecraft:undyed_shulker_box"]
2231
- */
2232
- banned_items?: string[];
2233
- /**
2234
- * The maximum number of slots in the storage container.
2235
- * Maximum is 64. Default is 64. Value must be <= 64.
2236
- * @default 64
2237
- * @type Integer number
2238
- */
2239
- max_slots?: number;
2240
- /**
2241
- * The maximum allowed weight of the sum of all contained items.
2242
- * Maximum is 64. Default is 64. Value must be <= 64.
2243
- * @default 64
2244
- * @type Decimal number
2245
- */
2246
- max_weight_limit?: number;
2247
- /**
2248
- * The weight of this item when inside another Storage Item.
2249
- * Default is 4. 0 means item is not allowed in another Storage Item.
2250
- * @default 4
2251
- * @type Decimal number
2252
- */
2253
- weight_in_storage_item?: number;
2254
- };
2255
- /**
2256
- * Specifies the weight of an item when stored inside another storage item.
2257
- * Controls how much weight this item contributes to storage's total weight.
2258
- *
2259
- * @example {"weight_in_storage_item": 4}
2260
- */
2261
- 'minecraft:storage_weight_modifier'?: {
2262
- /**
2263
- * The weight of this item when inside another Storage Item.
2264
- * Default is 4. 0 means item is not allowed in another Storage Item.
2265
- * @default 4
2266
- * @type Integer number
2267
- */
2268
- weight_in_storage_item: number;
2269
- };
2270
- /**
2271
- * Specifies the maximum weight limit that a storage item can hold.
2272
- * Controls the total weight capacity of the storage container.
2273
- *
2274
- * @example {"max_weight_limit": 64}
2275
- */
2276
- 'minecraft:storage_weight_limit'?: {
2277
- /**
2278
- * The maximum allowed weight of the sum of all contained items.
2279
- * Maximum is 64. Default is 64. Value must be <= 64.
2280
- * @default 64
2281
- * @type Integer number
2282
- */
2283
- max_weight_limit: number;
2284
- };
2285
- /**
2286
- * Makes an item throwable by the player, similar to a snowball or ender pearl.
2287
- * Use with minecraft:projectile to specify which entity is spawned when thrown.
2288
- *
2289
- * 注意:Combine with minecraft:projectile to define the projectile entity.
2290
- * For charged throws (like tridents), set scale_power_by_draw_duration to true and configure min/max draw durations.
2291
- */
2292
- 'minecraft:throwable'?: {
2293
- /**
2294
- * Determines whether the item should use the swing animation when thrown.
2295
- * @default false
2296
- */
2297
- do_swing_animation?: boolean;
2298
- /**
2299
- * The scale at which the power of the throw increases.
2300
- * @default 1.0
2301
- */
2302
- launch_power_scale?: number;
2303
- /**
2304
- * The maximum duration to draw a throwable item.
2305
- * @default 0.0
2306
- */
2307
- max_draw_duration?: number;
2308
- /**
2309
- * The maximum power to launch the throwable item.
2310
- * @default 1.0
2311
- */
2312
- max_launch_power?: number;
2313
- /**
2314
- * The minimum duration to draw a throwable item.
2315
- * @default 0.0
2316
- */
2317
- min_draw_duration?: number;
2318
- /**
2319
- * Whether or not the power of the throw increases with duration charged.
2320
- * @default false
2321
- */
2322
- scale_power_by_draw_duration?: boolean;
2323
- };
2324
- throwable?: {
2325
- do_swing_animation?: boolean;
2326
- launch_power_scale?: number;
2327
- max_draw_duration?: number;
2328
- max_launch_power?: number;
2329
- min_draw_duration?: number;
2330
- scale_power_by_draw_duration?: boolean;
2331
- };
2332
- /**
2333
- * Determines which tags are included on a given item.
2334
- */
2335
- 'minecraft:tags'?: {
2336
- /**
2337
- * An array that can contain multiple item tags.
2338
- * @default []
2339
- */
2340
- tags?: string[];
2341
- };
2342
- tags?: {
2343
- tags?: string[];
2344
- };
2345
- /**
2346
- * Duration, in seconds, of the item's swing animation played when mining or attacking.
2347
- * Affects visuals only and does not impact attack frequency or other gameplay mechanics.
2348
- */
2349
- 'minecraft:swing_duration'?: {
2350
- /**
2351
- * Duration, in seconds, of the item's swing animation played when mining or attacking.
2352
- * Affects visuals only and does not impact attack frequency or other gameplay mechanics.
2353
- * @default 0.30000001192092896
2354
- */
2355
- value?: number;
2356
- };
2357
- swing_duration?: {
2358
- value?: number;
2359
- };
2360
- /**
2361
- * Use_animation specifies which animation is played when the player uses the item.
2362
- * Supported animations: 'eat', 'drink', 'block', 'bow', 'camera', 'spear', 'crossbow', 'spyglass', 'toot_horn', 'brush'.
2363
- */
2364
- 'minecraft:use_animation'?: string | {
2365
- /**
2366
- * The animation type to play when the item is used.
2367
- */
2368
- value?: string;
2369
- };
2370
- /**
2371
- * Sets the wearable item component, which allows an item to be worn by a player in a specified equipment slot.
2372
- * Valid slot values: slot.armor.head, slot.armor.chest, slot.armor.legs, slot.armor.feet, slot.armor.body,
2373
- * slot.weapon.mainhand, slot.weapon.offhand, slot.hotbar, slot.inventory, slot.enderchest, slot.saddle, slot.armor, slot.chest
2374
- */
2375
- 'minecraft:wearable'?: {
2376
- /**
2377
- * Defines the equipment slot this item can be equipped to (required).
2378
- */
2379
- slot: 'slot.armor.head' | 'slot.armor.chest' | 'slot.armor.legs' | 'slot.armor.feet' | 'slot.armor.body' | 'slot.weapon.mainhand' | 'slot.weapon.offhand' | 'slot.hotbar' | 'slot.inventory' | 'slot.enderchest' | 'slot.saddle' | 'slot.armor' | 'slot.chest';
2380
- /**
2381
- * Determines how much armor protection this wearable item provides (non-negative integer).
2382
- */
2383
- protection?: number;
2384
- /**
2385
- * Determines whether the player's location relative to the origin is hidden from other entities.
2386
- */
2387
- hides_player_location?: boolean;
2388
- /**
2389
- * Determines whether this wearable item can be dispensed from dispensers.
2390
- */
2391
- dispensable?: boolean;
2392
- };
2393
- /**
2394
- * Determines how long an item takes to use and optional use modifiers.
2395
- * Use duration is required, and movement modifier must be ≤ 1.0.
2396
- */
2397
- 'minecraft:use_modifiers'?: {
2398
- /**
2399
- * How long it takes to use the item (required, non-negative).
2400
- */
2401
- use_duration: number;
2402
- /**
2403
- * Optional value that modifiers the entity's movement speed when this item is used (must be ≤ 1.0).
2404
- */
2405
- movement_modifier?: number;
2406
- /**
2407
- * Whether vibrations are emitted when the item starts or stops being used.
2408
- */
2409
- emit_vibrations?: boolean;
2410
- /**
2411
- * Sound played when the item starts being used.
2412
- */
2413
- start_sound?: string;
2414
- };
2415
- /**
2416
- * Overrides the swing sounds emitted by the user while the item is being used.
2417
- * Specifies the sound to play when swinging the item.
2418
- */
2419
- 'minecraft:swing_sounds'?: {
2420
- /**
2421
- * Sound played when an attack hits and deals critical damage.
2422
- */
2423
- attack_critical_hit?: string;
2424
- /**
2425
- * Sound played when an attack hits.
2426
- */
2427
- attack_hit?: string;
2428
- /**
2429
- * Sound played when an attack misses or deals no damage due to invulnerability.
2430
- */
2431
- attack_miss?: string;
2432
- };
2433
- use_animation?: string | {
2434
- value?: string;
2435
- };
2436
- wearable?: {
2437
- slot: 'slot.armor.head' | 'slot.armor.chest' | 'slot.armor.legs' | 'slot.armor.feet' | 'slot.armor.body' | 'slot.weapon.mainhand' | 'slot.weapon.offhand';
2438
- protection?: number;
2439
- hides_player_location?: boolean;
2440
- dispensable?: boolean;
2441
- };
2442
- use_modifiers?: {
2443
- use_duration: number;
2444
- movement_modifier?: number;
2445
- emit_vibrations?: boolean;
2446
- start_sound?: string;
2447
- };
2448
- swing_sounds?: {
2449
- attack_critical_hit?: string;
2450
- attack_hit?: string;
2451
- attack_miss?: string;
2452
- };
2453
- storage_item?: {
2454
- allow_nested_storage_items?: boolean;
2455
- allowed_items?: string[];
2456
- banned_items?: string[];
2457
- max_slots?: number;
2458
- max_weight_limit?: number;
2459
- weight_in_storage_item?: number;
2460
- };
2461
- storage_weight_modifier?: {
2462
- weight_in_storage_item: number;
2463
- };
2464
- storage_weight_limit?: {
2465
- max_weight_limit: number;
2466
- };
2467
- glint?: boolean;
2468
- hand_equipped?: boolean;
2469
- digger?: {
2470
- use_efficiency?: boolean;
2471
- destroy_speeds?: Array<{
2472
- block: string | {
2473
- name?: string;
2474
- states?: Record<string, number | string | boolean>;
2475
- tags?: string;
2476
- };
2477
- speed: number;
2478
- }>;
2479
- };
2480
- damage_absorption?: {
2481
- absorbable_causes: string[];
2482
- };
2483
- durability?: {
2484
- max_durability: number;
2485
- damage_chance?: {
2486
- min: number;
2487
- max: number;
2488
- };
2489
- };
2490
- durability_sensor?: {
2491
- /**
2492
- * The durability value at which the effects are emitted
2493
- */
2494
- durability?: number;
2495
- /**
2496
- * Defines both the durability threshold, and the effects emitted when that threshold is met.
2497
- */
2498
- durability_thresholds?: Array<{
2499
- /**
2500
- * The effects are emitted when the item durability value is less than or equal to this value.
2501
- * @default 0
2502
- * @type Integer number
2503
- */
2504
- durability: number;
2505
- /**
2506
- * Particle effect to emit when the threshold is met.
2507
- * @type Particle Type choices
2508
- */
2509
- particle_type?: ParticleType;
2510
- /**
2511
- * Sound effect to emit when the threshold is met.
2512
- * @type Sound Event choices
2513
- */
2514
- sound_event?: SoundEvent;
2515
- }>;
2516
- /**
2517
- * Particle effect to emit when durability sensor triggers
2518
- * @type Particle Type choices
2519
- */
2520
- particle_type?: ParticleType;
2521
- /**
2522
- * Sound effect to emit when durability sensor triggers
2523
- * @type Sound Event choices
2524
- */
2525
- sound_event?: SoundEvent;
2526
- };
2527
- /**
2528
- * Enables custom items to be dyed in cauldrons.
2529
- * Requires format version 1.21.30 or greater.
2530
- */
2531
- dyeable?: {
2532
- /**
2533
- * The default color for the dyed item
2534
- * Can be a hex string (e.g., "#175882") or array of RGB numbers [255, 255, 255]
2535
- * @default [255, 255, 255]
2536
- */
2537
- default_color?: string | [number, number, number];
2538
- };
2539
- /**
2540
- * Determines what enchantments can be applied to the item.
2541
- * Not all enchantments will have an effect on all item components.
2542
- */
2543
- enchantable?: {
2544
- /**
2545
- * Specifies which types of enchantments can be applied.
2546
- * For example, "bow" would allow this item to be enchanted as if it were a bow.
2547
- * @example "armor_torso" for chestplate, "armor_feet" for boots
2548
- */
2549
- slot?: EnchantableSlot;
2550
- /**
2551
- * Specifies the value of the enchantment (minimum of 0).
2552
- * @default 0
2553
- * @type Integer number
2554
- * @example Chestplate: 10
2555
- */
2556
- value?: number;
2557
- };
2558
- /**
2559
- * Determines whether the item is immune to burning when dropped in fire or lava.
2560
- */
2561
- 'minecraft:fire_resistant'?: {
2562
- value?: boolean;
2563
- };
2564
- /**
2565
- * Allows an item to place entities into the world.
2566
- * Additionally, in version 1.19.80 and above, the component allows the item to set the spawn type of a monster spawner.
2567
- */
2568
- 'minecraft:entity_placer'?: {
2569
- /**
2570
- * List of block descriptors of the blocks that this item can be dispensed on.
2571
- * If left empty, all blocks will be allowed.
2572
- */
2573
- dispense_on?: Array<string | {
2574
- name: string;
2575
- states?: Record<string, number | string | boolean>;
2576
- tags?: string;
2577
- }>;
2578
- /**
2579
- * The entity to be placed in the world.
2580
- * Value must match a regular expression pattern of "^(?:\\w+(?:.\\w+):(?=\\w))?(?:\\w+(?:.\\w+))(?:<((?:\\w+(?:.\\w+):(?=\\w))?\\w+(?:.\\w+))*>)?$"
2581
- * @example "minecraft:turtle"
2582
- */
2583
- entity: string;
2584
- /**
2585
- * List of block descriptors of the blocks that this item can be used on.
2586
- * If left empty, all blocks will be allowed.
2587
- */
2588
- use_on?: Array<string | {
2589
- name: string;
2590
- states?: Record<string, number | string | boolean>;
2591
- tags?: string;
2592
- }>;
2593
- };
2594
- /**
2595
- * Allows this item to be used as fuel in a furnace to 'cook' other items.
2596
- * This item can also be represented as a Decimal number.
2597
- */
2598
- 'minecraft:fuel'?: {
2599
- /**
2600
- * How long in seconds will this fuel cook items for.
2601
- * Value must be >= 0.05.
2602
- */
2603
- duration: number;
2604
- };
2605
- /**
2606
- * Allows an item to deal kinetic damage and its effects.
2607
- * This happens every tick while in use, in a straight line along the user's view vector.
2608
- */
2609
- 'minecraft:kinetic_weapon'?: {
2610
- /**
2611
- * Defines the reach used when the user is in Creative Mode.
2612
- * Defaults to "reach" if unspecified.
2613
- */
2614
- creative_reach?: {
2615
- max?: number;
2616
- min?: number;
2617
- };
2618
- /**
2619
- * Conditions that need to be satisfied for damage to be applied.
2620
- * If not specified, damage is not applied.
2621
- */
2622
- damage_conditions?: {
2623
- max_duration?: number;
2624
- min_relative_speed?: number;
2625
- min_speed?: number;
2626
- };
2627
- /**
2628
- * Value added to the the scaled dot product (after applying "damage_multiplier").
2629
- * @default 0
2630
- */
2631
- damage_modifier?: number;
2632
- /**
2633
- * Value multiplied to sum of the dot products of the user and target's velocity vectors projected onto the view vector.
2634
- * @default 1
2635
- */
2636
- damage_multiplier?: number;
2637
- /**
2638
- * Time, in ticks, after which kinetic damage and its effects start being applied.
2639
- * @default 0
2640
- */
2641
- delay?: number;
2642
- /**
2643
- * Conditions that need to be satisfied for riders to be dismounted.
2644
- * If not specified, riders cannot be dismounted.
2645
- */
2646
- dismount_conditions?: {
2647
- max_duration?: number;
2648
- min_relative_speed?: number;
2649
- min_speed?: number;
2650
- };
2651
- /**
2652
- * Added tolerance to the view vector raycast for detecting entity collisions.
2653
- * @default 0
2654
- */
2655
- hitbox_margin?: number;
2656
- /**
2657
- * Conditions that need to be satisfied for knockback to be applied.
2658
- * If not specified, knockback is not applied.
2659
- */
2660
- knockback_conditions?: {
2661
- max_duration?: number;
2662
- min_relative_speed?: number;
2663
- min_speed?: number;
2664
- };
2665
- /**
2666
- * Conditions that need to be satisfied for a specific effect of a kinetic weapon to be applied.
2667
- * If negative, the effect is applied indefinitely.
2668
- */
2669
- kinetic_effect_conditions?: {
2670
- /**
2671
- * Time, in ticks, during which the effect can be applied after "delay" elapses.
2672
- * If negative, the effect is applied indefinitely.
2673
- * @default -1
2674
- * @type Integer number
2675
- */
2676
- max_duration?: number;
2677
- /**
2678
- * Minimum relative speed of the user with respect to the target (projected onto the view vector via a dot product) required for the effect to be applied.
2679
- * @default 0
2680
- * @type Decimal number
2681
- */
2682
- min_relative_speed?: number;
2683
- /**
2684
- * Minimum user's speed (projected onto the view vector via a dot product) required for the effect to be applied.
2685
- * @default 0
2686
- * @type Decimal number
2687
- */
2688
- min_speed?: number;
2689
- };
2690
- /**
2691
- * Defines the range (in blocks) along the user's view vector where entities can be hit.
2692
- * @default {"max":3,"min":0}
2693
- */
2694
- reach?: {
2695
- max?: number;
2696
- min?: number;
2697
- };
2698
- };
2699
- /**
2700
- * A boolean or string that determines if the interact button is shown in touch controls,
2701
- * and what text is displayed on the button.
2702
- */
2703
- 'minecraft:interact_button'?: boolean | string;
2704
- /**
2705
- * Determines the color of the item name when hovering over it.
2706
- * This item can also be represented as a String.
2707
- */
2708
- 'minecraft:hover_text_color'?: {
2709
- /**
2710
- * The color of the item hover text.
2711
- */
2712
- value?: string;
2713
- };
2714
- /**
2715
- * Sets the item as a food component, allowing it to be edible to the player.
2716
- */
2717
- 'minecraft:food'?: {
2718
- /**
2719
- * If true you can always eat this item (even when not hungry).
2720
- * @default false
2721
- * @example AppleEnchanted: true
2722
- */
2723
- can_always_eat?: boolean;
2724
- /**
2725
- * Cooldown time in seconds
2726
- * @type Decimal number
2727
- */
2728
- cooldown_time?: number;
2729
- /**
2730
- * Cooldown type
2731
- * @example "chorusfruit" for chorus fruit cooldown
2732
- */
2733
- cooldown_type?: string;
2734
- /**
2735
- * Array of effects applied when consuming the food
2736
- * @example [{"name":"regeneration","chance":1,"duration":30,"amplifier":1}]
2737
- */
2738
- effects?: FoodEffect[];
2739
- /**
2740
- * Whether the food is a meat item
2741
- */
2742
- is_meat?: boolean;
2743
- /**
2744
- * Value that is added to the entity's nutrition when the item is used.
2745
- * @default 0
2746
- * @type Integer number
2747
- * @example Apple: 4, Baked Potato: 5, Beef: 3
2748
- */
2749
- nutrition?: number;
2750
- /**
2751
- * Minecraft event trigger for on use action
2752
- * @example "chorus_teleport" for chorus fruit
2753
- */
2754
- on_use_action?: string;
2755
- /**
2756
- * Minecraft event trigger for on use range
2757
- * @example [8, 8, 8] for chorus fruit
2758
- */
2759
- on_use_range?: [number, number, number];
2760
- /**
2761
- * saturation_modifier is used in this formula: (nutrition * saturation_modifier * 2) when applying the saturation buff.
2762
- * Can be a number or string values like "poor", "low", "normal", "good", "supernatural".
2763
- * @default 0.6000000238418579
2764
- * @type Decimal number | string
2765
- * @example Apple: 0.3, AppleEnchanted: "supernatural", Baked Potato: "normal"
2766
- */
2767
- saturation_modifier?: number | 'poor' | 'low' | 'normal' | 'good' | 'supernatural';
2768
- /**
2769
- * When used, converts to the item specified by the string in this field.
2770
- * @example "bowl" for soup items, "glass_bottle" for honey bottle
2771
- */
2772
- using_converts_to?: string;
2773
- /**
2774
- * Deprecated - no longer in use.
2775
- * Array of effect names to remove when eating this food.
2776
- * This property was deprecated and is no longer supported in newer versions.
2777
- */
2778
- remove_effects?: string[];
2779
- };
2780
- /**
2781
- * Sets the item as a food component, allowing it to be edible to the player.
2782
- */
2783
- food?: {
2784
- /**
2785
- * If true you can always eat this item (even when not hungry).
2786
- * @default false
2787
- * @example AppleEnchanted: true
2788
- */
2789
- can_always_eat?: boolean;
2790
- /**
2791
- * Cooldown time in seconds
2792
- * @type Decimal number
2793
- */
2794
- cooldown_time?: number;
2795
- /**
2796
- * Cooldown type
2797
- * @example "chorusfruit" for chorus fruit cooldown
2798
- */
2799
- cooldown_type?: string;
2800
- /**
2801
- * Array of effects applied when consuming the food
2802
- * @example [{"name":"regeneration","chance":1,"duration":30,"amplifier":1}]
2803
- */
2804
- effects?: FoodEffect[];
2805
- /**
2806
- * Whether the food is a meat item
2807
- */
2808
- is_meat?: boolean;
2809
- /**
2810
- * Value that is added to the entity's nutrition when the item is used.
2811
- * @default 0
2812
- * @type Integer number
2813
- * @example Apple: 4, Baked Potato: 5, Beef: 3
2814
- */
2815
- nutrition?: number;
2816
- /**
2817
- * Minecraft event trigger for on use action
2818
- * @example "chorus_teleport" for chorus fruit
2819
- */
2820
- on_use_action?: string;
2821
- /**
2822
- * Minecraft event trigger for on use range
2823
- * @example [8, 8, 8] for chorus fruit
2824
- */
2825
- on_use_range?: [number, number, number];
2826
- /**
2827
- * saturation_modifier is used in this formula: (nutrition * saturation_modifier * 2) when applying the saturation buff.
2828
- * Can be a number or string values like "poor", "low", "normal", "good", "supernatural".
2829
- * @default 0.6000000238418579
2830
- * @type Decimal number | string
2831
- * @example Apple: 0.3, AppleEnchanted: "supernatural", Baked Potato: "normal"
2832
- */
2833
- saturation_modifier?: number | 'poor' | 'low' | 'normal' | 'good' | 'supernatural';
2834
- /**
2835
- * When used, converts to the item specified by the string in this field.
2836
- * @example "bowl" for soup items, "glass_bottle" for honey bottle
2837
- */
2838
- using_converts_to?: string;
2839
- /**
2840
- * Deprecated - no longer in use.
2841
- * Array of effect names to remove when eating this food.
2842
- * This property was deprecated and is no longer supported in newer versions.
2843
- */
2844
- remove_effects?: string[];
2845
- };
2846
- /**
2847
- * Determines whether the item is immune to burning when dropped in fire or lava.
2848
- */
2849
- fire_resistant?: {
2850
- /**
2851
- * Determines whether the item is immune to burning when dropped in fire or lava.
2852
- * @default true
2853
- */
2854
- value?: boolean;
2855
- };
2856
- /**
2857
- * Allows an item to place entities into the world.
2858
- * Additionally, in version 1.19.80 and above, the component allows the item to set the spawn type of a monster spawner.
2859
- */
2860
- entity_placer?: {
2861
- /**
2862
- * List of block descriptors of the blocks that this item can be dispensed on.
2863
- * If left empty, all blocks will be allowed.
2864
- */
2865
- dispense_on?: Array<string | {
2866
- name: string;
2867
- states?: Record<string, number | string | boolean>;
2868
- tags?: string;
2869
- }>;
2870
- /**
2871
- * The entity to be placed in the world.
2872
- * Value must match a regular expression pattern of "^(?:\\w+(?:.\\w+):(?=\\w))?(?:\\w+(?:.\\w+))(?:<((?:\\w+(?:.\\w+):(?=\\w))?\\w+(?:.\\w+))*>)?$"
2873
- * @example "minecraft:turtle"
2874
- */
2875
- entity: string;
2876
- /**
2877
- * List of block descriptors of the blocks that this item can be used on.
2878
- * If left empty, all blocks will be allowed.
2879
- */
2880
- use_on?: Array<string | {
2881
- name: string;
2882
- states?: Record<string, number | string | boolean>;
2883
- tags?: string;
2884
- }>;
2885
- };
2886
- /**
2887
- * Allows this item to be used as fuel in a furnace to 'cook' other items.
2888
- * This item can also be represented as a Decimal number.
2889
- */
2890
- fuel?: {
2891
- duration: number;
2892
- };
2893
- kinetic_weapon?: {
2894
- creative_reach?: {
2895
- max?: number;
2896
- min?: number;
2897
- };
2898
- damage_conditions?: {
2899
- max_duration?: number;
2900
- min_relative_speed?: number;
2901
- min_speed?: number;
2902
- };
2903
- damage_modifier?: number;
2904
- damage_multiplier?: number;
2905
- delay?: number;
2906
- dismount_conditions?: {
2907
- max_duration?: number;
2908
- min_relative_speed?: number;
2909
- min_speed?: number;
2910
- };
2911
- hitbox_margin?: number;
2912
- knockback_conditions?: {
2913
- max_duration?: number;
2914
- min_relative_speed?: number;
2915
- min_speed?: number;
2916
- };
2917
- kinetic_effect_conditions?: {
2918
- max_duration?: number;
2919
- min_relative_speed?: number;
2920
- min_speed?: number;
2921
- };
2922
- reach?: {
2923
- max?: number;
2924
- min?: number;
2925
- };
2926
- };
2927
- interact_button?: boolean | string;
2928
- hover_text_color?: {
2929
- value?: string;
2930
- };
2931
- /**
2932
- * Determines whether the item interacts with liquid blocks on use.
2933
- * To allow placement of blocks on liquids, see the 'placement_filter' block component.
2934
- * This item can also be represented as a Boolean true/false.
2935
- */
2936
- 'minecraft:liquid_clipped'?: boolean | {
2937
- /**
2938
- * Determines whether the item interacts with liquid blocks on use.
2939
- */
2940
- value?: boolean;
2941
- };
2942
- liquid_clipped?: boolean | {
2943
- /**
2944
- * Determines whether the item interacts with liquid blocks on use.
2945
- */
2946
- value?: boolean;
2947
- };
2948
- /**
2949
- * Determines how many of an item can be stacked together.
2950
- * This item can also be represented as a Integer number.
2951
- * @default 64
2952
- */
2953
- 'minecraft:max_stack_size'?: number | {
2954
- /**
2955
- * How many of an item that can be stacked together.
2956
- * @default 64
2957
- */
2958
- value?: number;
2959
- };
2960
- max_stack_size?: number | {
2961
- /**
2962
- * How many of an item that can be stacked together.
2963
- * @default 64
2964
- */
2965
- value?: number;
2966
- };
2967
- }>;
2968
- }
2969
- type JSONValue<T> = T | {
2970
- value: T;
2971
- };
314
+ //#endregion
315
+ //#region src/mcx-component/cjsTransform.d.ts
2972
316
  /**
2973
- * Food effects interface for minecraft:food component
317
+ * ESM => CJS
318
+ */
319
+ declare function transformESMToCJS(code: string, pluginContext?: Record<string, string | null | boolean | number>, hook?: (data: t.CallExpression | t.MemberExpression, setData?: (newData: t.Expression) => void) => void): string;
320
+ /**
321
+ * import IR => require
2974
322
  */
2975
- interface FoodEffect {
2976
- /**
2977
- * Effect amplifier
2978
- * @example 1 for regeneration amplifier
2979
- */
2980
- amplifier?: number;
2981
- /**
2982
- * Chance of the effect being applied (0.0 to 1.0)
2983
- * @example 0.3 for 30% chance
2984
- */
2985
- chance?: number;
2986
- /**
2987
- * Duration of the effect in seconds
2988
- * @example 30 for 30 seconds duration
2989
- */
2990
- duration?: number;
2991
- /**
2992
- * Name of the effect
2993
- * @example "regeneration", "absorption", "hunger"
2994
- */
2995
- name?: string;
2996
- }
2997
- type ItemGroupEnum = 'minecraft:itemGroup.name.planks' | 'minecraft:itemGroup.name.walls' | 'minecraft:itemGroup.name.fence' | 'minecraft:itemGroup.name.fenceGate' | 'minecraft:itemGroup.name.glass' | 'minecraft:itemGroup.name.trapdoor' | 'minecraft:itemGroup.name.door' | 'minecraft:itemGroup.name.stairs' | 'minecraft:itemGroup.name.glassPane' | 'minecraft:itemGroup.name.slab' | 'minecraft:itemGroup.name.stoneBrick' | 'minecraft:itemGroup.name.sandstone' | 'minecraft:itemGroup.name.copper' | 'minecraft:itemGroup.name.wool' | 'minecraft:itemGroup.name.woolCarpet' | 'minecraft:itemGroup.name.concretePowder' | 'minecraft:itemGroup.name.concrete' | 'minecraft:itemGroup.name.stainedClay' | 'minecraft:itemGroup.name.glazedTerracotta' | 'minecraft:itemGroup.name.ore' | 'minecraft:itemGroup.name.stone' | 'minecraft:itemGroup.name.log' | 'minecraft:itemGroup.name.wood' | 'minecraft:itemGroup.name.leaves' | 'minecraft:itemGroup.name.sapling' | 'minecraft:itemGroup.name.seed' | 'minecraft:itemGroup.name.crop' | 'minecraft:itemGroup.name.grass' | 'minecraft:itemGroup.name.coral_decorations' | 'minecraft:itemGroup.name.flower' | 'minecraft:itemGroup.name.dye' | 'minecraft:itemGroup.name.rawFood' | 'minecraft:itemGroup.name.mushroom' | 'minecraft:itemGroup.name.monsterStoneEgg' | 'minecraft:itemGroup.name.mobEgg' | 'minecraft:itemGroup.name.coral' | 'minecraft:itemGroup.name.sculk' | 'minecraft:itemGroup.name.helmet' | 'minecraft:itemGroup.name.chestplate' | 'minecraft:itemGroup.name.leggings' | 'minecraft:itemGroup.name.boots' | 'minecraft:itemGroup.name.sword' | 'minecraft:itemGroup.name.axe' | 'minecraft:itemGroup.name.pickaxe' | 'minecraft:itemGroup.name.shovel' | 'minecraft:itemGroup.name.hoe' | 'minecraft:itemGroup.name.arrow' | 'minecraft:itemGroup.name.cookedFood' | 'minecraft:itemGroup.name.miscFood' | 'minecraft:itemGroup.name.goatHorn' | 'minecraft:itemGroup.name.bundles' | 'minecraft:itemGroup.name.horseArmor' | 'minecraft:itemGroup.name.potion' | 'minecraft:itemGroup.name.splashPotion' | 'minecraft:itemGroup.name.lingeringPotion' | 'minecraft:itemGroup.name.ominousBottle' | 'minecraft:itemGroup.name.bed' | 'minecraft:itemGroup.name.candles' | 'minecraft:itemGroup.name.anvil' | 'minecraft:itemGroup.name.chest' | 'minecraft:itemGroup.name.shulkerBox' | 'minecraft:itemGroup.name.record' | 'minecraft:itemGroup.name.sign' | 'minecraft:itemGroup.name.hanging_sign' | 'minecraft:itemGroup.name.skull' | 'minecraft:itemGroup.name.boat' | 'minecraft:itemGroup.name.chestboat' | 'minecraft:itemGroup.name.rail' | 'minecraft:itemGroup.name.minecart' | 'minecraft:itemGroup.name.buttons' | 'minecraft:itemGroup.name.pressurePlate' | 'minecraft:itemGroup.name.banner_pattern' | 'minecraft:itemGroup.name.potterySherds' | 'minecraft:itemGroup.name.smithing_templates';
2998
- interface ItemJson extends BaseJson {
2999
- 'minecraft:item': {
3000
- description: {
3001
- identifier: string;
3002
- category?: string;
3003
- menu_category?: {
3004
- category: string;
3005
- group: ItemGroupEnum;
3006
- };
3007
- };
3008
- components: {
3009
- 'minecraft:display_name'?: JSONValue<string>;
3010
- 'minecraft:allow_off_hand'?: JSONValue<boolean>;
3011
- 'minecraft:can_destroy_in_creative'?: JSONValue<boolean>;
3012
- 'minecraft:compostable'?: {
3013
- composting_chance: number;
3014
- };
3015
- 'minecraft:cooldown'?: {
3016
- category: string;
3017
- duration: number;
3018
- type: 'use' | 'attack';
3019
- };
3020
- 'minecraft:damage'?: JSONValue<number>;
3021
- 'minecraft:icon'?: {
3022
- textures: string;
3023
- };
3024
- 'minecraft:block_placer'?: {
3025
- aligned_placement?: boolean;
3026
- block: string;
3027
- replace_block_item?: boolean;
3028
- use_on?: Array<string | {
3029
- name: string;
3030
- states?: Record<string, number | string | boolean>;
3031
- tags?: string;
3032
- }>;
3033
- };
3034
- 'minecraft:bundle_interaction'?: {
3035
- num_viewable_slots?: number;
3036
- };
3037
- 'minecraft:storage_item'?: {
3038
- max_slots?: number;
3039
- max_weight_limit?: number;
3040
- weight_in_storage_item?: number;
3041
- allow_nested_storage_items?: boolean;
3042
- allowed_items?: string[];
3043
- banned_items?: string[];
3044
- };
3045
- 'minecraft:storage_weight_limit'?: {
3046
- /**
3047
- * 存储物品允许的最大总重量(十进制数)
3048
- * @default undefined
3049
- */
3050
- limit?: number;
3051
- };
3052
- 'minecraft:storage_weight_modifier'?: {
3053
- /**
3054
- * 应用于存储物品的重量乘数
3055
- * 在计算中,物品的基本重量会乘以该值
3056
- * @default undefined
3057
- */
3058
- multiplier?: number;
3059
- };
3060
- 'minecraft:glint'?: JSONValue<boolean>;
3061
- 'minecraft:hand_equipped'?: JSONValue<boolean>;
3062
- 'minecraft:digger'?: {
3063
- use_efficiency?: boolean;
3064
- destroy_speeds?: Array<{
3065
- block: string | {
3066
- name?: string;
3067
- states?: Record<string, number | string | boolean>;
3068
- tags?: string;
3069
- };
3070
- speed: number;
3071
- }>;
3072
- };
3073
- 'minecraft:damage_absorption'?: {
3074
- absorbable_causes: string[];
3075
- };
3076
- 'minecraft:durability'?: {
3077
- max_durability: number;
3078
- damage_chance?: {
3079
- min: number;
3080
- max: number;
3081
- };
3082
- };
3083
- 'minecraft:durability_sensor'?: {
3084
- durability?: number;
3085
- durability_thresholds?: Array<{
3086
- durability: number;
3087
- particle_type?: ParticleType;
3088
- sound_event?: SoundEvent;
3089
- }>;
3090
- particle_type?: ParticleType;
3091
- sound_event?: SoundEvent;
3092
- };
3093
- /**
3094
- * Enables custom items to be dyed in cauldrons.
3095
- * Requires format version 1.21.30 or greater.
3096
- */
3097
- 'minecraft:dyeable'?: {
3098
- /**
3099
- * The default color for the dyed item
3100
- * Can be a hex string (e.g., "#175882") or array of RGB numbers [255, 255, 255]
3101
- * @default [255, 255, 255]
3102
- */
3103
- default_color?: string | [number, number, number];
3104
- };
3105
- /**
3106
- * Determines what enchantments can be applied to the item.
3107
- * Not all enchantments will have an effect on all item components.
3108
- */
3109
- 'minecraft:enchantable'?: {
3110
- /**
3111
- * Specifies which types of enchantments can be applied.
3112
- * For example, "bow" would allow this item to be enchanted as if it were a bow.
3113
- * @example "armor_torso" for chestplate, "armor_feet" for boots
3114
- */
3115
- slot?: EnchantableSlot;
3116
- /**
3117
- * Specifies the value of the enchantment (minimum of 0).
3118
- * @default 0
3119
- * @type Integer number
3120
- * @example Chestplate: 10
3121
- */
3122
- value?: number;
3123
- };
3124
- /**
3125
- * Sets the item as a food component, allowing it to be edible to the player.
3126
- */
3127
- 'minecraft:food'?: {
3128
- can_always_eat?: boolean;
3129
- cooldown_time?: number;
3130
- cooldown_type?: string;
3131
- effects?: FoodEffect[];
3132
- is_meat?: boolean;
3133
- nutrition?: number;
3134
- on_use_action?: string;
3135
- on_use_range?: [number, number, number];
3136
- saturation_modifier?: number | 'poor' | 'low' | 'normal' | 'good' | 'supernatural';
3137
- using_converts_to?: string;
3138
- remove_effects?: string[];
3139
- };
3140
- /**
3141
- * Determines whether the item is immune to burning when dropped in fire or lava.
3142
- */
3143
- 'minecraft:fire_resistant'?: {
3144
- value?: boolean;
3145
- };
3146
- /**
3147
- * Allows an item to place entities into the world.
3148
- * Additionally, in version 1.19.80 and above, the component allows the item to set the spawn type of a monster spawner.
3149
- */
3150
- 'minecraft:entity_placer'?: {
3151
- /**
3152
- * List of block descriptors of the blocks that this item can be dispensed on.
3153
- * If left empty, all blocks will be allowed.
3154
- */
3155
- dispense_on?: Array<string | {
3156
- name: string;
3157
- states?: Record<string, number | string | boolean>;
3158
- tags?: string;
3159
- }>;
3160
- /**
3161
- * The entity to be placed in the world.
3162
- * Value must match a regular expression pattern of "^(?:\w+(?:.\w+):(?=\w))?(?:\w+(?:.\w+))(?:<((?:\w+(?:.\w+):(?=\w))?\w+(?:.\w+))*>)?$"
3163
- * @example "minecraft:turtle"
3164
- */
3165
- entity: string;
3166
- /**
3167
- * List of block descriptors of the blocks that this item can be used on.
3168
- * If left empty, all blocks will be allowed.
3169
- */
3170
- use_on?: Array<string | {
3171
- name: string;
3172
- states?: Record<string, number | string | boolean>;
3173
- tags?: string;
3174
- }>;
3175
- };
3176
- /**
3177
- * Allows this item to be used as fuel in a furnace to 'cook' other items.
3178
- * This item can also be represented as a Decimal number.
3179
- */
3180
- 'minecraft:fuel'?: {
3181
- /**
3182
- * How long in seconds will this fuel cook items for.
3183
- * Value must be >= 0.05.
3184
- */
3185
- duration: number;
3186
- };
3187
- 'minecraft:kinetic_weapon'?: {
3188
- /**
3189
- * Defines the reach used when the user is in Creative Mode.
3190
- * Defaults to "reach" if unspecified.
3191
- */
3192
- creative_reach?: {
3193
- max?: number;
3194
- min?: number;
3195
- };
3196
- /**
3197
- * Conditions that need to be satisfied for damage to be applied.
3198
- * If not specified, damage is not applied.
3199
- */
3200
- damage_conditions?: {
3201
- max_duration?: number;
3202
- min_relative_speed?: number;
3203
- min_speed?: number;
3204
- };
3205
- /**
3206
- * Value added to the the scaled dot product (after applying "damage_multiplier").
3207
- * @default 0
3208
- */
3209
- damage_modifier?: number;
3210
- /**
3211
- * Value multiplied to sum of the dot products of the user and target's velocity vectors projected onto the view vector.
3212
- * @default 1
3213
- */
3214
- damage_multiplier?: number;
3215
- /**
3216
- * Time, in ticks, after which kinetic damage and its effects start being applied.
3217
- * @default 0
3218
- */
3219
- delay?: number;
3220
- /**
3221
- * Conditions that need to be satisfied for riders to be dismounted.
3222
- * If not specified, riders cannot be dismounted.
3223
- */
3224
- dismount_conditions?: {
3225
- max_duration?: number;
3226
- min_relative_speed?: number;
3227
- min_speed?: number;
3228
- };
3229
- /**
3230
- * Added tolerance to the view vector raycast for detecting entity collisions.
3231
- * @default 0
3232
- */
3233
- hitbox_margin?: number;
3234
- /**
3235
- * Conditions that need to be satisfied for knockback to be applied.
3236
- * If not specified, knockback is not applied.
3237
- */
3238
- knockback_conditions?: {
3239
- max_duration?: number;
3240
- min_relative_speed?: number;
3241
- min_speed?: number;
3242
- };
3243
- /**
3244
- * Conditions that need to be satisfied for a specific effect of a kinetic weapon to be applied.
3245
- */
3246
- kinetic_effect_conditions?: {
3247
- max_duration?: number;
3248
- min_relative_speed?: number;
3249
- min_speed?: number;
3250
- };
3251
- /**
3252
- * Defines the reach used for kinetic weapon effects.
3253
- */
3254
- reach?: {
3255
- max?: number;
3256
- min?: number;
3257
- };
3258
- };
3259
- 'minecraft:interact_button'?: boolean | string;
3260
- 'minecraft:hover_text_color'?: {
3261
- /**
3262
- * The color of the item hover text.
3263
- */
3264
- value?: string;
3265
- };
3266
- /**
3267
- * The liquid_clipped component determines whether the item interacts with liquid blocks on use.
3268
- * To allow placement of blocks on liquids, see the 'placement_filter' block component.
3269
- * This item can also be represented as a Boolean true/false.
3270
- */
3271
- 'minecraft:liquid_clipped'?: boolean | {
3272
- /**
3273
- * Determines whether the item interacts with liquid blocks on use.
3274
- */
3275
- value?: boolean;
3276
- };
3277
- /**
3278
- * Determines how many of an item can be stacked together.
3279
- * This item can also be represented as a Integer number.
3280
- * @default 64
3281
- */
3282
- 'minecraft:max_stack_size'?: number | {
3283
- /**
3284
- * How many of an item that can be stacked together.
3285
- * @default 64
3286
- */
3287
- value?: number;
3288
- };
3289
- /**
3290
- * Allows an item to deal damage to all entities detected in a straight line along the user's view vector.
3291
- * Items with this component cannot destroy blocks, as the attack action always takes priority, regardless of what the user is looking at.
3292
- */
3293
- 'minecraft:piercing_weapon'?: {
3294
- /**
3295
- * Defines the reach used when the user is in Creative Mode. Defaults to "reach" if unspecified.
3296
- */
3297
- creative_reach?: {
3298
- max?: number;
3299
- min?: number;
3300
- };
3301
- /**
3302
- * Added tolerance to the view vector raycast for detecting entity collisions.
3303
- * @default 0
3304
- */
3305
- hitbox_margin?: number;
3306
- /**
3307
- * Defines the range (in blocks) along the user's view vector where entities can be hit.
3308
- * @default {"max":3,"min":0}
3309
- */
3310
- reach?: {
3311
- max?: number;
3312
- min?: number;
3313
- };
3314
- };
3315
- piercing_weapon?: {
3316
- creative_reach?: {
3317
- max?: number;
3318
- min?: number;
3319
- };
3320
- hitbox_margin?: number;
3321
- reach?: {
3322
- max?: number;
3323
- min?: number;
3324
- };
3325
- };
3326
- /**
3327
- * Defines an item as a projectile that can be shot from dispensers or used as ammunition with minecraft:shooter.
3328
- * When combined with minecraft:throwable, this component specifies which entity is spawned when the item is thrown.
3329
- */
3330
- 'minecraft:projectile'?: {
3331
- /**
3332
- * Specifies how long a player must charge a projectile for it to critically hit.
3333
- * @example "My Sword Chuck": 1.25
3334
- * @default 0
3335
- */
3336
- minimum_critical_power?: number;
3337
- /**
3338
- * Which entity is to be fired as a projectile.
3339
- * Value must match a regular expression pattern of "^(?:\\w+(?:.\\w+):(?=\\w))?(?:\\w+(?:.\\w+))(?:<((?:\\w+(?:.\\w+):(?=\\w))?\\w+(?:.\\w+))*>)?$".
3340
- * @example "Wind Charge": "wind_charge_projectile", "My Sword Chuck": "minecraft:snowball"
3341
- */
3342
- projectile_entity: string;
3343
- };
3344
- /**
3345
- * Used by record items to play music.
3346
- * @example "My Sword Singing"
3347
- */
3348
- 'minecraft:record'?: {
3349
- /**
3350
- * Specifies signal strength for comparator blocks to use, from 1 - 13.
3351
- * @example "My Sword Singing": 1
3352
- * @default 1
3353
- */
3354
- comparator_signal?: number;
3355
- /**
3356
- * Specifies duration of sound event in seconds, float value.
3357
- * @example "My Sword Singing": 5
3358
- * @default 0
3359
- */
3360
- duration?: number;
3361
- /**
3362
- * Sound event type.
3363
- * Values: 13, cat, blocks, chirp, far, mall, mellohi, stal, strad, ward, 11, wait, pigstep, otherside, 5, relic
3364
- * @example "My Sword Singing": "pigstep"
3365
- */
3366
- sound_event: SoundEvent;
3367
- };
3368
- /**
3369
- * Specifies the base rarity and subsequently color of the item name when the player hovers the cursor over the item.
3370
- * This item requires a format version of at least 1.21.30.
3371
- * This item can also be represented as a String.
3372
- */
3373
- 'minecraft:rarity'?: {
3374
- /**
3375
- * Sets the base rarity of the item.
3376
- * The rarity of an item automatically increases when enchanted, either to Rare when the base rarity is Common or Uncommon,
3377
- * or Epic when the base rarity is Rare.
3378
- * @example "rare"
3379
- */
3380
- value: Rarity;
3381
- };
3382
- /**
3383
- * Defines the items that can be used to repair a defined item, and the amount of durability each item restores upon repair.
3384
- * Each entry needs to define a list of strings for 'items' that can be used for the repair and an optional 'repair_amount' for how much durability is repaired.
3385
- * @example Chestplate: {"on_repaired":"minecraft:celebrate","repair_items":["anvil"]}
3386
- * @example My Sword Chuck: {"repair_items":[{"items":["minecraft:diamond"],"repair_amount":"query.max_durability * 0.25"}]}
3387
- */
3388
- 'minecraft:repairable'?: {
3389
- /**
3390
- * Event triggered when the item is repaired
3391
- * @example "minecraft:celebrate"
3392
- */
3393
- on_repaired?: string;
3394
- /**
3395
- * List of repair item entries.
3396
- * Each entry needs to define a list of strings for items that can be used for the repair and an optional repair_amount for how much durability is gained.
3397
- */
3398
- repair_items?: Array<string | {
3399
- /**
3400
- * Items that can be used to repair an item.
3401
- * @example ["minecraft:stick"]
3402
- * @example ["minecraft:diamond"]
3403
- */
3404
- items: string[];
3405
- /**
3406
- * How much the item is repaired.
3407
- * Can be a string expression or a numeric value.
3408
- * @example "context.other->query.remaining_durability + 0.05 * context.other->query.max_durability"
3409
- * @example "query.max_durability * 0.25"
3410
- */
3411
- repair_amount?: string | number;
3412
- }>;
3413
- };
3414
- /**
3415
- * Sets the item as a seed that can be planted to grow crops.
3416
- * When used on valid ground, the seed will place the specified crop block.
3417
- * This item requires a format version of at least 1.10.0.
3418
- * @example Beetroot Seeds: {"crop_result":"beetroot"}
3419
- * @example Glow Berries: {"crop_result":"cave_vines","plant_at":["cave_vines","cave_vines_head_with_berries"],"plant_at_any_solid_surface":true,"plant_at_face":"DOWN"}
3420
- */
3421
- 'minecraft:seed'?: {
3422
- /**
3423
- * The block identifier that will be placed when the seed is planted.
3424
- * @example "beetroot"
3425
- * @example "cave_vines"
3426
- */
3427
- crop_result: string;
3428
- /**
3429
- * Array of block identifiers that this seed can be planted on or attached to.
3430
- * If not specified, standard farmland rules apply.
3431
- * @example ["cave_vines","cave_vines_head_with_berries"]
3432
- */
3433
- plant_at?: string[];
3434
- /**
3435
- * Deprecated - no longer in use.
3436
- * If true, the seed can be planted on any solid surface, not just farmland or specified blocks.
3437
- * This property was deprecated and removed in versions after 1.18.
3438
- * This property no longer works after format versions of at least 1.19.0.
3439
- */
3440
- plant_at_any_solid_surface?: boolean;
3441
- /**
3442
- * Deprecated - no longer in use.
3443
- * The face of a block where this seed can be planted.
3444
- * Values: 'UP' for top of blocks (normal crops), 'DOWN' for bottom (hanging plants like glow berries).
3445
- * This property was deprecated and removed in versions after 1.18.
3446
- * This property no longer works after format versions of at least 1.19.0.
3447
- */
3448
- plant_at_face?: 'UP' | 'DOWN';
3449
- };
3450
- projectile?: {
3451
- minimum_critical_power?: number;
3452
- projectile_entity: string;
3453
- };
3454
- /**
3455
- * Used by record items to play music.
3456
- * @example "My Sword Singing"
3457
- */
3458
- record?: {
3459
- /**
3460
- * Specifies signal strength for comparator blocks to use, from 1 - 13.
3461
- * @example "My Sword Singing": 1
3462
- * @default 1
3463
- */
3464
- comparator_signal?: number;
3465
- /**
3466
- * Specifies duration of sound event in seconds, float value.
3467
- * @example "My Sword Singing": 5
3468
- * @default 0
3469
- */
3470
- duration?: number;
3471
- /**
3472
- * Sound event type.
3473
- * Values: 13, cat, blocks, chirp, far, mall, mellohi, stal, strad, ward, 11, wait, pigstep, otherside, 5, relic
3474
- * @example "My Sword Singing": "pigstep"
3475
- */
3476
- sound_event: SoundEvent;
3477
- };
3478
- /**
3479
- * Specifies the base rarity and subsequently color of the item name when the player hovers the cursor over the item.
3480
- * This item requires a format version of at least 1.21.30.
3481
- * This item can also be represented as a String.
3482
- */
3483
- rarity?: {
3484
- /**
3485
- * Sets the base rarity of the item.
3486
- * The rarity of an item automatically increases when enchanted, either to Rare when the base rarity is Common or Uncommon,
3487
- * or Epic when the base rarity is Rare.
3488
- * @example "rare"
3489
- */
3490
- value: Rarity;
3491
- };
3492
- /**
3493
- * Alias for minecraft:repairable
3494
- * Defines the items that can be used to repair a defined item, and the amount of durability each item restores upon repair.
3495
- * @example Chestplate: {"on_repaired":"minecraft:celebrate","repair_items":["anvil"]}
3496
- */
3497
- repairable?: {
3498
- on_repaired?: string;
3499
- repair_items?: Array<string | {
3500
- items: string[];
3501
- repair_amount?: string | number;
3502
- }>;
3503
- };
3504
- /**
3505
- * Alias for minecraft:seed
3506
- * Sets the item as a seed that can be planted to grow crops.
3507
- * This item requires a format version of at least 1.10.0.
3508
- * @example Beetroot Seeds: {"crop_result":"beetroot"}
3509
- */
3510
- seed?: {
3511
- crop_result: string;
3512
- plant_at?: string[];
3513
- plant_at_any_solid_surface?: boolean;
3514
- plant_at_face?: 'UP' | 'DOWN';
3515
- };
3516
- /**
3517
- * Controls whether items with different aux values can be stacked together.
3518
- * If true (default), items with different damage, custom data, or other aux values cannot stack.
3519
- * If false, all items of this type stack regardless of aux values.
3520
- * This is primarily used for items like armor with different durability values.
3521
- * @default true
3522
- */
3523
- 'minecraft:stacked_by_data'?: {
3524
- value?: boolean;
3525
- };
3526
- /**
3527
- * Controls whether dropped items should despawn while floating on water.
3528
- * If true, items will despawn when floating (default for most items).
3529
- * If false, items will not despawn while floating on water.
3530
- * @default true
3531
- */
3532
- 'minecraft:should_despawn'?: {
3533
- value?: boolean;
3534
- };
3535
- /**
3536
- * Allows an item to be used for shooting projectiles like bows, crossbows, or thrown items.
3537
- * Requires the entity to have the minecraft:projectile component.
3538
- * @example Bow: {"ammunition":["arrow"],"charge_on_draw":true,"max_draw_duration":1.0}
3539
- */
3540
- 'minecraft:shooter'?: {
3541
- /**
3542
- * Array of ammunition item identifiers that can be used with this shooter.
3543
- * Each item can have specific launch power and other properties.
3544
- * @example ["arrow", {"item":"spectral_arrow","launch_power_scale":1.2}]
3545
- */
3546
- ammunition: Array<string | {
3547
- /** Specific item identifier */item: string; /** Scale factor for launch power (default 1.0) */
3548
- launch_power_scale?: number; /** Maximum draw duration in seconds (optional override) */
3549
- max_draw_duration?: number; /** Whether to apply charge effects (optional override) */
3550
- charge_on_draw?: boolean;
3551
- }>;
3552
- /**
3553
- * Whether power/strength increases while drawing (like bows).
3554
- * If true, power scales with draw duration up to max_draw_duration.
3555
- * @default false
3556
- */
3557
- charge_on_draw?: boolean;
3558
- /**
3559
- * Maximum time in seconds that the item can be drawn/charged.
3560
- * @default 0.0
3561
- */
3562
- max_draw_duration?: number;
3563
- /**
3564
- * Whether the shooter automatically charges when held.
3565
- * @default false
3566
- */
3567
- auto_charge?: boolean;
3568
- /**
3569
- * Base power/velocity multiplier for projectiles.
3570
- * @default 1.0
3571
- */
3572
- launch_power?: number;
3573
- /**
3574
- * Whether to scale power based on draw duration.
3575
- * @default true
3576
- */
3577
- scale_power_by_draw_duration?: boolean;
3578
- };
3579
- /**
3580
- * Alias for minecraft:stacked_by_data
3581
- * Controls whether items with different aux values can be stacked together.
3582
- * @default true
3583
- */
3584
- stacked_by_data?: {
3585
- value?: boolean;
3586
- };
3587
- /**
3588
- * Alias for minecraft:should_despawn
3589
- * Controls whether dropped items should despawn while floating on water.
3590
- * @default true
3591
- */
3592
- should_despawn?: {
3593
- value?: boolean;
3594
- };
3595
- /**
3596
- * Makes an item throwable by the player, similar to a snowball or ender pearl.
3597
- * Use with minecraft:projectile to specify which entity is spawned when thrown.
3598
- *
3599
- * 注意:Combine with minecraft:projectile to define the projectile entity.
3600
- * For charged throws (like tridents), set scale_power_by_draw_duration to true and configure min/max draw durations.
3601
- */
3602
- 'minecraft:throwable'?: {
3603
- /**
3604
- * Determines whether the item should use the swing animation when thrown.
3605
- * @default false
3606
- */
3607
- do_swing_animation?: boolean;
3608
- /**
3609
- * The scale at which the power of the throw increases.
3610
- * @default 1.0
3611
- */
3612
- launch_power_scale?: number;
3613
- /**
3614
- * The maximum duration to draw a throwable item.
3615
- * @default 0.0
3616
- */
3617
- max_draw_duration?: number;
3618
- /**
3619
- * The maximum power to launch the throwable item.
3620
- * @default 1.0
3621
- */
3622
- max_launch_power?: number;
3623
- /**
3624
- * The minimum duration to draw a throwable item.
3625
- * @default 0.0
3626
- */
3627
- min_draw_duration?: number;
3628
- /**
3629
- * Whether or not the power of the throw increases with duration charged.
3630
- * @default false
3631
- */
3632
- scale_power_by_draw_duration?: boolean;
3633
- };
3634
- /**
3635
- * Determines which tags are included on a given item.
3636
- */
3637
- 'minecraft:tags'?: {
3638
- /**
3639
- * An array that can contain multiple item tags.
3640
- * @default []
3641
- */
3642
- tags?: string[];
3643
- };
3644
- /**
3645
- * Duration, in seconds, of the item's swing animation played when mining or attacking.
3646
- * Affects visuals only and does not impact attack frequency or other gameplay mechanics.
3647
- */
3648
- 'minecraft:swing_duration'?: {
3649
- /**
3650
- * Duration, in seconds, of the item's swing animation played when mining or attacking.
3651
- * Affects visuals only and does not impact attack frequency or other gameplay mechanics.
3652
- * @default 0.30000001192092896
3653
- */
3654
- value?: number;
3655
- };
3656
- /**
3657
- * Use_animation specifies which animation is played when the player uses the item.
3658
- * This item can also be represented as a String.
3659
- * Supported animations: 'eat', 'drink', 'block', 'bow', 'camera', 'spear', 'crossbow', 'spyglass', 'toot_horn', 'brush'.
3660
- */
3661
- 'minecraft:use_animation'?: string | {
3662
- /**
3663
- * The animation type to play when the item is used.
3664
- */
3665
- value?: string;
3666
- };
3667
- use_animation?: string | {
3668
- value?: string;
3669
- };
3670
- /**
3671
- * Sets the wearable item component, which allows an item to be worn by a player in a specified equipment slot.
3672
- * Valid equipment slots: slot.armor.head, slot.armor.chest, slot.armor.legs, slot.armor.feet, slot.armor.body, slot.weapon.mainhand, slot.weapon.offhand.
3673
- * When a non-hand armor slot is used, the max stack size is automatically set to 1.
3674
- */
3675
- 'minecraft:wearable'?: {
3676
- /**
3677
- * Specifies where the item can be worn.
3678
- * If any non-hand slot is chosen, the max stack size is set to 1.
3679
- * @example "slot.armor.chest", "slot.armor.head", "slot.armor.feet"
3680
- */
3681
- slot: 'slot.armor.head' | 'slot.armor.chest' | 'slot.armor.legs' | 'slot.armor.feet' | 'slot.armor.body' | 'slot.weapon.mainhand' | 'slot.weapon.offhand';
3682
- /**
3683
- * How much protection the wearable item provides.
3684
- * @default 0
3685
- * @type Integer number
3686
- */
3687
- protection?: number;
3688
- /**
3689
- * Determines whether the Player's location is hidden on Locator Maps and the Locator Bar when the wearable item is worn.
3690
- * @default false
3691
- */
3692
- hides_player_location?: boolean;
3693
- /**
3694
- * Whether the item can be used by dispensers.
3695
- * @example true
3696
- */
3697
- dispensable?: boolean;
3698
- };
3699
- wearable?: {
3700
- slot: 'slot.armor.head' | 'slot.armor.chest' | 'slot.armor.legs' | 'slot.armor.feet' | 'slot.armor.body' | 'slot.weapon.mainhand' | 'slot.weapon.offhand';
3701
- protection?: number;
3702
- hides_player_location?: boolean;
3703
- dispensable?: boolean;
3704
- };
3705
- /**
3706
- * Determines how long an item takes to use in combination with components such as Shooter, Throwable, or Food.
3707
- */
3708
- 'minecraft:use_modifiers'?: {
3709
- /**
3710
- * Time, in seconds, that the item takes to use.
3711
- * @example 1.6
3712
- * @type Decimal number
3713
- */
3714
- use_duration: number;
3715
- /**
3716
- * Multiplier applied to the player's movement speed while the item is in use.
3717
- * Value must be <= 1.
3718
- * @example 0.35
3719
- * @type Decimal number
3720
- */
3721
- movement_modifier?: number;
3722
- /**
3723
- * Whether vibrations are emitted when the item starts or stops being used.
3724
- * @default true
3725
- */
3726
- emit_vibrations?: boolean;
3727
- /**
3728
- * Sound played when the item starts being used.
3729
- * @see StartSoundChoices
3730
- */
3731
- start_sound?: string;
3732
- };
3733
- use_modifiers?: {
3734
- use_duration: number;
3735
- movement_modifier?: number;
3736
- emit_vibrations?: boolean;
3737
- start_sound?: string;
3738
- };
3739
- /**
3740
- * Overrides the swing sounds emitted by the user.
3741
- */
3742
- 'minecraft:swing_sounds'?: {
3743
- /**
3744
- * Sound played when an attack hits and deals critical damage.
3745
- * @see AttackCriticalHitChoices
3746
- */
3747
- attack_critical_hit?: string;
3748
- /**
3749
- * Sound played when an attack hits.
3750
- * @see AttackHitChoices
3751
- */
3752
- attack_hit?: string;
3753
- /**
3754
- * Sound played when an attack misses or deals no damage due to invulnerability.
3755
- * @see AttackMissChoices
3756
- */
3757
- attack_miss?: string;
3758
- };
3759
- swing_sounds?: {
3760
- attack_critical_hit?: string;
3761
- attack_hit?: string;
3762
- attack_miss?: string;
3763
- };
3764
- /**
3765
- * Alias for minecraft:shooter
3766
- * Allows an item to be used for shooting projectiles like bows, crossbows, or thrown items.
3767
- * Requires the entity to have the minecraft:projectile component.
3768
- */
3769
- shooter?: {
3770
- ammunition: Array<string | {
3771
- item: string;
3772
- launch_power_scale?: number;
3773
- max_draw_duration?: number;
3774
- charge_on_draw?: boolean;
3775
- }>;
3776
- charge_on_draw?: boolean;
3777
- max_draw_duration?: number;
3778
- auto_charge?: boolean;
3779
- launch_power?: number;
3780
- scale_power_by_draw_duration?: boolean;
3781
- };
3782
- };
3783
- };
3784
- }
3785
- type Rarity = 'common' | 'uncommon' | 'rare' | 'epic';
3786
- declare const RarityEnum: readonly ["common", "uncommon", "rare", "epic"];
3787
- type PlantFace = 'UP' | 'DOWN';
3788
- declare const PlantFaceEnum: readonly ["UP", "DOWN"];
3789
- declare const BlockPattern: RegExp;
3790
- type RepairItem = {
3791
- /**
3792
- * Items that may be used to repair an item.
3793
- * @example ["minecraft:diamond"]
3794
- */
3795
- items: string[];
3796
- /**
3797
- * How much the item is repaired. Can be a string expression or a numeric value.
3798
- * @example "query.max_durability * 0.25"
3799
- * @example "context.other->query.remaining_durability + 0.05 * context.other->query.max_durability"
3800
- */
3801
- repair_amount?: string | number;
3802
- };
3803
- type RepairAmountExpression = {
3804
- /**
3805
- * The expression for repair amount calculation
3806
- */
3807
- expression: string;
3808
- /**
3809
- * Version identifier
3810
- */
3811
- version: number;
3812
- };
3813
- declare const RepairItemSchema: {
3814
- readonly items: "string[]";
3815
- readonly repair_amount: "string | number";
3816
- };
3817
- type SeedProperties = {
3818
- /**
3819
- * The block identifier that will be placed when the seed is planted
3820
- * @example "beetroot"
3821
- * @example "cave_vines"
3822
- */
3823
- crop_result: string;
3824
- /**
3825
- * Array of block identifiers that this seed can be planted on or attached to.
3826
- * If not specified, standard farmland rules apply.
3827
- * @example ["cave_vines","cave_vines_head_with_berries"]
3828
- */
3829
- plant_at?: string[];
3830
- /**
3831
- * Deprecated - no longer in use.
3832
- * This property was available in versions 1.16.0 through 1.18.x for items like glow berries.
3833
- * This property no longer works after format versions of at least 1.19.0.
3834
- */
3835
- plant_at_any_solid_surface?: boolean;
3836
- /**
3837
- * Deprecated - no longer in use.
3838
- * The face of a block where this seed can be planted.
3839
- * Values: 'UP' for top of blocks (normal crops), 'DOWN' for bottom (hanging plants like glow berries).
3840
- * This property no longer works after format versions of at least 1.19.0.
3841
- */
3842
- plant_at_face?: 'UP' | 'DOWN';
3843
- };
3844
- declare const SeedPropertiesSchema: {
3845
- readonly crop_result: "string";
3846
- readonly plant_at: "string[]";
3847
- readonly plant_at_any_solid_surface: "boolean";
3848
- readonly plant_at_face: "\"UP\" | \"DOWN\"";
3849
- };
3850
- interface EntityComponentOptions {
3851
- id: string;
3852
- format: string;
3853
- is_spawnable?: boolean;
3854
- is_summonable?: boolean;
3855
- components?: {
3856
- physics?: boolean;
3857
- /**
3858
- * Adds a rider to the entity.
3859
- * Requires the following component in order to work properly: Rideable (minecraft:rideable)
3860
- */
3861
- addrider?: {
3862
- /** Type of entity to acquire as a rider */entity_type?: string;
3863
- /**
3864
- * List of riders to be added to the entity. Can only spawn as many riders as
3865
- * "minecraft:rideable" has "seat_count".
3866
- */
3867
- riders?: Array<{
3868
- entity_type: string;
3869
- spawn_event?: string;
3870
- }>; /** Trigger event when a rider is acquired */
3871
- spawn_event?: string;
3872
- };
3873
- /**
3874
- * Allows an entity to ignore attackable targets for a given duration.
3875
- */
3876
- 'minecraft:admire_item'?: {
3877
- /** Duration, in seconds, for which mob won't admire items if it was hurt */cooldown_after_being_attacked?: number; /** Duration, in seconds, that the mob is pacified */
3878
- duration?: number;
3879
- };
3880
- /**
3881
- * Adds a timer for the entity to grow up. It can be accelerated by giving the entity
3882
- * the items it likes as defined by feed_items.
3883
- */
3884
- 'minecraft:ageable'?: {
3885
- /** List of items that are dropped when an entity grows up */drop_items?: string[]; /** Length of time before an entity grows up (-1 to always stay a baby) */
3886
- duration?: number;
3887
- /**
3888
- * List of items that can be fed to an entity to age them up. Can be a single item string,
3889
- * an array of strings, or an array of objects with item and growth properties.
3890
- */
3891
- feed_items?: string | string[] | Array<{
3892
- growth?: number;
3893
- item: string;
3894
- }>; /** Event to fire when an entity grows up. Can be an object with event and target properties, or a simple event string. */
3895
- grow_up?: string | {
3896
- event: string;
3897
- target: string;
3898
- }; /** List of conditions to meet so that the entity can be fed. */
3899
- interact_filters?: any; /** List of items that can be fed to the entity to pause growth for baby entities. */
3900
- pause_growth_items?: string[]; /** List of items that can be used to reset growth for baby entities. */
3901
- reset_growth_items?: string[];
3902
- };
3903
- /**
3904
- * Delay for an entity playing its sound.
3905
- */
3906
- 'minecraft:ambient_sound_interval'?: {
3907
- /** Level sound event to be played as the ambient sound. */event_name?: string;
3908
- /**
3909
- * List of dynamic level sound events, with conditions for choosing between them.
3910
- * Evaluated in order, first one wins. If none evaluate to true, 'event_name' will take precedence.
3911
- */
3912
- event_names?: Array<{
3913
- /** The condition that must be satisfied to select the given ambient sound */condition?: string; /** Level sound event to be played as the ambient sound */
3914
- event_name?: string;
3915
- }>; /** Maximum time in seconds to randomly add to the ambient sound delay time. */
3916
- range?: number; /** Minimum time in seconds before the entity plays its ambient sound again. */
3917
- value?: number;
3918
- };
3919
- 'minecraft:attack_damage'?: {
3920
- value?: number | {
3921
- min: number;
3922
- max: number;
3923
- };
3924
- };
3925
- /**
3926
- * Compels the entity to track anger towards a set of nuisances.
3927
- */
3928
- 'minecraft:anger_level'?: {
3929
- /** Anger level will decay over time. Defines how often anger towards all nuisances will decrease by one. */anger_decrement_interval?: number; /** Anger boost applied to angry threshold when mob gets angry Value must be >= 0. */
3930
- angry_boost?: number; /** Threshold that define when the mob is considered angry at a nuisance Value must be >= 0. */
3931
- angry_threshold?: number; /** If set, other entities of the same entity definition within the broadcastRange will also become angry */
3932
- broadcast_anger?: boolean; /** If set, other entities of the same entity definition within the broadcastRange will also become angry whenever this mob attacks */
3933
- broadcast_anger_on_attack?: boolean; /** Conditions that make this entry in the list valid */
3934
- broadcast_filters?: any; /** Distance in blocks within which other entities of the same entity type will become angry */
3935
- broadcast_range?: number; /** A list of entity families to broadcast anger to */
3936
- broadcast_targets?: string[]; /** Event to fire when this entity is calmed down */
3937
- calm_event?: string; /** The default amount of annoyingness for any given nuisance. Specifies how much to raise anger level on each provocation. */
3938
- default_annoyingness?: number; /** Default projectile annoyingness value */
3939
- default_projectile_annoyingness?: number; /** The amount of time in seconds that the entity will be angry. */
3940
- duration?: number; /** Variance in seconds added to the duration [-delta, delta]. */
3941
- duration_delta?: number; /** Filter out mob types that it should not attack while angry (other Piglins) */
3942
- filters?: any; /** The maximum anger level that can be reached. Applies to any nuisance Value must be >= 0. */
3943
- max_anger?: number; /** Filter that is applied to determine if a mob can be a nuisance */
3944
- nuisance_filter?: any;
3945
- /**
3946
- * Sounds to play when the entity is getting provoked. Evaluated in order.
3947
- * First matching condition wins
3948
- */
3949
- on_increase_sounds?: Array<{
3950
- /** A Molang expression describing under which conditions to play this sound, given that the entity was provoked */condition?: string; /** The sound to play */
3951
- sound?: string;
3952
- }>; /** Defines if the mob should remove target if it falls below 'angry' threshold */
3953
- remove_targets_below_angry_threshold?: boolean; /** The range of time in seconds to randomly wait before playing the sound again. */
3954
- sound_interval?: {
3955
- min: number;
3956
- max: number;
3957
- };
3958
- };
3959
- /**
3960
- * Defines an entity's 'angry' state using a timer.
3961
- */
3962
- 'minecraft:angry'?: {
3963
- /** The sound event to play when the mob is angry */angry_sound?: string; /** If set, other entities of the same entity definition within the broadcastRange will also become angry */
3964
- broadcast_anger?: boolean; /** If set, other entities of the same entity definition within the broadcastRange will also become angry whenever this mob attacks */
3965
- broadcast_anger_on_attack?: boolean; /** If true, other entities of the same entity definition within the broadcastRange will also become angry whenever this mob is attacked */
3966
- broadcast_anger_on_being_attacked?: boolean; /** If false, when this mob is killed it does not spread its anger to other entities of the same entity definition within the broadcastRange */
3967
- broadcast_anger_when_dying?: boolean; /** Conditions that make this entry in the list valid */
3968
- broadcast_filters?: any; /** Distance in blocks within which other entities of the same entity type will become angry */
3969
- broadcast_range?: number; /** A list of entity families to broadcast anger to */
3970
- broadcast_targets?: string[]; /** Event to fire when this entity is calmed down. Can be a simple event name string or an object with event and target properties. */
3971
- calm_event?: string | {
3972
- event: string;
3973
- target: string;
3974
- }; /** The amount of time in seconds that the entity will be angry. */
3975
- duration?: number; /** Variance in seconds added to the duration [-delta, delta]. */
3976
- duration_delta?: number; /** Filter out mob types that it should not attack while angry (other Piglins) */
3977
- filters?: any; /** The range of time in seconds to randomly wait before playing the sound again. */
3978
- sound_interval?: {
3979
- min: number;
3980
- max: number;
3981
- };
3982
- };
3983
- /**
3984
- * Allows an entity to break doors, assuming that that flags set up for the component to use in navigation.
3985
- * Tip: Requires the entity's navigation component to have the parameter can_break_doors set to true.
3986
- */
3987
- 'minecraft:annotation.break_door'?: {
3988
- /** The time in seconds required to break through doors. */break_time?: number; /** The minimum difficulty that the world must be on for this entity to break doors. */
3989
- min_difficulty?: 'hard' | 'normal' | 'easy' | 'peaceful';
3990
- };
3991
- 'minecraft:annotation.open_door'?: {};
3992
- 'minecraft:attack'?: {
3993
- damage?: number | [number, number] | {
3994
- range_min: number;
3995
- range_max: number;
3996
- };
3997
- effect_duration?: number;
3998
- effect_name?: string;
3999
- };
4000
- 'minecraft:area_attack'?: {
4001
- cause?: string;
4002
- damage_cooldown?: number;
4003
- damage_per_tick?: number;
4004
- damage_range?: number;
4005
- entity_filter?: any;
4006
- play_attack_sound?: boolean;
4007
- };
4008
- 'minecraft:attack_cooldown'?: {
4009
- attack_cooldown_complete_event?: string | {
4010
- event: string;
4011
- target?: string;
4012
- };
4013
- attack_cooldown_time?: number | {
4014
- min: number;
4015
- max: number;
4016
- };
4017
- };
4018
- 'minecraft:balloonable'?: {
4019
- mass?: number;
4020
- max_distance?: number;
4021
- on_balloon?: any;
4022
- on_unballoon?: any;
4023
- soft_distance?: number;
4024
- };
4025
- 'minecraft:barter'?: {
4026
- barter_table?: string;
4027
- cooldown_after_being_attacked?: {
4028
- min: number;
4029
- max: number;
4030
- };
4031
- };
4032
- 'minecraft:block_climber'?: {};
4033
- 'minecraft:block_sensor'?: {
4034
- on_break?: Array<{
4035
- block_list?: string[];
4036
- on_block_broken?: string;
4037
- }>;
4038
- sensor_radius?: number;
4039
- sources?: any;
4040
- };
4041
- 'minecraft:body_rotation_axis_aligned'?: {};
4042
- 'minecraft:body_rotation_always_follows_head'?: {};
4043
- 'minecraft:body_rotation_blocked'?: {};
4044
- 'minecraft:body_rotation_locked_to_vehicle'?: {};
4045
- 'minecraft:boostable'?: {
4046
- boost_items?: Array<{
4047
- damage?: number;
4048
- item: string;
4049
- replace_item?: string;
4050
- }>;
4051
- duration?: number;
4052
- speed_multiplier?: number;
4053
- };
4054
- 'minecraft:boss'?: {
4055
- hud_range?: number;
4056
- name?: string;
4057
- should_darken_sky?: boolean;
4058
- };
4059
- 'minecraft:break_blocks'?: {
4060
- breakable_blocks?: string[];
4061
- };
4062
- 'minecraft:breathable'?: {
4063
- breathe_blocks?: string[];
4064
- breathes_air?: boolean;
4065
- breathes_lava?: boolean;
4066
- breathes_solids?: boolean;
4067
- breathes_water?: boolean;
4068
- generates_bubbles?: boolean;
4069
- inhale_time?: number;
4070
- non_breathe_blocks?: string[];
4071
- suffocate_time?: number;
4072
- suffocateTime?: number;
4073
- total_supply?: number;
4074
- totalSupply?: number;
4075
- };
4076
- 'minecraft:bribeable'?: {
4077
- bribe_cooldown?: number;
4078
- bribe_items?: string[] | string;
4079
- };
4080
- 'minecraft:breedable'?: {
4081
- allow_sitting?: boolean;
4082
- blend_attributes?: boolean;
4083
- breed_cooldown?: number;
4084
- breed_items?: string[] | string;
4085
- breeds_with?: Array<{
4086
- baby_type?: string;
4087
- breed_event?: string | {
4088
- event: string;
4089
- filters?: any;
4090
- };
4091
- mate_type?: string;
4092
- }> | {
4093
- baby_type?: string;
4094
- breed_event?: string | {
4095
- event: string;
4096
- filters?: any;
4097
- };
4098
- mate_type?: string;
4099
- };
4100
- causes_pregnancy?: boolean;
4101
- deny_parents_variant?: {
4102
- chance?: number;
4103
- max_variant?: string;
4104
- min_variant?: string;
4105
- };
4106
- environment_requirements?: Array<{
4107
- block_types?: string[];
4108
- count?: number;
4109
- radius?: number;
4110
- }>;
4111
- extra_baby_chance?: {
4112
- min: number;
4113
- max: number;
4114
- };
4115
- inherit_tamed?: boolean;
4116
- love_filters?: any;
4117
- mutation_factor?: {
4118
- color?: {
4119
- min: number;
4120
- max: number;
4121
- } | number;
4122
- extra_variant?: {
4123
- min: number;
4124
- max: number;
4125
- } | number;
4126
- variant?: {
4127
- min: number;
4128
- max: number;
4129
- } | number;
4130
- };
4131
- require_full_health?: boolean;
4132
- require_tame?: boolean;
4133
- };
4134
- 'minecraft:buoyant'?: {
4135
- apply_gravity?: boolean;
4136
- base_buoyancy?: number;
4137
- big_wave_probability?: number;
4138
- big_wave_speed?: number;
4139
- can_auto_step_from_liquid?: boolean;
4140
- drag_down_on_buoyancy_removed?: number;
4141
- liquid_blocks?: string[];
4142
- movement_type?: 'waves' | 'bobbing' | 'none';
4143
- };
4144
- 'minecraft:burns_in_daylight'?: {
4145
- protection_slot?: 'slot.armor.body' | 'slot.armor.chest' | 'slot.armor.feet' | 'slot.armor.head' | 'slot.armor.legs' | 'slot.weapon.mainhand' | 'slot.weapon.offhand';
4146
- };
4147
- 'minecraft:cannot_be_attacked'?: {};
4148
- 'minecraft:can_climb'?: {};
4149
- 'minecraft:can_fly'?: {};
4150
- 'minecraft:can_join_raid'?: {};
4151
- 'minecraft:can_power_jump'?: {};
4152
- 'minecraft:celebrate_hunt'?: {
4153
- broadcast?: boolean;
4154
- celeberation_targets?: any;
4155
- celebrate_sound?: string;
4156
- duration?: number;
4157
- radius?: number;
4158
- sound_interval?: {
4159
- min: number;
4160
- max: number;
4161
- };
4162
- };
4163
- 'minecraft:collision_box'?: {
4164
- height?: number;
4165
- width?: number;
4166
- };
4167
- 'minecraft:color'?: {
4168
- value?: number;
4169
- };
4170
- 'minecraft:color2'?: {
4171
- value?: number;
4172
- };
4173
- 'minecraft:combat_regeneration'?: {
4174
- apply_to_family?: boolean;
4175
- apply_to_self?: boolean;
4176
- regeneration_duration?: number | 'infinite';
4177
- };
4178
- 'minecraft:conditional_bandwidth_optimization'?: {
4179
- conditional_values?: Array<{
4180
- conditional_values?: any;
4181
- max_dropped_ticks?: number;
4182
- max_optimized_distance?: number;
4183
- use_motion_prediction_hints?: boolean;
4184
- }>;
4185
- default_values?: {
4186
- max_dropped_ticks?: number;
4187
- max_optimized_distance?: number;
4188
- use_motion_prediction_hints?: boolean;
4189
- };
4190
- };
4191
- 'minecraft:custom_hit_test'?: {
4192
- hitboxes?: Array<{
4193
- height?: number;
4194
- pivot?: [number, number, number];
4195
- width?: number;
4196
- }>;
4197
- };
4198
- 'minecraft:damage_over_time'?: {
4199
- damage_per_hurt?: number;
4200
- time_between_hurt?: number;
4201
- };
4202
- 'minecraft:damage_sensor'?: {
4203
- deals_damage?: boolean | 'yes' | 'no' | 'no_but_side_effects_apply';
4204
- triggers?: Array<{
4205
- cause?: string;
4206
- damage_modifier?: number;
4207
- damage_multiplier?: number;
4208
- deals_damage?: boolean | string;
4209
- event?: string;
4210
- filters?: any;
4211
- on_damage?: {
4212
- filters?: any;
4213
- };
4214
- on_damage_sound_event?: string;
4215
- }> | {
4216
- cause?: string;
4217
- damage_modifier?: number;
4218
- damage_multiplier?: number;
4219
- deals_damage?: boolean | string;
4220
- event?: string;
4221
- filters?: any;
4222
- on_damage?: {
4223
- filters?: any;
4224
- };
4225
- on_damage_sound_event?: string;
4226
- };
4227
- };
4228
- 'minecraft:dash'?: {
4229
- cooldown_time?: number;
4230
- horizontal_momentum?: number;
4231
- vertical_momentum?: number;
4232
- };
4233
- 'minecraft:dash_action'?: {
4234
- can_dash_underwater?: boolean;
4235
- cooldown_time?: number;
4236
- direction?: 'entity' | 'passenger';
4237
- horizontal_momentum?: number;
4238
- vertical_momentum?: number;
4239
- };
4240
- 'minecraft:default_look_angle'?: {
4241
- value?: number;
4242
- };
4243
- 'minecraft:despawn'?: {
4244
- despawn_from_chance?: boolean;
4245
- despawn_from_distance?: {
4246
- max_distance?: number;
4247
- min_distance?: number;
4248
- };
4249
- despawn_from_inactivity?: boolean;
4250
- despawn_from_simulation_edge?: boolean;
4251
- filters?: any;
4252
- min_range_inactivity_timer?: number;
4253
- min_range_random_chance?: number;
4254
- remove_child_entities?: boolean;
4255
- };
4256
- 'minecraft:dimension_bound'?: {};
4257
- 'minecraft:drying_out_timer'?: {
4258
- dried_out_event?: string | {
4259
- event: string;
4260
- target?: string;
4261
- };
4262
- recover_after_dried_out_event?: string | {
4263
- event: string;
4264
- target?: string;
4265
- };
4266
- stopped_drying_out_event?: string | {
4267
- event: string;
4268
- target?: string;
4269
- };
4270
- total_time?: number;
4271
- water_bottle_refill_time?: number;
4272
- };
4273
- 'minecraft:dweller'?: {
4274
- can_find_poi?: boolean;
4275
- can_migrate?: boolean;
4276
- dweller_role?: string;
4277
- dwelling_bounds_tolerance?: number;
4278
- dwelling_role?: string;
4279
- dwelling_type?: string;
4280
- first_founding_reward?: number;
4281
- preferred_profession?: string;
4282
- update_interval_base?: number;
4283
- update_interval_variant?: number;
4284
- };
4285
- 'minecraft:economy_trade_table'?: {
4286
- convert_trades_economy?: boolean;
4287
- cured_discount?: number | [number, number];
4288
- display_name?: string;
4289
- hero_demand_discount?: number;
4290
- max_cured_discount?: number | [number, number];
4291
- max_nearby_cured_discount?: number;
4292
- nearby_cured_discount?: number;
4293
- new_screen?: boolean;
4294
- persist_trades?: boolean;
4295
- show_trade_screen?: boolean;
4296
- table?: string;
4297
- use_legacy_price_formula?: boolean;
4298
- };
4299
- 'minecraft:entity_armor_equipment_slot_mapping'?: {
4300
- armor_slot?: string;
4301
- };
4302
- 'minecraft:entity_sensor'?: {
4303
- find_players_only?: boolean;
4304
- relative_range?: boolean;
4305
- subsensors?: Array<{
4306
- cooldown?: number;
4307
- event?: string | {
4308
- event: string;
4309
- target?: string;
4310
- };
4311
- event_filters?: any;
4312
- maximum_count?: number;
4313
- minimum_count?: number;
4314
- range?: [number, number] | [number, number, number];
4315
- require_all?: boolean;
4316
- y_offset?: number;
4317
- }>;
4318
- };
4319
- 'minecraft:equipment'?: {
4320
- slot_drop_chance?: Array<string | {
4321
- drop_chance?: number;
4322
- slot?: string;
4323
- }>;
4324
- table?: string;
4325
- };
4326
- 'minecraft:equippable'?: {
4327
- slots?: Array<{
4328
- accepted_items?: string[];
4329
- interact_text?: string;
4330
- item?: string;
4331
- on_equip?: any;
4332
- on_unequip?: any;
4333
- slot?: number;
4334
- [key: string]: any;
4335
- }>;
4336
- };
4337
- 'minecraft:equip_item'?: {
4338
- can_wear_armor?: boolean;
4339
- excluded_items?: Array<{
4340
- item?: string;
4341
- [key: string]: any;
4342
- }>;
4343
- };
4344
- 'minecraft:environment_sensor'?: {
4345
- triggers?: {
4346
- event?: string | {
4347
- event: string;
4348
- target?: string;
4349
- };
4350
- filters?: any;
4351
- [key: string]: any;
4352
- } | Array<{
4353
- event?: string | {
4354
- event: string;
4355
- target?: string;
4356
- };
4357
- filters?: any;
4358
- [key: string]: any;
4359
- }>;
4360
- };
4361
- 'minecraft:exhaustion_values'?: {
4362
- attack?: number;
4363
- damage?: number;
4364
- heal?: number;
4365
- jump?: number;
4366
- lunge?: number;
4367
- mine?: number;
4368
- sprint?: number;
4369
- sprint_jump?: number;
4370
- swim?: number;
4371
- walk?: number;
4372
- [key: string]: any;
4373
- };
4374
- 'minecraft:experience_reward'?: {
4375
- on_bred?: string | number | {
4376
- expression?: string;
4377
- version?: number;
4378
- };
4379
- on_death?: string | number | {
4380
- expression?: string;
4381
- version?: number;
4382
- };
4383
- [key: string]: any;
4384
- };
4385
- 'minecraft:explode'?: {
4386
- add?: {
4387
- component_groups?: string[];
4388
- [key: string]: any;
4389
- };
4390
- allow_underwater?: boolean;
4391
- breaks_blocks?: boolean;
4392
- causes_fire?: boolean;
4393
- damage_scaling?: number;
4394
- destroy_affected_by_griefing?: boolean;
4395
- fire_affected_by_griefing?: boolean;
4396
- fuse_length?: number | [number, number];
4397
- fuse_lit?: boolean;
4398
- knockback_scaling?: number;
4399
- max_resistance?: number;
4400
- negates_fall_damage?: boolean;
4401
- particle_effect?: string;
4402
- power?: number;
4403
- sound_effect?: string;
4404
- toggles_blocks?: boolean;
4405
- [key: string]: any;
4406
- };
4407
- 'minecraft:fire_immune'?: {};
4408
- 'minecraft:floats_in_liquid'?: {};
4409
- 'minecraft:flocking'?: {
4410
- block_distance?: number;
4411
- block_weight?: number;
4412
- breach_influence?: number;
4413
- cohesion_threshold?: number;
4414
- cohesion_weight?: number;
4415
- goal_weight?: number;
4416
- high_flock_limit?: number;
4417
- in_water?: boolean;
4418
- influence_radius?: number;
4419
- innner_cohesion_threshold?: number;
4420
- loner_chance?: number;
4421
- low_flock_limit?: number;
4422
- match_variants?: boolean;
4423
- max_height?: number;
4424
- min_height?: number;
4425
- separation_threshold?: number;
4426
- separation_weight?: number;
4427
- use_center_of_mass?: boolean;
4428
- [key: string]: any;
4429
- };
4430
- 'minecraft:flying_speed'?: {
4431
- value?: number;
4432
- };
4433
- 'minecraft:follow_range'?: {
4434
- max?: number;
4435
- value?: number;
4436
- };
4437
- 'minecraft:free_camera_controlled'?: {
4438
- backwards_movement_modifier?: number;
4439
- strafe_speed_modifier?: number;
4440
- };
4441
- 'minecraft:friction_modifier'?: {
4442
- value?: number;
4443
- };
4444
- 'minecraft:game_event_movement_tracking'?: {
4445
- emit_flap?: boolean;
4446
- emit_move?: boolean;
4447
- emit_swim?: boolean;
4448
- };
4449
- 'minecraft:genetics'?: {
4450
- mutation_rate?: number;
4451
- genes?: Array<{
4452
- name: string;
4453
- use_simplified_breeding?: boolean;
4454
- mutation_rate?: number;
4455
- allele_range?: number | {
4456
- range_min: number;
4457
- range_max: number;
4458
- };
4459
- genetic_variants?: Array<{
4460
- birth_event?: string | {
4461
- event: string;
4462
- target?: string;
4463
- };
4464
- main_allele?: number | {
4465
- range_min: number;
4466
- range_max: number;
4467
- };
4468
- hidden_allele?: number | {
4469
- range_min: number;
4470
- range_max: number;
4471
- };
4472
- both_allele?: number | {
4473
- range_min: number;
4474
- range_max: number;
4475
- };
4476
- either_allele?: number | {
4477
- range_min: number;
4478
- range_max: number;
4479
- };
4480
- }>;
4481
- }>;
4482
- };
4483
- 'minecraft:giveable'?: {
4484
- cooldown?: number;
4485
- items?: string | string[];
4486
- on_give?: string | {
4487
- event: string;
4488
- target?: string;
4489
- };
4490
- };
4491
- 'minecraft:ground_offset'?: {
4492
- value?: number;
4493
- };
4494
- 'minecraft:group_size'?: {
4495
- radius?: number;
4496
- filters?: any;
4497
- };
4498
- 'minecraft:grows_crop'?: {
4499
- chance?: number;
4500
- charges?: number;
4501
- };
4502
- 'minecraft:health'?: {
4503
- max?: number;
4504
- value?: number | {
4505
- range_min?: number;
4506
- range_max?: number;
4507
- };
4508
- };
4509
- 'minecraft:heartbeat'?: {
4510
- interval?: string;
4511
- sound_event?: string;
4512
- };
4513
- 'minecraft:hide'?: {};
4514
- 'minecraft:home'?: {
4515
- home_block_list?: string[];
4516
- restriction_radius?: number;
4517
- restriction_type?: 'none' | 'random_movement' | 'all_movement';
4518
- };
4519
- 'minecraft:horse.jump_strength'?: {
4520
- value?: number | {
4521
- range_min?: number;
4522
- range_max?: number;
4523
- };
4524
- };
4525
- 'minecraft:hurt_on_condition'?: {
4526
- damage_conditions?: Array<{
4527
- cause?: string;
4528
- damage_per_tick?: number;
4529
- filters?: {
4530
- subject?: string;
4531
- test?: string;
4532
- value?: any;
4533
- operator?: string;
4534
- [key: string]: any;
4535
- };
4536
- }>;
4537
- };
4538
- 'minecraft:ignore_cannot_be_attacked'?: {
4539
- filters?: {
4540
- subject?: string;
4541
- test?: string;
4542
- value?: any;
4543
- operator?: string;
4544
- [key: string]: any;
4545
- };
4546
- };
4547
- 'minecraft:input_air_controlled'?: {
4548
- [key: string]: any;
4549
- };
4550
- 'minecraft:input_ground_controlled'?: {};
4551
- 'minecraft:inside_block_notifier'?: {
4552
- block_list?: Array<{
4553
- block?: {
4554
- name?: string;
4555
- states?: {
4556
- [key: string]: string | number | boolean;
4557
- };
4558
- };
4559
- entered_block_event?: {
4560
- event?: string;
4561
- target?: string;
4562
- };
4563
- exited_block_event?: {
4564
- event?: string;
4565
- target?: string;
4566
- };
4567
- }>;
4568
- };
4569
- 'minecraft:insomnia'?: {
4570
- days_until_insomnia?: number;
4571
- };
4572
- 'minecraft:instant_despawn'?: {
4573
- remove_child_entities?: boolean;
4574
- };
4575
- 'minecraft:interact'?: {
4576
- cooldown?: number;
4577
- cooldown_after_being_attacked?: number;
4578
- drop_item_slot?: string | number;
4579
- drop_item_y_offset?: number;
4580
- equip_item_slot?: string | number;
4581
- health_amount?: number;
4582
- hurt_item?: number;
4583
- interact_text?: string;
4584
- interactions?: Array<{
4585
- give_item?: boolean;
4586
- hurt_item?: number;
4587
- interact_text?: string;
4588
- on_interact?: string | {
4589
- filters?: {
4590
- subject?: string;
4591
- test?: string;
4592
- value?: any;
4593
- operator?: string;
4594
- [key: string]: any;
4595
- };
4596
- };
4597
- particle_on_start?: Array<{
4598
- particle_offset_towards_interactor?: boolean;
4599
- particle_type?: string;
4600
- particle_y_offset?: number;
4601
- }>;
4602
- play_sounds?: string;
4603
- repair_entity_item?: Array<{
4604
- amount?: number;
4605
- slot?: string | number;
4606
- }>;
4607
- spawn_entities?: string;
4608
- spawn_items?: Array<{
4609
- table?: string;
4610
- y_offset?: number;
4611
- }>;
4612
- swing?: boolean;
4613
- take_item?: boolean;
4614
- transform_to_item?: string;
4615
- use_item?: boolean;
4616
- vibration?: 'none' | 'shear' | 'entity_die' | 'entity_act' | 'entity_interact';
4617
- }>;
4618
- };
4619
- 'minecraft:inventory'?: {
4620
- additional_slots_per_strength?: number;
4621
- can_be_siphoned_from?: boolean;
4622
- container_type?: string;
4623
- inventory_size?: number;
4624
- private?: boolean;
4625
- restrict_to_owner?: boolean;
4626
- };
4627
- 'minecraft:is_baby'?: {};
4628
- 'minecraft:is_charged'?: {};
4629
- 'minecraft:is_chested'?: {};
4630
- 'minecraft:is_dyeable'?: {
4631
- interact_text?: string;
4632
- };
4633
- 'minecraft:is_ignited'?: {};
4634
- 'minecraft:is_pregnant'?: {};
4635
- 'minecraft:item_controllable'?: {
4636
- control_items?: string | string[];
4637
- };
4638
- 'minecraft:item_hopper'?: {};
4639
- 'minecraft:jump.dynamic'?: {
4640
- fast_skip_data?: {
4641
- animation_duration?: number;
4642
- distance_scale?: number;
4643
- height?: number;
4644
- jump_delay?: number;
4645
- };
4646
- regular_skip_data?: {
4647
- animation_duration?: number;
4648
- distance_scale?: number;
4649
- height?: number;
4650
- jump_delay?: number;
4651
- };
4652
- };
4653
- 'minecraft:jump.static'?: {
4654
- jump_power?: number;
4655
- };
4656
- 'minecraft:knockback_resistance'?: number | {
4657
- max?: number;
4658
- value?: number;
4659
- };
4660
- 'minecraft:lava_movement'?: {
4661
- value?: number;
4662
- };
4663
- 'minecraft:leashable'?: {
4664
- can_be_cut?: boolean;
4665
- can_be_stolen?: boolean;
4666
- hard_distance?: number;
4667
- max_distance?: number;
4668
- on_leash?: string | {
4669
- event: string;
4670
- target?: string;
4671
- };
4672
- on_unleash?: string | {
4673
- event: string;
4674
- target?: string;
4675
- };
4676
- on_unleash_interact_only?: boolean;
4677
- presets?: Array<{
4678
- filter?: {
4679
- subject?: string;
4680
- test?: string;
4681
- value?: any;
4682
- operator?: string;
4683
- [key: string]: any;
4684
- };
4685
- hard_distance?: number;
4686
- max_distance?: number;
4687
- rotation_adjustment?: number;
4688
- soft_distance?: number;
4689
- spring_type?: 'bouncy' | 'dampened' | 'quad_dampened';
4690
- }>;
4691
- soft_distance?: number;
4692
- };
4693
- 'minecraft:leashable_to'?: {
4694
- can_retrieve_from?: boolean;
4695
- };
4696
- 'minecraft:looked_at'?: {
4697
- field_of_view?: number;
4698
- filters?: {
4699
- subject?: string;
4700
- test?: string;
4701
- value?: any;
4702
- operator?: string;
4703
- [key: string]: any;
4704
- };
4705
- find_players_only?: boolean;
4706
- line_of_sight_obstruction_type?: 'outline' | 'collision' | 'collision_for_camera';
4707
- look_at_locations?: string[];
4708
- looked_at_cooldown?: {
4709
- min: number;
4710
- max: number;
4711
- };
4712
- looked_at_event?: string | {
4713
- event: string;
4714
- target?: string;
4715
- };
4716
- min_looked_at_duration?: number;
4717
- not_looked_at_event?: string | {
4718
- event: string;
4719
- target?: string;
4720
- };
4721
- scale_fov_by_distance?: boolean;
4722
- search_radius?: number;
4723
- set_target?: boolean | 'never' | 'once_and_stop_scanning' | 'once_and_keep_scanning';
4724
- };
4725
- 'minecraft:loot'?: {
4726
- table?: string;
4727
- };
4728
- 'minecraft:managed_wandering_trader'?: {};
4729
- 'minecraft:mark_variant'?: {
4730
- value: number;
4731
- };
4732
- 'minecraft:mob_effect'?: {
4733
- ambient?: boolean;
4734
- cooldown_time?: number;
4735
- effect_range?: number;
4736
- effect_time?: number | 'infinite';
4737
- entity_filter?: {
4738
- subject?: string;
4739
- test?: string;
4740
- value?: any;
4741
- operator?: string;
4742
- [key: string]: any;
4743
- };
4744
- mob_effect: string;
4745
- };
4746
- 'minecraft:mob_effect_immunity'?: {
4747
- mob_effects: string[];
4748
- };
4749
- 'minecraft:movement'?: {
4750
- max?: number;
4751
- value?: number | {
4752
- range_min: number;
4753
- range_max: number;
4754
- };
4755
- };
4756
- 'minecraft:movement.amphibious'?: {
4757
- max_turn?: number;
4758
- };
4759
- 'minecraft:movement.basic'?: {
4760
- max_turn?: number;
4761
- };
4762
- 'minecraft:movement.dolphin'?: {};
4763
- 'minecraft:movement.fly'?: {
4764
- max_turn?: number;
4765
- speed_when_turning?: number;
4766
- start_speed?: number;
4767
- };
4768
- 'minecraft:movement.generic'?: {
4769
- max_turn?: number;
4770
- };
4771
- 'minecraft:movement.glide'?: {
4772
- max_turn?: number;
4773
- speed_when_turning?: number;
4774
- };
4775
- 'minecraft:movement.hover'?: {
4776
- max_turn?: number;
4777
- };
4778
- 'minecraft:movement.jump'?: {
4779
- jump_delay?: number | [number, number] | {
4780
- range_min: number;
4781
- range_max: number;
4782
- };
4783
- max_turn?: number;
4784
- };
4785
- 'minecraft:movement.skip'?: {
4786
- max_turn?: number;
4787
- };
4788
- 'minecraft:movement.sound_distance_offset'?: {
4789
- value?: number;
4790
- };
4791
- 'minecraft:movement.sway'?: {
4792
- max_turn?: number;
4793
- sway_amplitude?: number;
4794
- sway_frequency?: number;
4795
- };
4796
- 'minecraft:nameable'?: {
4797
- allow_name_tag_renaming?: boolean;
4798
- always_show?: boolean;
4799
- default_trigger?: string;
4800
- name_actions?: Array<{
4801
- name_filter?: string[];
4802
- on_named?: string | {
4803
- event: string;
4804
- target?: string;
4805
- };
4806
- }>;
4807
- };
4808
- 'minecraft:navigation.climb'?: {
4809
- avoid_damage_blocks?: boolean;
4810
- avoid_portals?: boolean;
4811
- avoid_sun?: boolean;
4812
- avoid_water?: boolean;
4813
- blocks_to_avoid?: string[];
4814
- can_breach?: boolean;
4815
- can_break_doors?: boolean;
4816
- can_jump?: boolean;
4817
- can_open_doors?: boolean;
4818
- can_open_iron_doors?: boolean;
4819
- can_pass_doors?: boolean;
4820
- can_path_from_air?: boolean;
4821
- can_path_over_lava?: boolean;
4822
- can_path_over_water?: boolean;
4823
- can_sink?: boolean;
4824
- can_swim?: boolean;
4825
- can_walk?: boolean;
4826
- can_walk_in_lava?: boolean;
4827
- is_amphibious?: boolean;
4828
- using_door_annotation?: boolean;
4829
- };
4830
- 'minecraft:navigation.float'?: {
4831
- avoid_damage_blocks?: boolean;
4832
- avoid_portals?: boolean;
4833
- avoid_sun?: boolean;
4834
- avoid_water?: boolean;
4835
- blocks_to_avoid?: string[];
4836
- can_breach?: boolean;
4837
- can_break_doors?: boolean;
4838
- can_jump?: boolean;
4839
- can_open_doors?: boolean;
4840
- can_open_iron_doors?: boolean;
4841
- can_pass_doors?: boolean;
4842
- can_path_from_air?: boolean;
4843
- can_path_over_lava?: boolean;
4844
- can_path_over_water?: boolean;
4845
- can_sink?: boolean;
4846
- can_swim?: boolean;
4847
- can_walk?: boolean;
4848
- can_walk_in_lava?: boolean;
4849
- is_amphibious?: boolean;
4850
- using_door_annotation?: boolean;
4851
- };
4852
- 'minecraft:navigation.fly'?: {
4853
- avoid_damage_blocks?: boolean;
4854
- avoid_portals?: boolean;
4855
- avoid_sun?: boolean;
4856
- avoid_water?: boolean;
4857
- blocks_to_avoid?: string[];
4858
- can_breach?: boolean;
4859
- can_break_doors?: boolean;
4860
- can_jump?: boolean;
4861
- can_open_doors?: boolean;
4862
- can_open_iron_doors?: boolean;
4863
- can_pass_doors?: boolean;
4864
- can_path_from_air?: boolean;
4865
- can_path_over_lava?: boolean;
4866
- can_path_over_water?: boolean;
4867
- can_sink?: boolean;
4868
- can_swim?: boolean;
4869
- can_walk?: boolean;
4870
- can_walk_in_lava?: boolean;
4871
- is_amphibious?: boolean;
4872
- using_door_annotation?: boolean;
4873
- };
4874
- 'minecraft:navigation.generic'?: {
4875
- avoid_damage_blocks?: boolean;
4876
- avoid_portals?: boolean;
4877
- avoid_sun?: boolean;
4878
- avoid_water?: boolean;
4879
- blocks_to_avoid?: string[];
4880
- can_breach?: boolean;
4881
- can_break_doors?: boolean;
4882
- can_jump?: boolean;
4883
- can_open_doors?: boolean;
4884
- can_open_iron_doors?: boolean;
4885
- can_pass_doors?: boolean;
4886
- can_path_from_air?: boolean;
4887
- can_path_over_lava?: boolean;
4888
- can_path_over_water?: boolean;
4889
- can_sink?: boolean;
4890
- can_swim?: boolean;
4891
- can_walk?: boolean;
4892
- can_walk_in_lava?: boolean;
4893
- is_amphibious?: boolean;
4894
- using_door_annotation?: boolean;
4895
- };
4896
- 'minecraft:navigation.hover'?: {
4897
- avoid_damage_blocks?: boolean;
4898
- avoid_portals?: boolean;
4899
- avoid_sun?: boolean;
4900
- avoid_water?: boolean;
4901
- blocks_to_avoid?: string[];
4902
- can_breach?: boolean;
4903
- can_break_doors?: boolean;
4904
- can_jump?: boolean;
4905
- can_open_doors?: boolean;
4906
- can_open_iron_doors?: boolean;
4907
- can_pass_doors?: boolean;
4908
- can_path_from_air?: boolean;
4909
- can_path_over_lava?: boolean;
4910
- can_path_over_water?: boolean;
4911
- can_sink?: boolean;
4912
- can_swim?: boolean;
4913
- can_walk?: boolean;
4914
- can_walk_in_lava?: boolean;
4915
- is_amphibious?: boolean;
4916
- using_door_annotation?: boolean;
4917
- };
4918
- 'minecraft:navigation.swim'?: {
4919
- avoid_damage_blocks?: boolean;
4920
- avoid_portals?: boolean;
4921
- avoid_sun?: boolean;
4922
- avoid_water?: boolean;
4923
- blocks_to_avoid?: string[] | Array<{
4924
- name?: string;
4925
- tags?: string;
4926
- }>;
4927
- can_breach?: boolean;
4928
- can_break_doors?: boolean;
4929
- can_jump?: boolean;
4930
- can_open_doors?: boolean;
4931
- can_open_iron_doors?: boolean;
4932
- can_pass_doors?: boolean;
4933
- can_path_from_air?: boolean;
4934
- can_path_over_lava?: boolean;
4935
- can_path_over_water?: boolean;
4936
- can_sink?: boolean;
4937
- can_swim?: boolean;
4938
- can_walk?: boolean;
4939
- can_walk_in_lava?: boolean;
4940
- is_amphibious?: boolean;
4941
- using_door_annotation?: boolean;
4942
- };
4943
- 'minecraft:navigation.walk'?: {
4944
- avoid_damage_blocks?: boolean;
4945
- avoid_portals?: boolean;
4946
- avoid_sun?: boolean;
4947
- avoid_water?: boolean;
4948
- blocks_to_avoid?: string[] | Array<{
4949
- name?: string;
4950
- tags?: string;
4951
- }>;
4952
- can_breach?: boolean;
4953
- can_break_doors?: boolean;
4954
- can_float?: boolean;
4955
- can_jump?: boolean;
4956
- can_open_doors?: boolean;
4957
- can_open_iron_doors?: boolean;
4958
- can_pass_doors?: boolean;
4959
- can_path_from_air?: boolean;
4960
- can_path_over_lava?: boolean;
4961
- can_path_over_water?: boolean;
4962
- can_sink?: boolean;
4963
- can_swim?: boolean;
4964
- can_walk?: boolean;
4965
- can_walk_in_lava?: boolean;
4966
- is_amphibious?: boolean;
4967
- using_door_annotation?: boolean;
4968
- };
4969
- 'minecraft:preferred_path'?: {
4970
- /** Cost for non-preferred blocks */default_block_cost?: number; /** Added cost for jumping up a node */
4971
- jump_cost?: number; /** Distance mob can fall without taking damage */
4972
- max_fall_blocks?: number; /** A list of block types with their associated pathfinding costs */
4973
- preferred_path_blocks?: Array<{
4974
- /** Array of block identifiers that share this cost value */blocks: string[]; /** The cost value for these blocks during pathfinding. Lower costs make paths more preferred */
4975
- cost: number;
4976
- }>;
4977
- };
4978
- 'minecraft:out_of_control'?: {};
4979
- 'minecraft:peek'?: {
4980
- on_close?: {
4981
- event?: string;
4982
- };
4983
- on_open?: {
4984
- event?: string;
4985
- };
4986
- on_target_open?: {
4987
- event?: string;
4988
- };
4989
- };
4990
- 'minecraft:persistent'?: {};
4991
- 'minecraft:physics'?: {
4992
- has_collision?: boolean;
4993
- has_gravity?: boolean;
4994
- push_towards_closest_space?: boolean;
4995
- };
4996
- 'minecraft:player.exhaustion'?: {
4997
- max?: number;
4998
- value?: number;
4999
- };
5000
- 'minecraft:offspring'?: {
5001
- born_event?: {
5002
- event?: string;
5003
- target?: string;
5004
- };
5005
- breed_event?: {
5006
- event?: string;
5007
- target?: string;
5008
- };
5009
- breed_items?: string[];
5010
- blend_attributes?: boolean;
5011
- cooldown?: number;
5012
- delayed_growth?: boolean;
5013
- deny_parents_baby_variant?: boolean;
5014
- deny_parents_variant?: Array<{
5015
- chance?: number;
5016
- max_variant?: number;
5017
- min_variant?: number;
5018
- }>;
5019
- grow_up_duration?: number;
5020
- inherit_tamed?: boolean;
5021
- initial_variant?: number;
5022
- inheritance_chance?: {
5023
- angry?: number;
5024
- attacker?: number;
5025
- color?: number;
5026
- gene?: number;
5027
- variant?: number;
5028
- };
5029
- mutation_factor?: {
5030
- color?: number;
5031
- gene?: number;
5032
- extra?: number;
5033
- health?: number;
5034
- speed?: number;
5035
- extra_variant?: number;
5036
- variant?: number;
5037
- };
5038
- num_variants?: number;
5039
- offspring_pairs?: Record<string, string>;
5040
- parent_centric_attribute_blending?: {
5041
- attribute?: string;
5042
- dampening?: number;
5043
- };
5044
- property_inheritance?: Record<string, any>;
5045
- random_extra_variant_mutation_interval?: {
5046
- range_max?: number;
5047
- range_min?: number;
5048
- };
5049
- random_variant_mutation_interval?: {
5050
- range_max?: number;
5051
- range_min?: number;
5052
- };
5053
- should_baby_face_parent?: boolean;
5054
- variants?: Record<string | number, number>;
5055
- };
5056
- };
5057
- }
5058
- interface EntityJson extends BaseJson {
5059
- 'minecraft:entity': {
5060
- description: {
5061
- identifier: string;
5062
- is_spawnable?: boolean;
5063
- is_summonable?: boolean;
5064
- };
5065
- components?: EntityComponentOptions['components'];
5066
- component_groups?: Record<string, {}>;
5067
- };
5068
- }
5069
323
  //#endregion
5070
324
  //#region src/mcx-component/vm.d.ts
5071
325
  declare enum execESMMethod {
@@ -5073,16 +327,12 @@ declare enum execESMMethod {
5073
327
  runInVm = 1,
5074
328
  importESM = 2
5075
329
  }
5076
- /**
5077
- * ESM => CJS
5078
- */
5079
- declare function transformESMToCJS(code: string, pluginContext?: Record<string, string | null | boolean | number>, hook?: (data: t.CallExpression | t.MemberExpression, setData?: (newData: t.Expression) => void) => void): string;
5080
330
  declare class RunScript {
5081
331
  filePath: string;
5082
332
  module: 'esm' | 'cjs';
5083
333
  private pluginContext?;
5084
- private _module;
5085
334
  private _context;
335
+ private _module;
5086
336
  private _pluginContext;
5087
337
  constructor(filePath?: string, module?: 'esm' | 'cjs', pluginContext?: Record<string, string | null | boolean | number> | undefined);
5088
338
  /**
@@ -5095,19 +345,53 @@ declare class RunScript {
5095
345
  static isCanUseEsmRunVm: boolean;
5096
346
  }
5097
347
  declare namespace index_d_exports {
5098
- export { BlockComponent, EntityComponent, GIFImageComponent, ItemComponent, JPGImageComponent, PNGImageComponent, RunScript, SVGImageComponent, clearCachedOptions, compileComponent, execESMMethod, execEdit, generateItemTextureJson, resolveFilePoint, transformESMToCJS };
348
+ export { BlockComponent$1 as BlockComponent, EntityComponent$1 as EntityComponent, GIFImageComponent$1 as GIFImageComponent, ItemComponent$1 as ItemComponent, JPGImageComponent$1 as JPGImageComponent, PNGImageComponent$1 as PNGImageComponent, RunScript, SVGImageComponent$1 as SVGImageComponent, clearCachedOptions, compileComponent, execESMMethod, execEdit, generateItemTextureJson, resolveFilePoint, transformESMToCJS };
5099
349
  }
5100
- /** Clear all cached bind options (called between builds) */
350
+ /** Clear all cached bind options (called between builds). */
5101
351
  declare function clearCachedOptions(): void;
5102
- declare function resolveFilePoint(point: FilePoint, ctx: transformCtx): string;
5103
- declare function execEdit(option: BaseJson['_meta']['file_edit'], ctx: transformCtx): Promise<void>;
352
+ /**
353
+ * Resolve a FilePoint to an absolute path on disk.
354
+ *
355
+ * - `base: 'root'` is only allowed when the calling component originates from
356
+ * @mbler/mcx-core (the `sourceIsMcxCore` flag). This prevents third-party
357
+ * components from reading arbitrary filesystem locations.
358
+ * - For `behavior` / `resources`, the file is resolved relative to the
359
+ * corresponding output directory. A path-traversal check ensures the resolved
360
+ * path does not escape the base directory (e.g. via `../`).
361
+ */
362
+ declare function resolveFilePoint(point: FilePoint, ctx: transformCtx, sourceIsMcxCore?: boolean): string;
363
+ /**
364
+ * Execute file_edit operations defined in a component's _meta.
365
+ * Delegates to execEditInternal with a fresh limits counter.
366
+ *
367
+ * @param isMcxCoreSource - when true, the component originates from
368
+ * @mbler/mcx-core and is exempt from file I/O limits and root base
369
+ * restrictions.
370
+ */
371
+ declare function execEdit(option: BaseJson['_meta']['file_edit'], ctx: transformCtx, isMcxCoreSource?: boolean): Promise<void>;
5104
372
  /**
5105
373
  * Generate the final textures/item_texture.json from accumulated bind data.
5106
374
  * Call this in the plugin's buildEnd / onEnd hook.
375
+ * Merges with any existing item_texture.json in the output directory.
5107
376
  */
5108
377
  declare function generateItemTextureJson(output: {
5109
378
  resources: string;
5110
379
  }): Promise<void>;
380
+ /**
381
+ * Compile a single MCX component: parse its source, validate imports, execute
382
+ * the script in a VM, then iterate over each declared component to produce
383
+ * its JSON output file.
384
+ *
385
+ * Security measures applied before VM execution:
386
+ * 1. collectExportSources — maps each import to its source package
387
+ * 2. checkComponentImports — warns on non-mcx-core dependencies
388
+ *
389
+ * Per-component restrictions (checked after VM execution):
390
+ * - path traversal guard on the output file point
391
+ * - root base: only allowed if the export came from @mbler/mcx-core
392
+ * - file write limit (≤5) and read limit (≤1): only enforced for
393
+ * non-mcx-core components
394
+ */
5111
395
  declare function compileComponent(compiledCode: MCXCompileData, ctx: transformCtx): Promise<void>;
5112
396
  //#endregion
5113
397
  //#region src/transforms/index.d.ts