Project: Save the Pets!
Version: 3.0.1
License: Apache-2.0
Client/Server Side: Either (Limited Client features)
Forge/Fabric: Either (Forge or Fabric)
Protect your pets from yourself and give them a second chance at life!
Client or Server Side (Singleplayer counts as Server Side!). Unlike most mods, this mod will work on both without the other with some features missing on the client. If installed on the server, all clients will receive all server side features!
Forge and Fabric have the same features and configuration files and can work with each other (IE: Vanilla/Forge Server and Fabric/Vanilla Client).
Dependencies
Common
Java Version: 17+
Minecraft: 1.18.0+
Fabric
Fabric Loader: 0.13.0+
Fabric API: 0.43.0+
Forge
Minecraft Versions
This mod should work with 1.18.x and future releases.
No older versions will be supported.
Features
Protection
This mod protects your pets from various sources of damaged caused by you!
Source | Server Side | Client Side | Configurable |
---|---|---|---|
Direct Attack | ✔️ Yes | ✔️ Yes | ✔️ Yes |
Sword Sweeping | ✔️ Yes | ❌ No | ✔️ Yes |
Projectiles | ✔️ Yes | ❌ No | ✔️ Yes |
Explosions | ✔️ Yes | ❌ No | ✔️ Yes |
Potions | ✔️ Yes | ❌ No | ✔️ Yes |
Revival (Server Side Only)
When your pet dies, it drops a note. You can then use this note to revive the pet.
Right-clicking on a Copper Block (configurable) while holding the note, will respawn the pet and consume the block.
Untaming (Removing Ownership) (Server Side Only)
Don't want your pet or want to give it to someone else? You can remove ownership by crouching and using a shear (configurable)!
Harming your pets (Client Side only)
Holding down the Shift key (configurable in the Option's menu) while attacking will bypass the Client Side protection and harm the pet. I'm not sure why you want to do this but it's here, just in case.
Note: Feature is removed if Server has the mod installed.
Configuration
The Configuration file is JSON. Below is an example file with comments.
{
// Used Interally
"version": 0,
// Items used to remove onwership of a pet
"shears": [],
// Allows the Minecraft and Modded Shears to remove ownership
"allowDefaultShears": true,
// Blocks that can be used to revive a pet
"revivalBlocks": [
"minecraft:copper_block"
],
"entities": {
// Are tamable entites protected?
"allowTameableEntities": true,
// Are fox entites protected?
"allowFoxEntities": true,
// Are horse based entites protected?
"allowHorseBaseEntities": true,
// Blacklist entities from protection and revival
"blacklistedEntities": [],
// Entities that should drop the revival note
"revivableEntities": [],
// Do mobs with custom names drop a revival note?
"reviveNamedMobs": true
},
"damage": {
// Do we protect against projectiles?
"preventProjectiles": true,
// Do we protect against sword sweep?
"preventSwordSweep": true,
// Do we protect against direct attack?
"preventAttack": true,
// Do we protect against explosions?
"preventExplosions": true,
// Do we protect against harmful potions?
"preventHarmingPotions": true,
// Harmful effects to living entities.
"livingEffects": [
"minecraft:instant_damage",
"minecraft:poison"
],
// Harmful effects to undead entities.
"undeadEffects": [
"minecraft:instant_health",
"minecraft:regeneration"
]
}
}
APIs (For modders)
Common
Most of the configurability lives in dcp.mc.projectsavethepets.ProjectSaveThePets
. This is used later on for both Fabric and Forge.
The following has been publicly exposed to easily add/remove singletons in a dynamic fashion:
Set<FriendlyFireBlockerApi> FRIENDLY_FIRE_BLOCKER_APIS
Set<OwnershipRemoverApi> OWNERSHIP_REMOVER_APIS
Set<NoteGeneratorApi> NOTE_GENERATOR_APIS
For examples on how to use them (as well as how to make APIs for the mod), see dcp.mc.projectsavethepets.ProjectSaveThePets#<cinit>()
and classes in dcp.mc.projectsavethepets.implementations
.
Fabric
The following Entry Points are for the following classes:
projectsavethepets-ffba
->FriendlyFireBlockerApi
projectsavethepets-ora
->OwnershipRemoverApi
projectsavethepets-nga
->NoteGeneratorApi
Forge
Use the InterModEnqueueEvent
to send instances of FriendlyFireBlockerApi
, projectsavethepets-ora
, or projectsavethepets-nga
to projectsavethepets
.
FAQ
Forge?
It's done already! Have a look here
Mod Packs?
Go for it! You have my full permission to add the mod to your Mod Pack. No credits required!
Can I use this for my mod?
Sure thing! Same as above!
Hey! I saw your code and would like to take a snippet!
Sure, I don't mind! As long as it's not a blatant copy and paste of an entire file! ( accessors excluded). I do wish to be mentioned if possible.
Do I need Fabric API?
Yes you do as the mod needs it for the custom keybindings. But only if you are using the Fabric version of the mod!
Is this client or server sided?
It can run on the Client without the Server having it installed. But, some features will be missing if the Server doesn't have it installed! So if you have it installed, you can use it on a vanilla server.
However, if the server has it installed, no Players will need to install the mod on their client.
Enjoy!
Does my client need this mod?
Only for servers that don't have this mod and for Singleplayer/LAN! See above for more information.
Does LAN Multiplayer work with this mod?
I believe so! Untested but I'll fix any problems that show up. You and all players should get all Server Side Features.
I got a question or a bug.
Feel free to comment below the question, however I would prefer if you left any bug reports in the GitLab Repository! Thanks!
Change Logs
Note: Doesn't include fixes and might be possibly missing a few features.
v3.0.0
- Changed source code package to something shorter
- Added config
- Added Explosion protection
- Added Splash and Lingering Potion protection
- Added Revival and API associated to it
- Added ability to blacklist entities from protection
- Added Forge compatibility
v2.0.0
- Added Client Side feature
- Added cross mod compatibility API
- Added Projectile protection
- Added Sword Sweep protection
- Allowed Foxes to be protected
- Change license to Apache-2.0
- Allowed Horse Based Entities to be protected
v1.0.0
- Initial Release
- Allowed Tamable Entities to be protected
Hi, sorry to bother - is there a way to get this working for Forge in 1.16.5? If there isn't I'll live, but I want to make sure I'm not missing something obvious.
In reply to Incalizymaedriax:
Nope. I can try backporting it later but mo promises.l
In reply to Incalizymaedriax:
Best I can do is 1.17 due to 1.16 not having a code I need for potions.
Edit: Just tried and it's a pain thanks to Forge not working on the latest release of Java. Working around it but now I need to figure out why the revive ability isn't working. Focusing on fixing a new bug on the latest version before trying to backport.
Does this work with modded pets, and is it possible to not hurt each other's tamed mobs as well? Sometimes you just want to punch someone lightly without the wolves swarming them
In reply to chunchunmachu:
It should work with modded pets. If not I can add compatibility for it.
If PvP is disabled on the server, you cannot harm each other pets. You are welcome to suggest changes or features if you want
In reply to chunchunmachu:
I can also setup a configuration value so wolves won't get angered when attacking or attacked by another player if you want.
In reply to SophiaCoxy:
That would be nice. But I think what I'm actually looking for is a feature like ally-shared pets? For example, if one player tamed a horse. anyone you trust can control that horse as if they own it (and also not hurt them). It might not be in the scope of your mod, and currently I just turned-off the pvp and is working fine for now.
In reply to chunchunmachu:
Best I can do is switch owner to whoever right clicks on the entity so it will follow them instead. Can make it an option so it works with PvP disabled (Or vanilla teams once I update that mod).
The Forge beta versions don't seem to work with MC 1.18.1. I get a "needs language provider javafml:40 or above" error.
In reply to AtheoAng3l0:
It's saying it requires Forge Version 40.0.0 minimum. Updated forge please. If you can't get it for 1.18.1, I'll can downgrade the requirements.
In reply to SophiaCoxy:
Yeah. I'll downgrade the requirements. Shouldn't be long.
In reply to AtheoAng3l0:
Uploaded beta.1 which runs on 1.18.1
Does anyone know any alternative for forge 1.18?
In reply to Yupoman21:
I'll start working on a forge port. Hopefully it will only take me a week to do.
In reply to SophiaCoxy:
how far along is that port?
In reply to Jintenzo:
On hold until I can fix my pc. My laptop can't run Minecraft currently. Going to see if I can use someone else's. But I'm on the testing and debugging side of things if my code works.
In reply to Jintenzo:
Forge Port is in Alpha and uploaded. Works on 1.18 and I will try to get it working on previous versions.
Thanks for this mod, since I use Overlord mod with this I don't have to worry about accidentally hurting my skeleton army while fighting anymore.
In reply to LunexLunertic:
I'm glad it helps. Let me know if you notice any bugs between that mod and mine. I'll do my best to fix it.
please i need this mod i dont want to kill my Doggo uin 1.18.1 :'( i even got armor for him :p