Project: Save the Pets!

Project: Save the Pets!

Universal mod

Protect your pets from yourself and give them a second chance at life!


1,303 downloads
28 followers
Created 2 years ago
Updated 2 months ago

External resources



Project members


Technical information

License
Client side
optional
Server side
optional
Project ID

Project: Save the Pets!

Version: 3.2.0
License: Apache-2.0
Client/Server Side: Either (Limited Client features)
Forge/Fabric/Quilt: Any (Forge, Fabric, or Quilt)

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, Fabric, and Quilt 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.19.0+

Fabric

Fabric Loader: 0.14.0+
Fabric API: 0.55.0+

Forge

Forge mod Loader: 41.0.0+

Quilt

Quilt Loader: 0.17.0+
Quilted Fabric API: 2.0.0-beta+

Minecraft Versions

This mod should work with 1.19.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
Lava/Fire ✔️ Yes ❌ No ✔️ Yes
Drowning ✔️ Yes ❌ No ✔️ Yes
Powder Snow ✔️ Yes ❌ No ✔️ Yes
Berry Bushes ✔️ 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,
    // Prevent Fire/Lava damage to pets
    "fireProofPets": false,
    // Prevent drowning damage to pets
    "drownProofPets": false,
    // 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,
    // Stop Berry Bushes from harming pets.
    "preventBerryBushDamage": false,
    // Prevent damage from Powder Snow.
    "preventFreezing": false,
    // 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
  • Set<PetCheckerApi> PET_CHECKER_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
  • projectsavethepets-pca -> PetCheckerApi

Forge

Use the InterModEnqueueEvent to send instances of FriendlyFireBlockerApi, OwnershipRemoverApi, NoteGeneratorApi or PetCheckerApi 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

External resources



Project members


Technical information

License
Client side
optional
Server side
optional
Project ID