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

Add several hostile non-monsters #927

Merged
merged 4 commits into from Sep 7, 2020

Conversation

Jikoo
Copy link
Collaborator

@Jikoo Jikoo commented Aug 2, 2020

I split this into two commits. The first is what GP already does, so if that's the desired behavior, that can be cherry picked out and the second can be ignored. Both add support for slimes (which for some reason were missed even though magma cubes were included), aggressive pandas, and hoglins.

The second commit adds specific protections for entities that are non-threatening.

  • Size 0 slimes deal 0 damage no matter the difficulty
  • Polar bears only enrage when players are too close to cubs or if attacked.
  • Hoglins can be pacified by the presence of certain blocks.

This may be a little inconvenient in some cases (it's way easier to just potshot an entity before it sees you) but it would allow players to set up breeding farms or zoos more easily.
My only reservation about the second approach is that I believe it could be bypassed by luring - the player would be targeted, just not in a hostile manner - so it might lull players into a false sense of security. I don't think there's a way to check with the API whether the mob is targeting a player because it's lured or hostile specifically.

Closes #885

@Jikoo
Copy link
Collaborator Author

Jikoo commented Aug 2, 2020

Looked into this more, it is in fact possible to detect lures. Will update PR shortly.

@Jikoo
Copy link
Collaborator Author

Jikoo commented Aug 2, 2020

@RoboMWM How do you feel about using NBT tags instead of metadata? NBT persists with GP uninstallation and persistence isn't really required for target reason tracking, but metadata leaks (minorly) and GP doesn't clean it up. GP does currently use metadata for tracking purposes, but I believe that's mostly due to the age of the code.

I'm going to proceed with NBT for now, but I'm perfectly willing to change that if you want GP to stick to metadata.

@Jikoo
Copy link
Collaborator Author

Jikoo commented Aug 2, 2020

Not super happy about the addition of the EntityTargetLivingEntityEvent, I believe that fires a lot, but the return conditions should keep our usage pretty efficient. I did note in my search to see if it's in use that GP claims to prevent luring animals, but does not actually. I don't think it's something we should add - players can and should be encouraged to build pens to expect to keep their animals - but it may be a good idea to remove that from the entry in the features.

  • No killing or luring animals away.

@RoboMWM
Copy link

RoboMWM commented Aug 23, 2020

I feel like the extra features for mobs that can become neutral, at the very least, feel like extra features/gameplay changes. E.g., players have encased mobs such as polar bears in glass structures. Wondering if these should be a config or not...

As for luring, I'm not sure when Big_Scary implemented that - highly likely before luring was a thing, as he only is protecting against jump potion and some other thing I can't recall. I'm guessing that as long as they're penned in, they can't be lured out without things that modify their movement like potions. Probably does need to be dropped though since I don't recall any complaints about this.

@Jikoo
Copy link
Collaborator Author

Jikoo commented Aug 23, 2020

I mean, luring is really only possible if a mob can wander out on its own or be pushed anyway, so I definitely don't think it's a thing GP needs to be concerned with.

Like I said, if we don't want GP to ever protect edge cases, f3e6059 can be cherry picked and that's the end of it. That said, we get a decent number of zoo-style requests, so I figure it may be easier to just add the full zoo friendliness feature while we're here. Speaking of, this would also close #553

@RoboMWM
Copy link

RoboMWM commented Aug 25, 2020

Only other thing I can think of against for protecting neutral/provokable mobs is that players can assume these mobs are classified as "animals" and wouldn't think they can defend themselves. Other than that I guess I could pull.

@RoboMWM
Copy link

RoboMWM commented Sep 7, 2020

I've been debating this internally every time I look at this but I guess it doesn't alter the design much, just the implementation.

@RoboMWM RoboMWM merged commit 766b34a into GriefPrevention:master Sep 7, 2020
@Jikoo Jikoo deleted the dev/harm-hostile-animals branch September 7, 2020 12:58
@Jikoo Jikoo mentioned this pull request Mar 1, 2023
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

Successfully merging this pull request may close these issues.

Players can't kill Hoglins in claims
2 participants