StackMob-5 icon indicating copy to clipboard operation
StackMob-5 copied to clipboard

StackMob removing names from named mobs

Open mrcoffee1026 opened this issue 4 years ago • 15 comments

Specifically from Boss mobs (https://www.spigotmc.org/resources/%E2%98%9B-boss%E2%84%A2-custom-monsters-and-animals-on-your-server-1-8-8-1-16-3-25-sale-%E2%9A%A1.46497/)

I filed a similar ticket with them they said to contact you to see if you could save the names to something else before renaming the mobs so as to ensure you're able to replace them after the non-stack has taken place (they aren't actually being stacked since these Bosses tend to spawn only one at a time and certainly not several of the same mob near each other). The ticket there for your review: https://github.com/kangarko/Boss/issues/600

This does seem to go beyond just these mobs, many a player's pet has had their name voided or at least hidden from sight. Would you please look into that as well?

mrcoffee1026 avatar Sep 20 '20 01:09 mrcoffee1026

Yeah I tried to cancel the event by this code, it will print in the console that the event is canceled, yet stacking continues:

a

kangarko avatar Sep 20 '20 08:09 kangarko

Yeah I tried to cancel the event by this code, it will print in the console that the event is canceled, yet stacking continues:

a

You need to check both entities.

ploppyperson avatar Sep 20 '20 10:09 ploppyperson

What do you mean? Can you suggest how to edit the code please?

kangarko avatar Sep 20 '20 10:09 kangarko

What do you mean? Can you suggest how to edit the code please?

You can get the other stack with the #getNearbyStackEntity method.

ploppyperson avatar Sep 20 '20 10:09 ploppyperson

Thanks!

kangarko avatar Sep 20 '20 10:09 kangarko

I don't think there IS a second entity which actually gets stacked, it seems to me that stackmob is just counting every single entity that spawns as a stack of one and so renames accordingly. So even if he makes this code change, I think the boss name is still going to be wiped... which is why this often happens to people's named pets as well.

mrcoffee1026 avatar Sep 20 '20 13:09 mrcoffee1026

Got it, next Boss release will come up tonight. You can test it. If it is still broken then it is unfortunately incompatible as you said.

kangarko avatar Sep 24 '20 17:09 kangarko

Yeah the release from today had no effect on the issue. Boss 3.8.11 vs StackMob 5.3.5. Just need the stackmob people to use the API to save the name for these particular mobs and just save other named mobs AT ALL, especially if they aren't to be stacked.

mrcoffee1026 avatar Sep 24 '20 22:09 mrcoffee1026

@Nathat23 any idea what I may have done wrong here please?

a

kangarko avatar Sep 28 '20 17:09 kangarko

@Nathat23 any idea what I may have done wrong here please?

a

I don't think there's anything wrong with that. If you spawn a boss and run /sm remove does it get removed?

ploppyperson avatar Sep 28 '20 20:09 ploppyperson

The thing i'm seeing wrong specifically here is that everything happens within the condition "if (stacked != null)", and as I've said this is happening to all mobs whether or not they are actually stacked. I've concluded that each and every individual mob is seen by StackMob to be a stack of one, but while that may be true and probably why the names are being removed, the condition "stacked" is likely only met if the stack consists of more than one mob. Something would still need to be done on the StackMob end to preserve the names of mobs... including (and certainly not limited to) the Boss mobs. And yes /sm remove removes the boss mob even though it isn't stacked with anything.

mrcoffee1026 avatar Sep 28 '20 20:09 mrcoffee1026

Have the named mobs that are stacking been tamed (apart from the bosses mobs)?

ploppyperson avatar Sep 28 '20 21:09 ploppyperson

Again, they aren't actually "stacking" since there's still only one mob. I'm saying that - internally - StackMob still considers them to BE a stack, and so takes their names away and doesn't give the names back since there's only one and the only name StackMob will apply will be the formatted '&a%type% &d(%size%)', and of course it will only do that if there's more than the threshold number of mobs. Sometimes the names are removed from tamed mobs, more often: they are removed from untamed mobs that have been named by players using nametags. Most noticeably this has been with fish which - once the name has been wiped out by StackMob - generally despawns after a very short period of time.

mrcoffee1026 avatar Sep 28 '20 21:09 mrcoffee1026

You have pretty much described the issue, however its a combination of different problems. Something I have noticed is that the children of bred animals will be have stack data by default, so this means that they are considered stacked entities and will merge with other stacks. Adding 'BREEDING' to the reason-blacklist fixes this, and may fix the problem your describing.

ploppyperson avatar Oct 04 '20 10:10 ploppyperson

I'm not going to blacklist breeding, this is one of the needs this plugin is here to address. Having a name should be enough reason to be blacklisted, but that is besides the point here, this plugin should not be altering mobs if it is not stacking them, and it really shouldn't be altering them when it's doing that either. This gets to stack identical matches... that's it. It's removing names and treating every single mob as a stack... and that's misbehaving. By misbehaving in this way, people's pets are despawning, rare villagers are vanishing, boss mobs can't be identified as bosses. With a few little things here and there it's just a bit annoying, but it's gone on long enough and reached a bit of a critical mass at this point, now it's simply intolerable. That you're considering just using other reasons to disable the plugin for more mobs does not instill me with much optimism here. But with the changes that have been made on Boss's end with your assistance we have already established that Bosses are never going to be stacked, and your plugin is still removing each and every one of their names. If there's some reason you cannot NOT remove every mob's name, then you simply HAVE to put it back. Store the data temporarily and just replace it when you're done doing... whatever. The Boss mobs even have their own API so should be extra easy to grab their name. Other mobs would only have something applied by nametag and that should be easy enough? And certainly those mobs shouldn't be stacked. If they're named then they belong to someone. Combination of problems or not, we need them resolved... I'm willing to donate or pay for some troubleshooting on this but please don't blow me off with something about blacklisting a spawn reason when - even if it COULD have an effect, it would only be a temporary bandage, and this is a probably that needs a permanent solution.

mrcoffee1026 avatar Oct 05 '20 02:10 mrcoffee1026