const ITEM_BLACK_LIST = [
	'alexsmobs:flying_fish_boots',
	'ars_nouveau:caster_tome',
	'tombstone:scroll_of_knowledge',
	'kubejs:unlock_nether',
	'kubejs:unlock_end',
	'kubejs:unlock_twilight',
	'kubejs:unlock_bumblezone',
	'kubejs:unlock_alfheim',
	'born_in_chaos_v1:dark_metal_armor_helmet',
	'born_in_chaos_v1:dark_metal_armor_chestplate',
	'born_in_chaos_v1:dark_metal_armor_leggings',
	'born_in_chaos_v1:dark_metal_armor_boots',
	'born_in_chaos_v1:dark_ritual_dagger',
	'born_in_chaos_v1:skullbreaker_hammer',
	'born_in_chaos_v1:soul_cutlass',
	'born_in_chaos_v1:great_reaper_axe',
	'born_in_chaos_v1:death_totem',
	'born_in_chaos_v1:nightmare_scythe',
    'adpother:sulphur',
    'adpother:dust',
    'adpother:carbon',
    'adpother:ammiac',
    'adpother:botulotoxin',
    'adpother:phosgen',
    'waystones:mossy_waystone',
    'waystones:sandy_waystone',
    'create_sa:copper_magnet'
 ];
 
onEvent('recipes', event => {
	for (var item of ITEM_BLACK_LIST) {
		event.remove({output: item})
	}
})

function arrayContains (thing,array){
    for(var a of array){
      if (a==thing) return true;
   }
    return false;
};
function notifyPlayer(player) {
	player.tell("§7Удалён запрещённый предмет.");
}
global.blackListCheck = function(itemToTest, event, player) {
    if (itemToTest) {
        var id = itemToTest.id.toString();
        if (arrayContains(id, ITEM_BLACK_LIST)) {
			if (event.player.name.string == "Proxwian") return;
            //notifyPlayer(event.player);
            itemToTest.count = 0;
            event.cancel();
        }
    }
};

onEvent("item.right_click", event => {
    global.blackListCheck(event.item, event, event.player);
});
onEvent("item.left_click", event => {
    global.blackListCheck(event.item, event, event.player);
});
onEvent("item.crafted", event => {
    global.blackListCheck(event.item, event, event.player);
});
onEvent("item.smelted", event => {
    global.blackListCheck(event.item, event, event.player);
});
onEvent("item.entity_interact", event => {
    global.blackListCheck(event.item, event, event.player);
});
onEvent("block.place", event => {
    global.blackListCheck(event.item, event, event.player);
});
onEvent("block.left_click", event => {
    global.blackListCheck(event.item, event, event.player);
});
onEvent("block.right_click", event => {
    global.blackListCheck(event.item, event, event.player);
});