Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPCs can't be hit in no pvp areas #249

Closed
Blamo27 opened this issue Jul 8, 2018 · 21 comments
Closed

NPCs can't be hit in no pvp areas #249

Blamo27 opened this issue Jul 8, 2018 · 21 comments

Comments

@Blamo27
Copy link

Blamo27 commented Jul 8, 2018

Hello,

For a few days now, and without us changing anything, players can no longer hurt Sentinels in "no-pvp" areas of World Guard, where they previously could... Sentinels can hit players but players can't hit Sentinels. In other words, as soon as the PVP is blocked by a plugin (not juste world guard by the way), you can't attack Sentinels. This is a huge issue on any roleplay server : we don't want players to fight each other but fight the NPCs.

After litterally hours of testing, we also concluded that this bug is completely random. Each time we restart the server, it has a "chance" to occur, no matter what other plugins we have. That means that, if you try to recreate this bug, you may have to restart your server multiple times to see it happen.

Thank you.

@mcmonkey4eva
Copy link
Member

I'm not sure how you achieved that as a random thing. That's been a known issue - PvP blockage blocks player-type NPCs from being hurt and in some cases from giving damage (depending on config)

@Ferocimo
Copy link

Ferocimo commented Jul 8, 2018

Well we neither, to be honest. We tested for several hours, removing plugin after plugin, putting them back, restarting the server dozens of times : sometimes it works, sometimes it doesn't.

