function enchCompat(items: objects) :: objects: loop {_items::*}: set {_return::%loop-index%} to true if loop-value is any armor or any sword: set {_enchs} to 0 if loop-value is enchanted with protection: add 1 to {_enchs} if loop-value is enchanted with projectile protection: add 1 to {_enchs} if loop-value is enchanted with fire protection: add 1 to {_enchs} if loop-value is enchanted with blast protection: add 1 to {_enchs} if loop-value is enchanted with smite: add 1 to {_enchs} if loop-value is enchanted with sharpness: add 1 to {_enchs} if loop-value is enchanted with bane of arthropods: add 1 to {_enchs} if {_enchs} is more than 1: set {_return::%loop-index%} to false if loop-value is any axe, any pickaxe, bow, any sword or any shovel: set {_incompat} to 0 if loop-value is bow: if line 1 of lore of loop-value is "&bArmor Piercing": add 1 to {_incompat} if loop-value is enchanted with sharpness, bane of arthropods, smite, fire aspect or knockback: add 1 to {_incompat} if loop-value is any axe, any pickaxe or any shovel: if loop-value is enchanted with sharpness, bane of arthropods, smite, fire aspect, power, punch or knockback: add 1 to {_incompat} if loop-value is any sword: if loop-value is enchanted with power or punch: add 1 to {_incompat} if {_incompat} is more than 0: set {_return::%loop-index%} to false return {_return::*} on spawn: event-entity is a zombie or a skeleton set {_nbt} to nbt of event-entity if {_nbt} does not contain "IsBaby:1b": wait 1 tick if {exclude::%uuid of event-entity%} is true: stop trigger if event-entity is a skeleton: chance of 10%: if held item of event-entity is air: set held item of event-entity to off hand tool set off hand tool of event-entity to air set line 1 of lore of tool of event-entity to "&bArmor Piercing" if event-entity is a zombie: chance of 3%: apply slowness 2 to event-entity for 999 days apply resistance 1 to event-entity for 999 days apply strength 2 to event-entity for 999 days add "{PersistenceRequired:0b}" to nbt of event-entity chance of 65%: set helmet of event-entity to air set chestplate of event-entity to air set leggings of event-entity to air set boots of event-entity to air set tool of event-entity to air set off hand tool of event-entity to air set {_armor::*} to "leather 12", "chain 8", "gold 5", "iron 2" and "diamond 1" set {_armoren::*} to "unbreaking 1-3", "protection 1-4", "projectile_protection 1-4", "blast_protection 1-4" and "fire_protection 1-4" set {_weapon::*} to "stone 35", "iron 25" and "diamond 1" set {_weapontype::*} to "axe 40", "shovel 40", "pickaxe 40" and "sword 40" if event-entity is a skeleton: add "bow 40" to {_weapontype::*} set {_weaponen::*} to "sharpness 1-5", "bane_of_arthropods 1-5", "smite 1-5", "knockback 1-2", "fire_aspect 1-2" and "unbreaking 1-3" if event-entity is a skeleton: add "power 1-5", "punch 1-2" and "flame 1-1" to {_weaponen::*} loop 5 times: if loop-number is between 1 and 4: delete {_wi} delete {_wenc::*} delete {_chance} loop {_armor::*}: set {_chance::*} to loop-value-2 split at " " set {_chance::2} to {_chance::2} parsed as number if {_incchn} is set: set {_chance} to {_incchn}+{_chance::2} else: set {_chance} to {_chance::2} chance of {_chance}%: set {_wi} to {_chance::1} add 5 to {_incchn} if {_wi} is set: loop {_armoren::*}: set {_enc::*} to loop-value-2 split at " " set {_enclvl::*} to {_enc::2} split at "-" set {_chance} to a random integer between 1 and 50 chance of {_chance}%: set {_enclvl::1} to {_enclvl::1} parsed as integer set {_enclvl::2} to {_enclvl::2} parsed as integer set {_enclvl} to a random integer between {_enclvl::1} and {_enclvl::2} replace all "_" with " " in {_enc::1} set {_enc} to "%{_enc::1}% %{_enclvl}%" add {_enc} to {_wenc::*} if loop-number is 1: set {_wi} to "%{_wi}% helmet" parsed as itemtype if {_wenc::*} is set: loop {_wenc::*}: set {_enc} to loop-value-2 parsed as enchantment type enchant {_wi} with {_enc} set helmet of event-entity to {_wi} if loop-number is 2: set {_wi} to "%{_wi}% chestplate" parsed as itemtype if {_wenc::*} is set: loop {_wenc::*}: set {_enc} to loop-value-2 parsed as enchantment type enchant {_wi} with {_enc} set chestplate of event-entity to {_wi} if loop-number is 3: set {_wi} to "%{_wi}% leggings" parsed as itemtype if {_wenc::*} is set: loop {_wenc::*}: set {_enc} to loop-value-2 parsed as enchantment type enchant {_wi} with {_enc} set leggings of event-entity to {_wi} if loop-number is 4: set {_wi} to "%{_wi}% boots" parsed as itemtype if {_wenc::*} is set: loop {_wenc::*}: set {_enc} to loop-value-2 parsed as enchantment type enchant {_wi} with {_enc} set boots of event-entity to {_wi} if loop-number is 5: delete {_wi} delete {_wenc::*} delete {_witype} loop {_weapon::*}: set {_chance::*} to loop-value-2 split at " " set {_chance::2} to {_chance::2} parsed as number chance of {_chance::2}%: set {_wi} to {_chance::1} loop {_weapontype::*}: set {_chance::*} to loop-value-2 split at " " set {_chance::2} to {_chance::2} parsed as number chance of {_chance::2}%: if {_chance::1} is "bow": set {_wi} to "%{_chance::1}%" parsed as itemtype else: if {_wi} is set: set {_wi} to "%{_wi}% %{_chance::1}%" parsed as itemtype set {_witype} to 100 if {_witype} is 100: loop {_weaponen::*}: set {_enc::*} to loop-value-2 split at " " set {_enclvl::*} to {_enc::2} split at "-" set {_chance} to a random integer between 1 and 50 chance of {_chance}%: set {_enclvl::1} to {_enclvl::1} parsed as integer set {_enclvl::2} to {_enclvl::2} parsed as integer set {_enclvl} to a random integer between {_enclvl::1} and {_enclvl::2} replace all "_" with " " in {_enc::1} set {_enc} to "%{_enc::1}% %{_enclvl}%" add {_enc} to {_wenc::*} if {_wenc::*} is set: loop {_wenc::*}: set {_enc} to loop-value-2 parsed as enchantment type enchant {_wi} with {_enc} set tool of event-entity to air set off hand tool of event-entity to air set tool of event-entity to {_wi} if event-entity is a skeleton: if tool of event-entity is air: set tool of event-entity to a bow add "{PersistenceRequired:0b}" to nbt of event-entity on death of zombie or skeleton: set {_drops::*} to drops if {_drops::*} is set: set {_return::*} to enchCompat({_drops::*}) loop {_drops::*}: loop {_return::*}: if loop-index-1 is loop-index-2: if loop-value-2 is false: remove loop-value-1 from drops else: clear drops of items