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

world.afterEvents.entityHitEntity.subscribe((event) => {
	let damagingEntity = event.damagingEntity;
	const player = event.damagingEntity
	if ((damagingEntity.typeId == 'minecraft:player' && damagingEntity.getComponent('inventory').container.getItem(player.selectedSlot).typeId == 'redstone:bane_of_embers') == true) {
		const entity = event.hitEntity;
		entity.setOnFire(48, true)
	}
})