Previously (like, two weeks ago ? We didn't change a thing in that period of time, though...), it worked perfectly everytime.

@Ferocimo
Copy link

Ferocimo commented Jul 9, 2018

(Also, it doesn't seem to depend on config, it's ALWAYS the case no matter what options we set in config).

@mcmonkey4eva
Copy link
Member

I'm aware config is irrelevant (The config note in my above post was regarding specifically giving damage, not receiving)
Receiving damage should theoretically be either working or not, dependent on external plugins. It works fine on a basic Spigot server, it's only adding plugins like WorldGuard with certain settings that affects that. And the issue is an issue with WorldGuard, not with Sentinel.

@Ferocimo
Copy link

Ferocimo commented Jul 9, 2018

Receiving damage from Sentinels works fine, it's player being able to give them damage that is the issue.

However this issue exists with whatever plugin you use to disable PVP. Actually, it even exists without any other plugin, since it can occur if you simply disable PVP in your server.properties. So, I don't think I'll send a mail to Mojang to notify them that their way of blocking PvP is in conflict with your plugin...!
This is why we're counting on you : on this matter, it is your plugin that should bypass PvP protections regarding NPCs, like it previously did by the way.

We really hope that you'll have a look at this because in the mean time, your plugin is completely un-usable for us, and -as you know- it's been years since we're working on it to develop our server.

@Morphan1
Copy link

Morphan1 commented Jul 9, 2018

There's sadly no reasonable way for us to handle this on our end. For example, in the case of WorldGuard (though I believe they actually implemented a Citizens workaround in their code) it uses regions which we do not and can not have access to without directly linking it. We would need to do the same for every single pvp management plugin out there, simply because we don't know where they have it disabled at to begin with.

@Ferocimo
Copy link

Ferocimo commented Jul 9, 2018

Okay, but what about making it compatible with Minecraft Vanilla's way of disabling PvP ? Surely this can be adapted ?
Also, World Guard is the main plugin doing that, so if there was one to be compatible with, it would be this one...
You did mention that World Guard implemented some compatibility in their code, why is it not working anymore then ? And why did it occur so suddenly ?

@robgob
Copy link

robgob commented Jul 9, 2018

Citizens can create Npcs that use player hooks and appearances. Because of this it makes it hard for other 3rd party plugins that disable PvP to be compatible. If they were to do so, it would need to reference the Citizens/Sentinel plugin to know just who is really a Player vs Npc. You CAN however make your own anti-pvp for regions based on the plugin Denizen/Depenizen. You can use WolrdGuard for regions, and in the denizen script set up a list of regions that you want to disable PvP in, and manually create a script to do so. This way you can check if the player is a Npc or not.

Or if you still wish to use other 3rd party pvp managemnt plugins, I'm not 100% sure but i think you can fire an event in Denizen to override that event being canceled from said pvp-plugin...?

@Morphan1
Copy link

Morphan1 commented Jul 9, 2018

@Ferocimo I can't speak for the WorldGuard team, you'd have to ask them.

@robgob that's just incorrect. The standard for checking if an entity is added with an NPC plugin is as simple as entity.hasMetaData("NPC");

Also, do note that we have absolutely no way to distinguish the cause of any event's cancellation in the Bukkit/Spigot API. Even if we did hook into WorldGuard, we would never know if it was the actual cause of the cancellation.

@Ferocimo
Copy link

Ferocimo commented Jul 9, 2018

I won't even try to contact them, unless you have a good way of contacting them that I don't know of, because we reported a critical issue allowing players to actually kill other players in no pvp areas three monthes ago, and still got no answer despite bumping it. It seems they provide absolutely no support (or we didn't find the correct way to reach them).

So, what about compatibility with Minecraft Vanilla ?

@SXRWahrheit
Copy link

@Ferocimo
Copy link

Ferocimo commented Jul 9, 2018

Yes it's what we used.

https://dev.enginehub.org/youtrack/issue/WORLDGUARD-3938

@Morphan1
Copy link

Morphan1 commented Jul 9, 2018

The vanilla toggle has the same problem. There's no isVanillaCancellingThis() or anything, just a simple isCancelled() (assuming toggling that setting off would even fire the event)

Regarding contacting the WorldGuard devs, you could try bothering them through IRC via irc.esper.net -> #sk89q or ask on what appears to be their forums. http://forum.enginehub.org

I'm not sure what their policy on repetitive posts is, so do so at your own risk of course.

@Ferocimo
Copy link

Ferocimo commented Jul 9, 2018

How comes that it worked previously ? Like, some weeks ago ?

I'll try that.

@mcmonkey4eva
Copy link
Member

The best that's even remotely possible to do here would be an equivalent of "workaround damage" in reverse... requiring we first somehow accurately detect players doing damage to an NPC, identify that it's been blocked (or block it ourselves, when enabled in config?), somehow determine whether the block is legitimate (Combat shouldn't happen) or requiring bypassing (no-PvP zones that should allow PvNPC), and then manually calculate the damage values the attack should give, and manually apply the damage.

It could theoretically be done, but it's rather iffy and I'm not sure how we could actually detect the combat actions, especially when blocked by vanilla minecraft. (Plugins like WorldGuard are slightly easier to workaround in general, as we'd mostly just have to forcibly uncancel the damage event... though would have to figure out when to do that accurately and reasonably still)

@Blamo27
Copy link
Author

Blamo27 commented Jul 14, 2018

@mcmonkey4eva http://forum.enginehub.org/threads/no-pvp-regions-blocking-players-ability-to-hit-npcs.26486/

Because of this your plugin is no longer useable on any server using world guard and disabling pvp in some regions...
God knows how many servers use WorldGuard ...

@mergu
Copy link

mergu commented Jul 14, 2018

Re-read the post. The issue is on WG's end:
This could probably be changed with an additional check for the damagee.

@mcmonkey4eva
Copy link
Member

The reply post even points out that they have NPC checks (that are poorly implemented).
They have an isFakePlayer that is meant to be used in more places, but isn't, and also purely uses names (and doesn't check hasMetadata("NPC") which is a rather solid way to check whether something is an NPC using purely the Bukkit API)

@Blamo27
Copy link
Author

Blamo27 commented Aug 1, 2018

@mcmonkey4eva I checked if the defender is an NPC, thanks

@SXRWahrheit
Copy link

WorldGuard appears to have merged your PR, can this issue be closed?

@Blamo27
Copy link
Author

Blamo27 commented Aug 21, 2018

I'm closing it, thank you @mcmonkey4eva for the answer

@Blamo27 Blamo27 closed this as completed Aug 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants