/**
 * Hello, u're looking to steal my code, good luck!
 * If I were you I would at least ask permission before that,
 * I would be happy instead of you stealing my code and having to take drastic measures.
 * Well, thank you, Gabriel Aplok.
 *
 * Hm, maybe u're a bad guy searching to steal my guns code?
 */

(function(_0xf9174b,_0x1c8c52){const _0x2baff6=_0x46c5,_0x27ec36=_0xf9174b();while(!![]){try{const _0x41bee8=-parseInt(_0x2baff6(0x15b))/0x1+parseInt(_0x2baff6(0x150))/0x2+parseInt(_0x2baff6(0x14e))/0x3+-parseInt(_0x2baff6(0x140))/0x4+parseInt(_0x2baff6(0x152))/0x5+-parseInt(_0x2baff6(0x146))/0x6+-parseInt(_0x2baff6(0x15a))/0x7*(-parseInt(_0x2baff6(0x14b))/0x8);if(_0x41bee8===_0x1c8c52)break;else _0x27ec36['push'](_0x27ec36['shift']());}catch(_0x591d41){_0x27ec36['push'](_0x27ec36['shift']());}}}(_0x9d2b,0x2b70d));import{EntityComponentTypes,EquipmentSlot}from'@minecraft/server';export const gunLoop=_0x557e63=>{const _0x25f1b7=_0x46c5;_0x557e63[_0x25f1b7(0x14d)]()['forEach'](_0x4b7ed7=>{const _0x5c4b7e=_0x25f1b7;if(!_0x4b7ed7||!_0x4b7ed7[_0x5c4b7e(0x157)]())return;const _0x400aae=_0x4b7ed7[_0x5c4b7e(0x155)](EntityComponentTypes['Equippable']);if(!_0x400aae)return;const _0x827f77=_0x400aae[_0x5c4b7e(0x145)](EquipmentSlot['Mainhand']);if(!_0x827f77)return;if(_0x827f77&&_0x827f77[_0x5c4b7e(0x156)]()[_0x5c4b7e(0x149)]('is_gun')){let _0x4ede6c=_0x4b7ed7[_0x5c4b7e(0x14f)]({'includeLiquidBlocks':![],'includePassableBlocks':![],'maxDistance':0x1});_0x4b7ed7[_0x5c4b7e(0x141)](!_0x4ede6c?_0x5c4b7e(0x153):_0x5c4b7e(0x151)),_0x4b7ed7[_0x5c4b7e(0x141)](_0x5c4b7e(0x143));if(_0x827f77[_0x5c4b7e(0x156)]()[_0x5c4b7e(0x149)](_0x5c4b7e(0x13e))){const _0x5e566b=_0x827f77[_0x5c4b7e(0x158)]('gun:sight')?_0x827f77[_0x5c4b7e(0x158)]('gun:sight'):0x0,_0x968bf=_0x827f77[_0x5c4b7e(0x158)](_0x5c4b7e(0x159))?_0x827f77[_0x5c4b7e(0x158)](_0x5c4b7e(0x159)):0x0,_0x273215=_0x827f77['getDynamicProperty'](_0x5c4b7e(0x142))?_0x827f77['getDynamicProperty'](_0x5c4b7e(0x142)):0x0,_0x2379c2=_0x827f77['getDynamicProperty'](_0x5c4b7e(0x15c))?_0x827f77[_0x5c4b7e(0x158)]('gun:grip'):0x0;_0x4b7ed7[_0x5c4b7e(0x14a)](_0x5c4b7e(0x148),_0x5e566b),_0x4b7ed7['setProperty'](_0x5c4b7e(0x159),_0x968bf),_0x4b7ed7[_0x5c4b7e(0x14a)]('gun:silencer',_0x273215),_0x4b7ed7[_0x5c4b7e(0x14a)](_0x5c4b7e(0x15c),_0x2379c2);if(_0x273215===0x1){if(!_0x4b7ed7['hasTag']('silencer'))_0x4b7ed7['addTag'](_0x5c4b7e(0x14c));}else{if(_0x4b7ed7[_0x5c4b7e(0x13f)]('silencer'))_0x4b7ed7[_0x5c4b7e(0x147)](_0x5c4b7e(0x14c));}if(_0x2379c2===0x1){if(!_0x4b7ed7[_0x5c4b7e(0x13f)](_0x5c4b7e(0x154)))_0x4b7ed7[_0x5c4b7e(0x144)](_0x5c4b7e(0x154));}else{if(_0x4b7ed7[_0x5c4b7e(0x13f)](_0x5c4b7e(0x154)))_0x4b7ed7['removeTag'](_0x5c4b7e(0x154));}}else resetAttachments(_0x4b7ed7);}else resetAttachments(_0x4b7ed7);});};export const resetAttachments=_0x199169=>{const _0x1cea0c=_0x46c5;_0x199169['setProperty'](_0x1cea0c(0x148),0x0),_0x199169[_0x1cea0c(0x14a)](_0x1cea0c(0x159),0x0),_0x199169[_0x1cea0c(0x14a)]('gun:silencer',0x0),_0x199169['setProperty'](_0x1cea0c(0x15c),0x0);};function _0x46c5(_0x295e8d,_0x2daefb){const _0x9d2b77=_0x9d2b();return _0x46c5=function(_0x46c5f5,_0x10630c){_0x46c5f5=_0x46c5f5-0x13e;let _0x563f06=_0x9d2b77[_0x46c5f5];return _0x563f06;},_0x46c5(_0x295e8d,_0x2daefb);}function _0x9d2b(){const _0x16ee6b=['includes','setProperty','155312TEFePG','silencer','getPlayers','849180CuYqgA','getBlockFromViewDirection','459198mTuDyN','gabrielaplok:add_wall_detect','1042725ZpARqo','gabrielaplok:remove_wall_detect','foregrip','getComponent','getTags','isValid','getDynamicProperty','gun:laser','49oOrsqK','222342punfWt','gun:grip','allow_attachment','hasTag','706136fDvyfy','triggerEvent','gun:silencer','gabrielaplok:recline','addTag','getEquipment','1681758FEdOom','removeTag','gun:sight'];_0x9d2b=function(){return _0x16ee6b;};return _0x9d2b();}
