const _0x2d7fbe=_0x51d9;
(function(_0xea6058,_0x213301){
const _0x49a175=_0x51d9,_0x4c4d29=_0xea6058();
while(!![]){
try{
const _0x3f76b6=parseInt(_0x49a175(0xed))/0x1*(parseInt(_0x49a175(0xad))/0x2)+-parseInt(_0x49a175(0xa7))/0x3*(-parseInt(_0x49a175(0xe5))/0x4)+parseInt(_0x49a175(0xcb))/0x5+-parseInt(_0x49a175(0xeb))/0x6*(parseInt(_0x49a175(0xc5))/0x7)+-parseInt(_0x49a175(0xb2))/0x8+-parseInt(_0x49a175(0xb1))/0x9+parseInt(_0x49a175(0xca))/0xa*(parseInt(_0x49a175(0xba))/0xb);
if(_0x3f76b6===_0x213301)break;
else _0x4c4d29['push'](_0x4c4d29['shift']());
}
catch(_0x53355d){
_0x4c4d29['push'](_0x4c4d29['shift']());
}
}
}
(_0x12c5,0x1b385));
import{
world,system,GameMode,ItemStack,ItemDurabilityComponent,ItemEnchantableComponent,EntityEquippableComponent,EquipmentSlot
}
from'@minecraft/server';
function calculateGameTicks(_0x3714a6=0x3e8,_0xaf6363=0x14){
const _0x4ac3dd=_0x51d9;
return Math[_0x4ac3dd(0xc1)](_0x3714a6/(0x3e8/_0xaf6363));
}
function generateRadiusRange(_0x1f9ebb,_0x3b6dec=0x1){
const {
x:_0x47a9fd,y:_0x7cdd4a,z:_0x448c76
}
=_0x1f9ebb,_0x1f9f1b=[];
for(let _0x3d9234=_0x47a9fd-_0x3b6dec;
_0x3d9234<=_0x47a9fd+_0x3b6dec;
_0x3d9234++){
for(let _0xfe5c86=_0x7cdd4a-_0x3b6dec;
_0xfe5c86<=_0x7cdd4a+_0x3b6dec;
_0xfe5c86++){
for(let _0x3940f9=_0x448c76-_0x3b6dec;
_0x3940f9<=_0x448c76+_0x3b6dec;
_0x3940f9++){
_0x1f9f1b['push']({
'x':_0x3d9234,'y':_0xfe5c86,'z':_0x3940f9
}
);
}
}
}
return _0x1f9f1b;
}
function isPlayerInSurvivalMode(_0x4c4535,_0x2a0b41){
const _0x91470a=_0x51d9;
return _0x4c4535['getPlayers']({
'gameMode':GameMode[_0x91470a(0xe8)]
}
)[_0x91470a(0xb3)](_0x845861=>_0x845861[_0x91470a(0xdd)]===_0x2a0b41[_0x91470a(0xdd)]);
}
const getMainHandItem=_0x140202=>{
const _0x27234c=_0x51d9,_0x1f7847=_0x140202[_0x27234c(0xb9)](EntityEquippableComponent['componentId']);
return _0x1f7847?.[_0x27234c(0xd8)](EquipmentSlot['Mainhand']);
}
,isPlayerPerformingAction=_0x46ee5c=>_0x46ee5c[_0x2d7fbe(0xa9)]&&getMainHandItem(_0x46ee5c)?.[_0x2d7fbe(0xe3)](_0x2d7fbe(0xb4));
function isLogTypeStripped(_0x190e0a){
const _0x1c41fe=_0x2d7fbe;
return _0x190e0a[_0x1c41fe(0xcd)](_0x1c41fe(0xae));
}
function checkIfTree(_0x15936b,_0x5de073){
const _0x4b2d60=_0x2d7fbe,_0x1fe083=['leaves','warped_wart_block',_0x4b2d60(0xd1)];
for(const _0x23785d of _0x5de073){
const _0x31e2b8=generateRadiusRange(_0x23785d),_0x94aa08=_0x31e2b8['some'](_0x56a07e=>{
const _0x465a2f=_0x4b2d60,_0x39d925=_0x15936b[_0x465a2f(0xd6)](_0x56a07e)?.[_0x465a2f(0xe9)];
return _0x39d925&&_0x1fe083['some'](_0x126c53=>_0x39d925[_0x465a2f(0xcd)](_0x126c53));
}
);
if(_0x94aa08)return!![];
}
return![];
}
function countNearbyLeaves(_0x2664dc,_0x7d2ae7,_0x4e8004=0xc){
const _0x3e8d2d=_0x2d7fbe;
let _0x4f24d6=0x0;
const _0x42222b=findBlocksInRadius(_0x7d2ae7,0x2,0x20);
for(const _0x24c9ad of _0x42222b){
const _0x29385c=_0x2664dc[_0x3e8d2d(0xd6)](_0x24c9ad);
if(_0x29385c&&(_0x29385c[_0x3e8d2d(0xe9)]['includes']('leaves')||_0x29385c[_0x3e8d2d(0xe9)][_0x3e8d2d(0xcd)](_0x3e8d2d(0xd4)))){
if(++_0x4f24d6>=_0x4e8004)return!![];
}
}
return![];
}
function findBlocksInRadius(_0x48ea5f,_0x379e31,_0x458f91){
const _0x395471=_0x2d7fbe,_0x74612b=[];
for(let _0x4ec608=-_0x458f91;
_0x4ec608<=_0x458f91;
_0x4ec608++){
for(let _0x1b5107=-_0x379e31;
_0x1b5107<=_0x379e31;
_0x1b5107++){
for(let _0x23ff0c=-_0x379e31;
_0x23ff0c<=_0x379e31;
_0x23ff0c++){
_0x74612b[_0x395471(0xe6)]({
'x':_0x48ea5f['x']+_0x1b5107,'y':_0x48ea5f['y']+_0x4ec608,'z':_0x48ea5f['z']+_0x23ff0c
}
);
}
}
}
return _0x74612b;
}
function identifyLogLocations(_0x10c240,_0x343986,_0x438b4d){
const _0x5a47d9=_0x2d7fbe,_0x3dba9f=new Set(),_0x5223f9=[],_0x3d619b=generateRadiusRange(_0x343986),_0x15c7d2=/(_log|crimson_stem|warped_stem)$/;
while(_0x3d619b[_0x5a47d9(0xd7)]){
const _0x2585b4=_0x3d619b[_0x5a47d9(0xc0)](),_0x363c56=_0x2585b4['x']+','+_0x2585b4['y']+','+_0x2585b4['z'];
if(_0x3dba9f[_0x5a47d9(0xa6)](_0x363c56))continue;
_0x3dba9f['add'](_0x363c56);
const _0x23840b=_0x10c240[_0x5a47d9(0xd6)](_0x2585b4);
_0x23840b&&_0x23840b[_0x5a47d9(0xe9)]===_0x438b4d&&_0x15c7d2['test'](_0x23840b['typeId'])&&(_0x5223f9[_0x5a47d9(0xe6)](_0x2585b4),_0x3d619b[_0x5a47d9(0xe6)](...generateRadiusRange(_0x23840b[_0x5a47d9(0xd3)])));
}
return _0x5223f9[_0x5a47d9(0xce)]((_0x40e156,_0x243525)=>_0x40e156['y']-_0x243525['y']);
}
function _0x12c5(){
const _0x557cac=['subscribe','minecraft:stick','container','26929PlNczb','setblock ','minecraft:weeping_vines','damage','minecraft:pale_moss_carpet','456340KWudPD','241935XpPdLj','level','includes','sort','runCommandAsync','minecraft:warped_wart_block','nether_wart_block','amount','location','wart_block','getEntities','getBlock','length','getEquipmentSlot','warped_wart_block','splice','size','maxDurability','name','mangrove_roots','runInterval','setComponent',' air destroy','minecraft:nether_wart_block','hasTag','pow','16KaerJY','push','add','survival','typeId','test','324lEEYyu','minecraft:warped_stem','100323anBmWF','minecraft:item','has','15978SFNZFQ','type','isSneaking','runTimeout','moss_carpet','minecraft:mangrove_propagule','2qydRzC','stripped_','kill','minecraft:muddy_mangrove_roots','337851uXnPHI','1426528JTPyKC','some','is_axe','componentId','sqrt','ceil','unbreaking','getComponent','88raHcni','min','setItem','minecraft:twisting_vines','getItem','weeping_vines','pop','floor'];
_0x12c5=function(){
return _0x557cac;
};
return _0x12c5();
}
async function cutTree(_0x1a4cc4,_0x22e5ae,_0x2a656a){
const _0x41c8a9=_0x2d7fbe;
isTreeBeingCut=!![];
for(const _0x525db2 of _0x2a656a){
await _0x22e5ae[_0x41c8a9(0xcf)](_0x41c8a9(0xc6)+_0x525db2['x']+' '+_0x525db2['y']+' '+_0x525db2['z']+_0x41c8a9(0xe1));
}
}
async function removeLeaves(_0x5cd197,_0x5a5968){
const _0x5af63a=_0x2d7fbe,_0x4ea2a6=new Set(),_0x2163d2=['leaves',_0x5af63a(0xde),_0x5af63a(0xab),'pale_moss_carpet','muddy_mangrove_roots',_0x5af63a(0xd9),_0x5af63a(0xd1),_0x5af63a(0xbf),'twisting_vines','shroomlight'],_0xed652c=async _0x1492ba=>{
const _0x1e9fea=_0x5af63a,_0x2af39c=_0x1492ba['x']+','+_0x1492ba['y']+','+_0x1492ba['z'];
if(_0x4ea2a6[_0x1e9fea(0xa6)](_0x2af39c))return;
_0x4ea2a6[_0x1e9fea(0xe7)](_0x2af39c);
const _0xb901ca=_0x5cd197[_0x1e9fea(0xd6)](_0x1492ba);
if(!_0xb901ca||!_0x2163d2[_0x1e9fea(0xb3)](_0x39dd1f=>_0xb901ca[_0x1e9fea(0xe9)][_0x1e9fea(0xcd)](_0x39dd1f)))return;
const _0x503c19=generateRadiusRange(_0xb901ca[_0x1e9fea(0xd3)],0x2)[_0x1e9fea(0xb3)](_0x13060c=>{
const _0x4a76e3=_0x1e9fea,_0x386bae=_0x5cd197[_0x4a76e3(0xd6)](_0x13060c);
return _0x386bae&&/(_log|_stem)$/[_0x4a76e3(0xea)](_0x386bae['typeId']);
}
);
if(!_0x503c19){
await _0x5cd197[_0x1e9fea(0xcf)](_0x1e9fea(0xc6)+_0x1492ba['x']+' '+_0x1492ba['y']+' '+_0x1492ba['z']+_0x1e9fea(0xe1));
for(const _0x5d3eba of generateRadiusRange(_0x1492ba,0x2)){
await _0xed652c(_0x5d3eba);
}
}
};
for(const _0x33a1b5 of _0x5a5968){
for(const _0x1a1624 of generateRadiusRange(_0x33a1b5,0x2)){
await _0xed652c(_0x1a1624);
}
}
}
function _0x51d9(_0x450948,_0x45cdb3){
const _0x12c554=_0x12c5();
return _0x51d9=function(_0x51d975,_0x2e65fe){
_0x51d975=_0x51d975-0xa6;
let _0x44cb81=_0x12c554[_0x51d975];
return _0x44cb81;
}
,_0x51d9(_0x450948,_0x45cdb3);
}
function reduceAxeDurability(_0x920ba,_0x46dd04){
const _0xb0c038=_0x2d7fbe,_0x4524f7=getMainHandItem(_0x920ba);
if(!_0x4524f7)return;
const _0x3d103f=_0x4524f7[_0xb0c038(0xbe)]();
if(!_0x3d103f)return;
const _0x2e32d2=_0x3d103f['getComponent'](ItemDurabilityComponent['componentId']),_0x15f933=_0x3d103f[_0xb0c038(0xb9)](ItemEnchantableComponent[_0xb0c038(0xb5)]);
if(!_0x2e32d2||!_0x15f933)return;
const _0x572afd=_0x15f933['getEnchantment'](_0xb0c038(0xb8))?.[_0xb0c038(0xcc)]||0x0,_0x494595=_0x2e32d2[_0xb0c038(0xc8)]*(0x1+_0x572afd),_0x5b6609=_0x2e32d2[_0xb0c038(0xdc)]*(0x1+_0x572afd),_0x2b5543=_0x494595+_0x46dd04[_0xb0c038(0xd7)],_0x6cdb52=_0x2b5543>=_0x5b6609?_0x2b5543-_0x5b6609:0x0;
if(_0x6cdb52>0x0)_0x46dd04[_0xb0c038(0xda)](-_0x6cdb52);
const _0x212207=Math[_0xb0c038(0xbb)](Math[_0xb0c038(0xb7)](_0x2b5543/(0x1+_0x572afd)),_0x2e32d2[_0xb0c038(0xdc)]);
_0x2e32d2[_0xb0c038(0xc8)]=_0x212207,_0x4524f7[_0xb0c038(0xbc)](_0x3d103f);
}
function startCollectingItems(_0x3cd01f,_0xe170b9){
const _0x4e2170=_0x2d7fbe,_0x1125dc=['minecraft:apple','minecraft:cocoa_beans',_0x4e2170(0xc3),_0x4e2170(0xc9),_0x4e2170(0xac),'minecraft:mangrove_roots','minecraft:moss_carpet',_0x4e2170(0xb0),'minecraft:crimson_stem',_0x4e2170(0xec),_0x4e2170(0xe2),_0x4e2170(0xd0),_0x4e2170(0xc7),_0x4e2170(0xbd),'minecraft:shroomlight'],_0x4a07e5=system[_0x4e2170(0xdf)](()=>{
const _0x2b164c=_0x4e2170;
if(!isTreeBeingCut){
system['clearRun'](_0x4a07e5);
return;
}
const _0x1e8da0=_0x3cd01f[_0x2b164c(0xb9)]('minecraft:inventory')[_0x2b164c(0xc4)];
for(const _0x172c11 of _0xe170b9){
const _0x3b8493=_0x3cd01f['dimension'][_0x2b164c(0xd5)]({
'type':'minecraft:item','location':_0x172c11,'radius':0x6
}
);
for(const _0x2c831b of _0x3b8493){
const _0x2a8063=_0x2c831b['location'],_0x2484d7=Math[_0x2b164c(0xb6)](Math['pow'](_0x2a8063['x']-_0x172c11['x'],0x2)+Math[_0x2b164c(0xe4)](_0x2a8063['y']-_0x172c11['y'],0x2)+Math[_0x2b164c(0xe4)](_0x2a8063['z']-_0x172c11['z'],0x2));
if(_0x2484d7<=0xc){
const _0xea51a8=_0x2c831b[_0x2b164c(0xb9)](_0x2b164c(0xee))?.['itemStack'];
if(!_0xea51a8)continue;
if(/_log$/[_0x2b164c(0xea)](_0xea51a8[_0x2b164c(0xe9)])||_0x1125dc[_0x2b164c(0xcd)](_0xea51a8['typeId'])||/_sapling$/['test'](_0xea51a8['typeId'])){
let _0xd365c2=_0xea51a8[_0x2b164c(0xd2)];
for(let _0xcfb557=0x0;
_0xcfb557<_0x1e8da0['size'];
_0xcfb557++){
const _0x54ba5b=_0x1e8da0[_0x2b164c(0xbe)](_0xcfb557);
if(_0x54ba5b&&_0x54ba5b[_0x2b164c(0xe9)]===_0xea51a8['typeId']&&_0x54ba5b['amount']<0x40){
const _0x2678af=0x40-_0x54ba5b[_0x2b164c(0xd2)],_0x3be957=Math['min'](_0xd365c2,_0x2678af);
_0x54ba5b['amount']+=_0x3be957,_0x1e8da0[_0x2b164c(0xbc)](_0xcfb557,_0x54ba5b),_0xd365c2-=_0x3be957;
}
if(_0xd365c2<=0x0)break;
}
if(_0xd365c2>0x0)for(let _0x1f24a3=0x0;
_0x1f24a3<_0x1e8da0[_0x2b164c(0xdb)];
_0x1f24a3++){
const _0x762439=_0x1e8da0[_0x2b164c(0xbe)](_0x1f24a3);
if(!_0x762439){
const _0x35deab=Math[_0x2b164c(0xbb)](_0xd365c2,0x40),_0x11dd56=new ItemStack(_0xea51a8['typeId'],_0x35deab);
_0x1e8da0[_0x2b164c(0xbc)](_0x1f24a3,_0x11dd56),_0xd365c2-=_0x35deab;
}
if(_0xd365c2<=0x0)break;
}
_0xd365c2<=0x0?_0x2c831b[_0x2b164c(0xaf)]():(_0xea51a8[_0x2b164c(0xd2)]=_0xd365c2,_0x2c831b[_0x2b164c(0xe0)](_0x2b164c(0xee),{
'itemStack':_0xea51a8
}
));
}
}
}
}
}
,calculateGameTicks(0x5));
}
let isTreeBeingCut=![];
world['afterEvents']['playerBreakBlock'][_0x2d7fbe(0xc2)](async _0x5d3cad=>{
const _0x5a4f78=_0x2d7fbe,{
dimension:_0x4c9fce,player:_0xe807f3,block:_0x1cde5e
}
=_0x5d3cad,_0x2354e9=_0x5d3cad['brokenBlockPermutation'][_0x5a4f78(0xa8)]['id'];
if(isLogTypeStripped(_0x2354e9)||!isPlayerPerformingAction(_0xe807f3))return;
const _0x47edb8=identifyLogLocations(_0x4c9fce,_0x1cde5e[_0x5a4f78(0xd3)],_0x2354e9);
if(!countNearbyLeaves(_0x4c9fce,_0x1cde5e[_0x5a4f78(0xd3)])||!checkIfTree(_0x4c9fce,_0x47edb8))return;
if(isPlayerInSurvivalMode(_0x4c9fce,_0xe807f3))reduceAxeDurability(_0xe807f3,_0x47edb8);
startCollectingItems(_0xe807f3,_0x47edb8),await cutTree(_0x1cde5e['location'],_0x4c9fce,_0x47edb8),await removeLeaves(_0x4c9fce,_0x47edb8),system[_0x5a4f78(0xaa)](()=>{
isTreeBeingCut=![];
}
,calculateGameTicks(0x3e8));
}
);
© 2023 Quttera Ltd. All rights reserved.