diff options
author | EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> | 2022-09-06 14:52:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-06 14:52:56 +0800 |
commit | 772ed9fd29a2933db373f42a5ef0d97ffda6354b (patch) | |
tree | b491b5b8c0173dbf7c1795b9df8dad0c42df975e /features/slayers | |
parent | f6dfd7233ecb3c5849730cfe50815df3aec7b656 (diff) | |
download | SoopyV2-772ed9fd29a2933db373f42a5ef0d97ffda6354b.tar.gz SoopyV2-772ed9fd29a2933db373f42a5ef0d97ffda6354b.tar.bz2 SoopyV2-772ed9fd29a2933db373f42a5ef0d97ffda6354b.zip |
assign actualemanboss
+ attempt to find this.actualEmanBoss whenever this.emanBoss changed
Diffstat (limited to 'features/slayers')
-rw-r--r-- | features/slayers/index.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/features/slayers/index.js b/features/slayers/index.js index 786e732..da05a68 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -159,6 +159,7 @@ class Slayers extends Feature { candidatesDist.push(Math.round(parseFloat(distanceTo(candidate)) * 10)) }) this.emanBoss = this.candidateBoss[candidatesDist.indexOf(Math.min(...candidatesDist))] + assignActualEmanBoss(this.emanBoss) } } }) @@ -428,6 +429,20 @@ class Slayers extends Feature { } } } + + assignActualEmanBoss(entity) { + if (this.bossSpawnedMessage) { + World.getAllEntitiesOfType(net.minecraft.entity.monster.EntityEnderman).forEach((e) => { + if (e.getName().includes("Voidgloom Seraph")) { + //if distance from e to entity < 5 + if ((e.getX() - entity.getX()) ** 2 + (e.getY() - entity.getY()) ** 2 + (e.getZ() - entity.getZ()) ** 2 < 25) { + this.actualEmanBoss = e; + } + } + }) + } + } + renderWorld(ticks) { this.minibossEntity.forEach((x) => { drawBoxAtEntity(x[0], 0, 1, 0, this.SlayerWidth[x[1]], this.SlayerHeight[x[1]], ticks, 4, false); @@ -514,6 +529,7 @@ class Slayers extends Feature { this.cannotFindEmanBoss = false } else if (nameRemoveFormat.includes("Voidgloom Seraph") && ((name.getX() - Player.getX()) ** 2 + (name.getY() - Player.getY()) ** 2 + (name.getZ() - Player.getZ()) ** 2 < 25)) { this.emanBoss = name + assignActualEmanBoss(this.emanBoss) this.cannotFindEmanBoss = false } } @@ -604,10 +620,12 @@ class Slayers extends Feature { if (e[m.getCustomNameTag]() && e[m.getCustomNameTag]().includes("Voidgloom Seraph")) { if (Date.now() - this.nextIsBoss < 3000) { this.emanBoss = new Entity(e); + assignActualEmanBoss(this.emanBoss) this.nextIsBoss = false; } if (this.cannotFindEmanBoss && ((e[f.posX.Entity] - Player.getX()) ** 2 + (e[f.posY.Entity] - Player.getY()) ** 2 + (e[f.posZ.Entity] - Player.getZ()) ** 2 < 5)) { this.emanBoss = new Entity(e); + assignActualEmanBoss(this.emanBoss) this.cannotFindEmanBoss = false } |