// priority: 0

console.info('Hello, World! (You will only see this line once in console, during startup)')

/* onEvent('item.registry', event => {
	// Register new items here
	// event.create('example_item').displayName('Example Item')
	event.create('assault_crate').food(food => {
	food
	    .hunger(0)
	    .saturation(0)
	    .alwaysEdible()
	    .fastToEat()
	    .eaten(ctx => {
	        // ctx.player.tell('yea')) test to see if it works
	        let itemList = ['tac:ak47', 'tac:m4', 'tac:dp28', 'tac:vector45', 'tac:micro_uzi', 'tac:qbz_95', 'tac:hk_mp5a5', 'tac:hk416_a5', 'tac:type81_x', 'tac:mp7', 'tac:fn_fal', 'tac:sks_tactical', 'tac:m16a4', 'tac:scar_h', 'tac:scar_l', 'tac:mk47', 'tac:spr15', 'tac:mk18_mod1']
            const randomIndex = Math.floor(Math.random() * itemList.length);
            const assaultLoot = itemList[randomIndex];
            ctx.player.give(assaultLoot);

	    })
	}).displayName('Assault Crate').tooltip("gives you a random assault rifle").glow(true)
})

onEvent('item.registry', event => {
	event.create('attachment_crate').food(food => {
	food
	    .hunger(0)
	    .saturation(0)
	    .alwaysEdible()
	    .fastToEat()
	    .eaten(ctx => {
	        // ctx.player.tell('yea')) test to see if it works
	        let itemList = ['tac:coyote_sight', 'tac:aimpoint_t1', 'tac:aimpoint_t2', 'tac:eotech_n', 'tac:vortex_uh_1', 'tac:eotech_short', 'tac:srs_red_dot', 'tac:acog_4x_scope', 'tac:qmk152', 'tac:elcan_14x', 'tac:lpvo_1_6', 'tac:8x_scope', 'tac:old_8x_scope', 'tac:old_4x_scope', 'tac:mini_dot', 'tac:sro_dot', 'tac:silencer', 'tac:muzzle_brake', 'tac:muzzle_compensator', 'tac:pistol_silencer', 'tac:light_stock', 'tac:tactical_stock', 'tac:weighted_stock', 'tac:light_grip', 'tac:specialised_grip']
            const randomIndex = Math.floor(Math.random() * itemList.length);
            const attachmentLoot = itemList[randomIndex];
            ctx.player.give(attachmentLoot);

	    })
	}).displayName('Attachment Crate').tooltip("gives you a random attachment").glow(true)
})

onEvent('item.registry', event => {
	event.create('shotgun_crate').food(food => {
	food
	    .hunger(0)
	    .saturation(0)
	    .alwaysEdible()
	    .fastToEat()
	    .eaten(ctx => {
	        // ctx.player.tell('yea')) test to see if it works
	        let itemList = ['tac:db_short', 'tac:m870_classic', 'tac:m1014', 'tac:aa_12']
	        const randomIndex = Math.floor(Math.random() * itemList.length);
            const shotgunLoot = itemList[randomIndex];
            ctx.player.give(shotgunLoot);

	    })
	}).displayName('Shotgun Crate').tooltip("gives you a random shotgun").glow(true)
})

onEvent('item.registry', event => {
	event.create('lmg_crate').food(food => {
	food
	    .hunger(0)
	    .saturation(0)
	    .alwaysEdible()
	    .fastToEat()
	    .eaten(ctx => {
	        // ctx.player.tell('yea')) test to see if it works
	        let itemList = ['tac:m60', 'tac:rpk']
	        const randomIndex = Math.floor(Math.random() * itemList.length);
            const lmgLoot = itemList[randomIndex];
            ctx.player.give(lmgLoot);

	    })
	}).displayName('LMG Crate').tooltip("gives you a random lmg").glow(true)
})

onEvent('item.registry', event => {
	event.create('tier5_crate').food(food => {
	food
	    .hunger(0)
	    .saturation(0)
	    .alwaysEdible()
	    .fastToEat()
	    .eaten(ctx => {
	        // ctx.player.tell('yea')) test to see if it works
	        let itemList = ['minecraft:enchanted_golden_apple', 'minecraft:totem_of_undying']
	        const randomIndex = Math.floor(Math.random() * itemList.length);
            const tier5Loot = itemList[randomIndex];
            ctx.player.give(tier5Loot);

	    })
	}).displayName('Tier 5 Crate').tooltip("pog").glow(true)
}) */

