thexaero / open-parties-and-claims

Minecraft mod that adds chunk claims and player parties
https://www.curseforge.com/minecraft/mc-mods/open-parties-and-claims
Other
37 stars 20 forks source link

Mob Friendly/Hostile Barrier #387

Open Foxtrek64 opened 10 months ago

Foxtrek64 commented 10 months ago

There is a setting for claims which prevents players from entering a particular region.

I would like this same feature, but for mobs (with an option for hostile and friendly). Is there a way I can set this up with config files or would this require a mod update?

thexaero commented 10 months ago

You can add the same option as for players for any entity types, through the main config file. Read the comment above the entityClaimBarrierOptionalGroups option. There is no distinction between hostile and friendly mobs there. I don't particularly feel like there should be. There are other forms of protection against hostile mob attacks. Anything else can be caused by both hostile and friendly mobs.

Foxtrek64 commented 10 months ago

I see, thanks.

I ended up finding that option later last night and added zombie villagers to it as per the example, but will need to customize further.

The issue I mean to solve here is that while no mobs are allowed to spawn in the spawn claim, they do wander in and disturb the players. I've shut off their ability to do damage, but skeletons for instance will still shoot at the player. There didn't seem to be any sort of setting to prevent targeting players or regarding aggression, but I did spot the barrier option when going through settings. I figured this would be as good of a solution as any. But if I missed something do let me know.

Once I get a proper list of all of the hostile entities, I'll share my entityClaimBarrierOptionalGroups setting so others may take advantage of it. I'll have it split into friendly and hostile mobs just because there is a need for that in our use case. That said, I understand this list and the corresponding groups will need to be manually updated for every new release where a mob is added.

thexaero commented 10 months ago

I see, makes sense. I guess I can look into adding a separate barrier option to player/claim config that includes all hostile mobs. Or, alternatively, I can look into preventing targeting of protected entities/players in the first place.

Foxtrek64 commented 10 months ago

I could see some utility in targeting but not attacking, but perhaps only for adventure maps. I could see it being separate, but I think I'd like to see some real life use case rather than speculation on my end. This may even perhaps be better as a separate proposal.

Disabling targeting + cancelling damage seems like a good way to go, and I'd propose we keep the current implementation and add on targeting prevention because there are situations where mobs can harm players without targeting them (stray arrows, too close to creeper explosions, etc.).

I can update my initial proposal if this is agreeable.

thexaero commented 10 months ago

Adding it as a separate option is already what I was planning to do. Apologies for not making it clear. I'll use this issue for the barrier suggestion and added a separate issue for targeting prevention #389