Spawnprotection: type: world debug: false events: on back command: - run s@SpawnProtectionInvincible as: on player damaged: - if == true { - determine CANCELLED } on entity damages player: - if == true { - determine CANCELLED } on player damages entity: - if == true { - determine CANCELLED } on npc damages player: - if == true { - announce "Succeed" - determine cancelled } on player damages player: - if == true { - determine CANCELLED } SpawnProtectionInvincible: type: task debug: false script: - flag SpawnProtection:true - narrate "" - narrate "You have 10 seconds spawn protection" - narrate "" - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - playeffect effect:ENCHANTMENT_TABLE qty:100 - wait 0.5 - narrate "Spawn protection ended." - flag SpawnProtection:null