Sneaking_Event: type: world debug: false events: on player starts sneaking: - run SneakCheck id:SneakCheck_ on player stops sneaking: - queue 'q@SneakCheck_' clear - actionbar "" on player walks: - if ! { - foreach { - look - actionbar target: "" } } SneakCheck: type: task debug: false script: - while true { - ^define npcs - if { - ^actionbar target: "Detected" - ^look - wait 5t - ^while next } - if ].degrees[45]].filter[eye_location.line_of_sight[]].size> > 0 { - ^flag DetectedBy:->: duration:10s - wait 5t - ^while next } - foreach { - if |]>||||]>].mul[0.025]> > { - ^narrate " detected you by algorithm" - ^flag DetectedBy:->: duration:10s - wait 5t - ^while next } } - actionbar target: "Hidden" - wait 5t } HiddenSneakChance: type: procedure definitions: light|armor|npcSkill|playerSkill|itemBonus|distance debug: false script: - define exponent ]>].add[]>].add[]>].sub[]>].sub[]>].sub[]>]> - define algorithm ]> - determine ]> ArmorWeight: type: procedure definitions: player debug: false script: - define result 0.0 - if contains "iron" || contains "diamond" { - define result } - if contains "iron" || contains "diamond" { - define result } - if contains "iron" || contains "diamond" { - define result } - if contains "iron" || contains "diamond" { - define result } - determine SneakBonus: type: procedure definitions: player debug: false script: - determine 50