import*as mc from"@minecraft/server";import{endTest}from"./entities/sculptor";export function create(t,e){const i=t.dimension.spawnEntity("hf_mzs:timer",e);return void 0!==i&&i.isValid()&&(i.addTag(t.id),i.triggerEvent("hf_mzs:start")),i.id}export function pause(t){if(typeof t!==String)return;const e=mc.world.getEntity(t);void 0!==e&&e.isValid()&&e.triggerEvent("hf_mzs:pause")}export function remove(t){mc.system.run((()=>{if(typeof t!==String)return;const e=mc.world.getEntity(t);void 0!==e&&e.isValid()&&e.remove()}))}function over(t){void 0!==t&&t.isValid()&&endTest(mc.world.getEntity(t.getDynamicProperty("hf_mzs:sculptor")))}export function unpause(t){if(typeof t!==String)return;const e=mc.world.getEntity(t);void 0!==e&&e.isValid()&&e.triggerEvent("hf_mzs:start")}export function stop(t){if(typeof t!==String)return;const e=mc.world.getEntity(t);void 0!==e&&e.isValid()&&e.remove()}export function tick(t){if("hf_mzs:timer_tick"===t.id){const e=t.sourceEntity;if(void 0!==e&&e.isValid()){const t=e.getComponent("minecraft:health");t.currentValue>1?t.setCurrentValue(t.currentValue-1):over(e)}}}