ps-dps / MobCaptains

Rare and strong mobs, dropping illegally enchanted gear
https://modrinth.com/datapack/mob-captains
MIT License
5 stars 0 forks source link

Mob's Vanishing #16

Closed Darkerowl closed 11 months ago

Darkerowl commented 1 year ago

Some Mob Captains will spawn from a normal Mob on land and when I go to them they will despawn right before I get to them, this happens to the ones that spawn above ground, most of the ones that spawn in caves I can make it to and fight it's just the ones on land despawn once I get close. This is not a 100% I can get to them sometimes but it's usually the ones that are at a distance that vanish once I get close.

PuckiSilver commented 1 year ago

Hey,

thanks for letting me know, I already have a plan to circumvent this but my time to work on MobCaptains is quite limited at the moment

I hope to find the time to implement this, and some other improvements, some time soon

~PuckiSilver

Darkerowl commented 1 year ago

Ok sounds good, Also I love the Mod its amazing and a very smart idea for a Mod/datapack very unique!

zoltancservak commented 1 year ago

Hi! I think if you run data merge entity @s {PersistenceRequired:1b} in every mob convert/captain/ action they shoudn't despawn.

for example: function ./convert/captain: if score .should_glow ps-mob.config matches 1 effect give @s glowing 1000000 0 true tag @s add smithed.entity tag @s add ps-mob.captain if score .should_not_despawn ps-mob.config matches 1 data merge entity @s {PersistenceRequired:1b} mainScore["#try"].reset() mainScore[".faliure"].reset() mainScore[".cool_down"] = config[".cool_down"] store result entity @s Health float 1: attribute @s minecraft:generic.max_health get

as of right now, it's not in the mod and so its not in the config file either i just place down an always active command block telling: execute as @e[tag=ps-mob.captain] at @s if block ~ ~ ~ air run data merge entity @s {PersistenceRequired:1b} to break down the command, it just checks if the mob is in air, so not in block, or not in water (#drownedrights), and if yes, it gives them the non despawnable attribute.

PuckiSilver commented 11 months ago

Fixed for v3.0.0, the next release 👍