//this code has been abandoned, go to infernal_tools folder for the new ones

import { system, world, Entity, Player } from '@minecraft/server'

world.afterEvents.entityHitEntity.subscribe(({ damagingEntity: player, hitEntity }) => {
	let event = event.damagingEntity;
	const player = event.damagingEntity
	if (damagingEntity.typeId !== 'minecraft:player') return;
	const item = player.getComponent('inventory').container.getItem(player.selectedSlot);
	if (item?.typeId.match(/redstone:infernal_sword|redstone:infernal_axe|redstone:infernal_pickaxe|redstone:infernal_scythe/)) {
		const entity = event.hitEntity
		entity.setOnFire(10, true);
	}
})