/* onEvent('item.registry', event => {
event.create('overworld_ticket').displayName('Overworld Ticket').tooltip("use in keygen to make an overworld dungeon key")
}) */

onEvent('item.registry', event => {
	event.create('compound_methamphetamine').food(food => {
	food
	    .hunger(0)
	    .saturation(0)
		.effect('speed', 12000, 0, 1)
		.removeEffect('nausea')
		.removeEffect('slowness')
		.removeEffect('mining_fatigue')
		.removeEffect('hunger')
	    .alwaysEdible()
	    .eaten(ctx => {
	        })
	}).displayName('Methamphetamine')
})

onEvent('item.registry', event => {
	event.create('compound_mdma').food(food => {
	food
	    .hunger(0)
	    .saturation(0)
		.effect('speed', 6000, 0, 1)
		.removeEffect('nausea')
	    .alwaysEdible()
	    .eaten(ctx => {
	        })
	}).displayName('3,4-Methylenedioxymethamphetamine')
})

onEvent('item.registry', event => {
	event.create('compound_amphetamine').food(food => {
	food
	    .hunger(0)
	    .saturation(0)
		.effect('speed', 6000, 0, 1)
		.removeEffect('nausea')
	    .alwaysEdible()
	    .eaten(ctx => {
	        })
	}).displayName('Amphetamine')
})

onEvent('item.registry', event => {
	event.create('compound_morphine').food(food => {
	food
	    .hunger(0)
	    .saturation(0)
		.effect('speed', 6000, 0, 1)
		.removeEffect('nausea')
	    .alwaysEdible()
	    .eaten(ctx => {
	        })
	}).displayName('Morphine')
})

onEvent('item.registry', event => {
	event.create('compound_tetrahydrocannabinol').food(food => {
	food
	    .hunger(0)
	    .saturation(0)
		.effect('speed', 6000, 0, 1)
		.removeEffect('nausea')
	    .alwaysEdible()
	    .eaten(ctx => {
	        })
	}).displayName('Tetrahydrocannabinol')
})


onEvent('item.tooltip', tooltip => {
	// Add tooltip to all of these items
	tooltip.addAdvanced('kubejs:compound_methamphetamine', (item, advanced, text) => {
		text.add(1, Text.of('\u00A73' + 'C\u2081\u2080H\u2081\u2085N'))
		text.add(2, Text.of('Has an effect when consumed'))
	  })
})

onEvent('item.tooltip', tooltip => {
	tooltip.addAdvanced('kubejs:compound_mdma', (item, advanced, text) => {
		text.add(1, Text.of('\u00A73' + 'C\u2081\u2081H\u2081\u2085NO\u2082'))
		text.add(2, Text.of('Has an effect when consumed'))
	  })
})

onEvent('item.tooltip', tooltip => {
	tooltip.addAdvanced('kubejs:compound_amphetamine', (item, advanced, text) => {
		text.add(1, Text.of('\u00A73' + 'C\u2089H\u2081\u2083N'))
		text.add(2, Text.of('Has an effect when consumed'))
	  })
})

onEvent('item.tooltip', tooltip => {
	tooltip.addAdvanced('kubejs:compound_morphine', (item, advanced, text) => {
		text.add(1, Text.of('\u00A73' + 'C\u2081\u2087H\u2081\u2089NO\u2083'))
		text.add(2, Text.of('Has an effect when consumed'))
	  })
})

onEvent('item.tooltip', tooltip => {
	tooltip.addAdvanced('kubejs:compound_tetrahydrocannabinol', (item, advanced, text) => {
		text.add(1, Text.of('\u00A73' + 'C\u2082\u2081H\u2083\u2080O\u2082'))
		text.add(2, Text.of('Has an effect when consumed'))
	  })
})

onEvent('item.tooltip', tooltip => {
	tooltip.add(['mmorpg:potions/add_reset_perk_points'], 'This will not work - Use the full Talent Reset potion instead.')
})




onEvent('block.registry', event => {
	// Register new blocks here
	// event.create('example_block').material('wood').hardness(1.0).displayName('Example Block')
})