import { world } from '@minecraft/server'

//Breaking stone variants and non-stone variantes trigger events
const StoneBlocks = {
	//has a 1/10 chance to summon a silverfish after a player breaks cobble
	"minecraft:cobblestone": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon silverfish')
		}
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 15; i++) {
				player.runCommandAsync('summon silverfish')
			}
		}
	},
	"minecraft:mossy_cobblestone": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon silverfish')
		}
	},
	"minecraft:deepslate": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon silverfish')
		}
	},
	"minecraft:stonebrick": function (player) {
		if (Math.round(Math.random() * 2) == 1) {
			player.runCommandAsync('summon silverfish')
		}
	},
	"minecraft:tall_grass": function (player) {
		if (Math.round(Math.random() * 5) == 1) {
			player.runCommandAsync('summon warden ^ ^ ^1 ~ ~ minecraft:spawn_emerging')
		}
	},
	"minecraft:short_grass": function (player) {
		if (Math.round(Math.random() * 5) == 1) {
			player.runCommandAsync('summon warden ^ ^ ^1 ~ ~ minecraft:spawn_emerging')
		}
	},
	"minecraft:gravel": function (player) {
		if (Math.round(Math.random() * 5) == 1) {
			player.runCommandAsync('setblock ~~~ end_portal')
		}
	},
	"minecraft:cactus": function (player) {
		if (Math.round(Math.random() * 5) == 1) {
			player.runCommandAsync('setblock ~~~ end_portal')
		}
	},
	"minecraft:oak_log": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon warden ~ ~ ~ ~ ~ minecraft:spawn_emerging')
		}
	},
	"minecraft:sand": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p diamond')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p totem_of_undying')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p saddle')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p tnt')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p flint_and_steel')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p diamond_block')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p gold_block')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p dirt')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p soul_sand')
		}
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 30; i++) {
				player.runCommandAsync('summon vex')
			}
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon lightning_bolt')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon npc')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon ghast')
		}
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 5; i++) {
				player.runCommandAsync('summon bee')
			}
		}
		player.runCommandAsync('playanimation @e [type = bee] animation.ghast.scale a 600')
		player.runCommandAsync('playanimation @e [type = ghast] animation.ghast.scale a 600')
		player.runCommandAsync('playanimation @e [type = npc] animation.ghast.scale a 600')
	},
	"minecraft:sandstone": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon creeper')
			player.runCommandAsync('summon lightning_bolt')
		}
	},
	"minecraft:chiseled_sandstone": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon creeper')
			player.runCommandAsync('summon lightning_bolt')
		}
	},
	"minecraft:cut_sandstone": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon creeper')
			player.runCommandAsync('summon lightning_bolt')
		}
	},
	"minecraft:smooth_sandstone": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon creeper')
			player.runCommandAsync('summon lightning_bolt')
		}
	},
	"minecraft:rose_bush": function (player) {
		if (Math.round(Math.random() * 3) == 1) {
			player.runCommandAsync('summon ravager')
		}
	},
	"minecraft:iron_bars": function (player) {
		if (Math.round(Math.random() * 6) == 1) {
			player.dimension.spawnEntity("minecraft:tnt", player.location)
			player.dimension.spawnEntity("minecraft:tnt", player.location)
			player.dimension.spawnEntity("minecraft:tnt", player.location)
		}
	},
	"minecraft:emerald_block": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 5; i++) {
				player.runCommandAsync('summon evocation_illager')
			}
		}
	},
	"minecraft:red_sandstone": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('summon creeper')
			}
			player.runCommandAsync('summon lightning_bolt')
		}
	},
	"minecraft:chiseled_red_sandstone": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('summon creeper')
			}
			player.runCommandAsync('summon lightning_bolt')
		}
	},
	"minecraft:cut_red_sandstone": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('summon creeper')
			}
			player.runCommandAsync('summon lightning_bolt')
		}
	},
	"minecraft:smooth_red_sandstone": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('summon creeper')
			}
			player.runCommandAsync('summon lightning_bolt')
		}
	},
	"minecraft:deadbush": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('summon husk')
			}
		}
	},
	"minecraft:birch_log": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p diamond')
		}
		if (Math.round(Math.random() * 30) == 1) {
			player.runCommandAsync('give @p totem_of_undying')
		}
		if (Math.round(Math.random() * 20) == 1) {
			player.runCommandAsync('give @p saddle')
		}
		if (Math.round(Math.random() * 20) == 1) {
			player.runCommandAsync('give @p tnt')
		}
		if (Math.round(Math.random() * 20) == 1) {
			player.runCommandAsync('give @p flint_and_steel')
		}
		if (Math.round(Math.random() * 30) == 1) {
			player.runCommandAsync('give @p diamond_block')
		}
		if (Math.round(Math.random() * 20) == 1) {
			player.runCommandAsync('give @p gold_block')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p dirt')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p soul_sand')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p wheat_seeds')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p apple')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p beetroot')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p carrot')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p potato')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p bread')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p cookie')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p glow_berries')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon wandering_trader')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon witch')
		}
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 30; i++) {
				player.runCommandAsync('summon vex')
			}
		}
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 30; i++) {
				player.runCommandAsync('summon silverfish')
			}
		}
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 30; i++) {
				player.runCommandAsync('summon warden ~ ~ ~ ~ ~ minecraft:spawn_emerging')
			}
		}
	},
	"minecraft:acacia_log": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon wandering_trader')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon villager')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon creeper')
		}
	},
	"minecraft:cherry_log": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p cherry_leaves')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p bee_nest')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p beehive')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p oak_leaves')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p azalea_leaves')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p azalea_leaves_flowered')
		}
		if (Math.round(Math.random() * 20) == 1) {
			player.runCommandAsync('summon wither')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('effect @p instant_damage 1 2 true')
		}
	},
	"minecraft:jungle_log": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('setblock ~~~ portal')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('setblock ~~~ end_portal')
		}
		if (Math.round(Math.random() * 5) == 1) {
			player.runCommandAsync('give @p cocoa_beans')
		}
		if (Math.round(Math.random() * 5) == 1) {
			player.runCommandAsync('give @p mossy_cobblestone')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p cobblestone')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p stone')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('give @p dispenser')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p gunpowder')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p string')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p redstone')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('give @p tripwire_hook')
		}
	},
	"minecraft:mangrove_log": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon frog')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p rotten_flesh')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p poisonous_potato')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('effect @p fatal_poison 10 255 true')
		}
	},
	"minecraft:dark_oak_log": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon evocation_illager')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon pillager')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon vindicator')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon evocation_fang')
		}
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 5; i++) {
				player.runCommandAsync('summon evocation_fang')
			}
		}
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 5; i++) {
				player.runCommandAsync('summon vex')
			}
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon ravager')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon witch')
		}
	},
	"minecraft:spruce_log": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon evocation_illager')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon pillager')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon vindicator')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon evocation_fang')
		}
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 5; i++) {
				player.runCommandAsync('summon evocation_fang')
			}
		}
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 5; i++) {
				player.runCommandAsync('summon vex')
			}
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon ravager')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon witch')
		}
	},
	//guaranteed to summon 10 vexes after a player breaks lodestone
	"minecraft:lodestone": function (player) {
		for (let i = 0; i < 10; i++) {
			player.runCommandAsync('summon vex')
		}
	},
	//has a 1/10 chance to summon 3 vexes after a player breaks stone
	"minecraft:stone": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 3; i++) {
				player.runCommandAsync('summon vex')
			}
		}
	},
	"minecraft:snow": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('setblock ~ ~ ~ minecraft:soul_sand')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('setblock ~ ~ ~ minecraft:deadbush')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('setblock ~ ~ ~ minecraft:copper_block')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('setblock ~ ~ ~ minecraft:glowstone')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('setblock ~ ~ ~ minecraft:lodestone')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('setblock ~ ~ ~ minecraft:magma')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('setblock ~ ~ ~ minecraft:purpur_block')
		}
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 3; i++) {
				player.runCommandAsync('summon chicken')
			}
		}
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 5; i++) {
				player.runCommandAsync('summon parrot')
			}
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('summon armadillo')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('summon glow_squid')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('summon allay')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('summon villager')
		}
		player.runCommandAsync('playanimation @e [type = chicken] animation.ghast.scale a 600')
		player.runCommandAsync('playanimation @e [type = parrot] animation.ghast.scale a 3600')
		player.runCommandAsync('playanimation @e [type = armadillo] animation.ghast.scale a 3600')
		player.runCommandAsync('playanimation @e [type = glow_squid] animation.ghast.scale a 600')
		player.runCommandAsync('playanimation @e [type = allay] animation.ghast.scale a 3600')
		player.runCommandAsync('playanimation @e [type = villager] animation.ghast.scale a 3600')
	},
	"minecraft:sculk_sensor": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 3; i++) {
				player.runCommandAsync('summon tnt')
			}
		}
	},
	"minecraft:sculk_shrieker": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon skeleton')
		}
	},
	"minecraft:copper_block": function (player) {
		if (Math.round(Math.random() * 5) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('summon zombie')
			}
		}
	},
	"minecraft:oxidized_copper": function (player) {
		if (Math.round(Math.random() * 5) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('summon vex')
			}
		}
	},
	"minecraft:waxed_weathered_copper": function (player) {
		if (Math.round(Math.random() * 3) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('summon blaze')
			}
		}
	},
	"minecraft:glowstone": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon ghast')
		}
	},
	"minecraft:basalt": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon shulker')
		}
	},
	"minecraft:polished_basalt": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon shulker')
		}
	},
	"minecraft:soul_sand": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('summon wither')
		}
	},
	"minecraft:soul_soil": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('summon wither')
		}
	},
	"minecraft:blackstone": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 3; i++) {
				player.runCommandAsync('summon vex')
			}
		}
	},
	"minecraft:blackstone_stairs": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 3; i++) {
				player.runCommandAsync('summon vex')
			}
		}
	},
	"minecraft:blackstone_slab": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 3; i++) {
				player.runCommandAsync('summon vex')
			}
		}
	},
	"minecraft:gilded_blackstone": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 3; i++) {
				player.runCommandAsync('summon vex')
			}
		}
	},
	"minecraft:chiseled_polished_blackstone": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 3; i++) {
				player.runCommandAsync('summon vex')
			}
		}
	},
	"minecraft:cracked_polished_blackstone_bricks": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 3; i++) {
				player.runCommandAsync('summon vex')
			}
		}
	},
	"minecraft:polished_blackstone": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 3; i++) {
				player.runCommandAsync('summon vex')
			}
		}
	},
	"minecraft:polished_blackstone_brick_slab": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 3; i++) {
				player.runCommandAsync('summon vex')
			}
		}
	},
	"minecraft:polished_blackstone_brick_stairs": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 3; i++) {
				player.runCommandAsync('summon vex')
			}
		}
	},
	"minecraft:magma": function (player) {
		if (Math.round(Math.random() * 5) == 1) {
			player.runCommandAsync('fill ~ ~ ~ ~9 ~9 ~9 red_sandstone hollow')
		}
	},
	"minecraft:netherrack": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('setblock ~ ~ ~ minecraft:bed')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('summon ravager')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('fill ~ ~ ~ ~30 ~-30 ~30 air')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('summon omni_science:giant_pufferfish')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('summon guardian')
		}
	},
	"minecraft:crimson_nylium": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('summon tnt')
			}
		}
		if (Math.round(Math.random() * 6) == 1) {
			player.runCommandAsync('time set day')
		}
		if (Math.round(Math.random() * 6) == 1) {
			player.runCommandAsync('time set night')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p cooked_beef')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('summon npc')
		}
	},
	"minecraft:warped_nylium": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('summon tnt')
			}
		}
		if (Math.round(Math.random() * 5) == 1) {
			player.runCommandAsync('time set night')
		}
		if (Math.round(Math.random() * 5) == 1) {
			player.runCommandAsync('time set day')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p ender_pearl')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('summon npc')
		}
	},
	"minecraft:nether_brick": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 5; i++) {
				player.runCommandAsync('summon breeze')
			}
		}
	},
	"minecraft:red_nether_brick": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 5; i++) {
				player.runCommandAsync('summon evocation_illager')
			}
		}
	},
	"minecraft:warped_stem": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon frog')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon bee')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon warden ~ ~ ~ ~ ~ minecraft:spawn_emerging')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon breeze')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon blaze')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon npc')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p lodestone 2')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('give @p tnt 2')
		}
	},
	"minecraft:crimson_stem": function (player) {
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 30; i++) {
				player.runCommandAsync('summon evoker_fang')
			}
		}
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('summon tnt')
			}
		}
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('summon silverfish')
			}
		}
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('summon vex')
			}
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('summon shulker')
		}
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('setblock ~~~ bed')
			}
		}
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('setblock ~~~ respawn_anchor')
			}
		}
		if (Math.round(Math.random() * 15) == 1) {
			for (let i = 0; i < 10; i++) {
				player.runCommandAsync('setblock ~~~ end_portal')
			}
		}
	},
	"minecraft:grass_block": function (player) {
		if (Math.round(Math.random() * 20) == 1) {
			player.runCommandAsync('summon ender_dragon')
		}
	},
	"minecraft:dirt": function (player) {
		if (Math.round(Math.random() * 20) == 1) {
			player.runCommandAsync('summon ender_dragon')
		}
	},
	"minecraft:end_stone": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon tnt')
		}
		if (Math.round(Math.random() * 15) == 1) {
			player.runCommandAsync('fill ~ ~ ~ ~30 ~-30 ~30 air')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('summon frog')
		}
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 5; i++) {
				player.runCommandAsync('summon bee')
			}
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('playanimation @p animation.armor_stand.riposte_pose a 600')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('playanimation @p animation.chicken.general.v1.0 a 600')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('playanimation @p animation.piglin.celebrate_hunt_special a 600')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('playanimation @p animation.humanoid.sneaking.v1.0 a 600')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('playanimation @p animation.bat.flying a 600')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('playanimation @p animation.wolf.sitting a 600')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('playanimation @p animation.creeper.swelling a 600')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('playanimation @p animation.ghast.scale a 600')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('playanimation @e animation.ghast.scale a 600')
			player.runCommandAsync('playanimation @e [type = ender_dragon] animation.ghast.scale a 60')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('playanimation @p animation.hoglin.baby_scaling a 600')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('playanimation @p animation.player.sleeping a 600')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('playanimation @p animation.player.base_pose.upside_down a 600')
		}
		if (Math.round(Math.random() * 10) == 1) {
			player.runCommandAsync('playanimation @p animation.chicken.baby_transform a 600')
		}
		player.runCommandAsync('playanimation @e [type = bee] animation.ghast.scale a 600')
		player.runCommandAsync('playanimation @e [type = frog] animation.ghast.scale a 600')
	},
	"minecraft:purpur_block": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 5; i++) {
				player.runCommandAsync('summon lightning_bolt')
			}
		}
	},
	"minecraft:purpur_stairs": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 5; i++) {
				player.runCommandAsync('summon lightning_bolt')
			}
		}
	},
	"minecraft:stone_slab2": function (player) {
		if (Math.round(Math.random() * 10) == 1) {
			for (let i = 0; i < 5; i++) {
				player.runCommandAsync('summon lightning_bolt')
			}
		}
	}
}

world.afterEvents.playerBreakBlock.subscribe(event => {
	try {
		let BrokeBlock = event.block
		let player = event.player
		StoneBlocks[BrokeBlock.typeId](player)
	} catch { }
})