import { system, world } from "@minecraft/server";


// Area shield resistance 
world.afterEvents.itemStartUse.subscribe( async (event) => {
	const { itemStack, source } = event;
	const player = source;
	const item = itemStack.typeId;

	
	if (item == "oct_plev:big_shield") {
		let usingbig_shield = system.runInterval(() => {
			player.runCommand("/effect @a[r=8] resistance 2 1 true");
			player.runCommand("/effect @a[r=8] resistance 2 10 true");
		}, 1)

		world.afterEvents.itemStopUse.subscribe( async () => {
			system.clearRun(usingbig_shield)
		});
	}
});