aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-07-25 21:52:49 +0800
committerGitHub <noreply@github.com>2022-07-25 21:52:49 +0800
commit702177afa74839b8d8635d07dfee33678df8ba29 (patch)
treedef28107e8ad586844ff20901782cc8c02accdb5
parent83a9cdda2dbac4e22318229475661fdca565be59 (diff)
parent413e5f1f7ab82b2b07125bca664a97db7ca40681 (diff)
downloadSoopyV2-702177afa74839b8d8635d07dfee33678df8ba29.tar.gz
SoopyV2-702177afa74839b8d8635d07dfee33678df8ba29.tar.bz2
SoopyV2-702177afa74839b8d8635d07dfee33678df8ba29.zip
Merge pull request #36 from EmeraldMerchant/patch-37
+ fix
-rw-r--r--features/events/index.js28
1 files changed, 19 insertions, 9 deletions
diff --git a/features/events/index.js b/features/events/index.js
index d7280db..62e8ec7 100644
--- a/features/events/index.js
+++ b/features/events/index.js
@@ -69,6 +69,7 @@ class Events extends Feature {
this.MythMobsHPGuiElement = new ToggleSetting("Render Mythological Mobs hp on your screen", "This will help you to know their HP.", true, "myth_mobs_hp", this).contributor("EmeraldMerchant");
this.MythMobsHP = new HudTextElement().setToggleSetting(this.MythMobsHPGuiElement).setLocationSetting(new LocationSetting("Mythological Mobs Hp Location", "Allows you to edit the location of Mythological Mobs hp", "myth_mobs_location", this, [10, 50, 1, 1]).requires(this.MythMobsHPGuiElement).editTempText("&8[&7Lv750&8] &2Exalted Minos Inquisitor &a40M&f/&a40M&c❤&r"));
this.hudElements.push(this.MythMobsHP);
+
this.Mobs = []
this.lastDing = 0
this.lastDingPitch = 0
@@ -123,7 +124,8 @@ class Events extends Feature {
}
})
- this.registerStep(true, 4, this.step_4fps)
+ this.registerStep(true, 1, this.step_1fps)
+ this.registerStep(true, 10, this.step_10fps)
this.registerCommand("sethubwarp", () => {
warpData.worldload = [Player.getX(), Player.getY(), Player.getZ()]
@@ -131,18 +133,26 @@ class Events extends Feature {
})
}
- step_4fps() {
- if (!this.MythMobsHPGuiElement.getValue()) return
- if (!this.showingWaypoints) return
-
+ step_1fps() {
+ if (!this.MythMobsHPGuiElement.getValue() || !this.showingWaypoints) return
World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach((mob) => {
let name = mob.getName()
- if ((name.includes("Exalted") || name.includes("Stalwart")) && !name.split(" ")[2].startsWith("0")) {
- this.Mobs.push(name)
+ if (!this.Mobs?.map(a => a.getUUID().toString()).includes(mob.getUUID().toString())) {
+ if ((name.includes("Exalted") || name.includes("Stalwart")) && !name.split(" ")[2].startsWith("0")) {
+ this.Mobs.push(mob)
+ }
}
})
- this.MythMobsHP.setText(this.Mobs.join("\n"))
- this.Mobs = []
+ this.Mobs = this.Mobs.filter((e) => !e[f.isDead]);
+ }
+
+ step_10fps() {
+ if (!this.MythMobsHPGuiElement.getValue()) return
+ let names = []
+ this.Mobs.forEach(nameTag => {
+ names.push(nameTag.getName())
+ })
+ this.MythMobsHP.setText(names.join("\n"))
}
entityJoinWorldEvent(e) {