Friendly Fire

Friendly Fire

9M Downloads

[Feature Request] Disable crouch bypass

Ricenami opened this issue ยท 5 comments

commented

Hi! Love your mod, is there any way I could enable/disable the crouch bypass for general protected entities?

If not, how could I prevent mobs from being damages instead of using your mod?

Cheers!

rice

commented

After looking into this a bit more, this would require moving the code around in a way that doesn't really make sense. I think it would be better to use something else that's more suited for this purpose.

commented

Hello, there isn't a way to do this currently but it's something I can look into. In some cases, like if you're trying to protect specific entities in the world, it may make more sense to apply the Invulnerable tag which will prevent damage independently of this mod.

commented

Could I add mobs to the invulnerable tag via data pack? If so what's the path? I'm new to modding.

Thank you,

rice

commented

No, that's a vanilla feature and it's applied to individual entities. For example if you had an NPC you want to protect you would use the commands to make it invulnerable. If you want to automatically protect all entities of a given type you would still need a mod like this one.

commented

If you want to automatically protect all entities of a given type you would still need a mod like this one.

Not really correct. It works without any mod whatsoever, albeit it's less optimal than using this mod or a global entity spawn data mod of some sort. What works is packing a datapack function that contains the line execute as @e[type=<mobtype>] run data modify @s Invulnerable set value true for every entity type you want to protect, with <mobtype> replaced with the respective entity type ID. Then you add the function to the tick function tag. The reason this is less optimal is that Minecraft then runs all of the commands in the function every single game tick, which can be quite performance-intense if many entities are affected.