All Mods Resource Packs Data Packs Shaders Modpacks Plugins
Defense

Defense

by Knarfy • Downloads: 0 • Followers: 0
Description
Gallery
Changelog
Versions

Defense

A mod designed to protect players from unwanted PvP interactions while still allowing PvP on servers!

Originally created for and tested by the Empty World SMP

SHOWCASE VIDEO:

Features

  • This mod adds a PvP toggle button in the survival player inventory.
  • When checked on, the player is now immune to all incoming PvP damage. Examples include direct attacks, projectiles, and lit TNT. This also disables the same outgoing attacks from the player. They cannot recieve damage from players or deal damage to players while toggled on.
  • When toggled on, Defense lasts for 20 minutes. One minute before the player's immunity runs out, they will be notified with a chat message prompting them to enable it again if they wish. The player may also enable or disable defense anytime they wish to reset the cooldown.
  • If a player's defense is toggled on, a shield icon will display next to their nametag.
  • You can change the icon you are displaying to others and that shows on your toggle switch in your Skin Customization Settings.
  • AFK system that will toggle on Defense after 1 minute to prevent players from attacking you. Use the afkTimerSeconds gamerule to change the time it takes to toggle AFK (set to 0 to disable this feature). Still very early, but improvements and changes will be made over time!

    Available Icons:

    Available Icons

(These Icons are selectable via the Skin Customization Settings within Minecraft)

More features are planned, and updates will add new functionality to the mod, along with quality of life changes to make it even better to use.

Why the 20 Minute Timer?

The 20 minute timer for defense naturally encourages players to keep defense toggled off most of the time. This provides for the occasional funny interaction with another player, like an accidental punch, or for a challenge during a PvE battle to not hit your friends. It is meant to be used as a tool to defend against an unwanted interaction rather than something to give a competitive advantage.

For more information on this mod, and access to the code, go to this mod's GitHub page!

How to Install Defense (Mod)

Defense by Knarfy is verified for Fabric across Minecraft versions 1.21, 1.21.1, 1.21.11, 1.21.4, 1.21.5, 1.21.6 (latest release: 1.21.11-0.5.0, file size: 758 KB). Follow the steps below to install it safely from ModCraft.tv:

  1. Click the Download button above and select your Minecraft version (1.21, 1.21.1, 1.21.11, 1.21.4, 1.21.5, 1.21.6) and platform (Fabric).
  2. Make sure you have the compatible loader or environment installed for Fabric.
  3. Move the downloaded Defense file into your Minecraft .minecraft/mods folder and launch the game.

All Versions

+ Add Version
Name Game version Platforms Published Downloads Actions
1.21.11
Fabric
10mo ago 1
1.21.6
Fabric
last yr. 1
1.21.5
Fabric
last yr. 1
1.21.4
Fabric
last yr. 1
1.21.x
Fabric
last yr. 1
1.21.x
Fabric
last yr. 1
1.21.x
Fabric
last yr. 1
1.21.x
Fabric
last yr. 1
1.21.x
Fabric
last yr. 1
1.21.x
Fabric
last yr. 1
1.21
Fabric
last yr. 1
1.21
Fabric
last yr. 1
  • Updated to 1.21.11
  • Fixed a bug with the defense button in the inventory
  • Renamed all the gamerules to fit the new gamerule namespacing system
Updated to 1.21.6
  • Updated to 1.21.5
  • Added French localization
  • Updated some English localization
Updated to 1.21.4
Fixed a bug preventing the players tab list from correctly rendering scoreboard
  • Fixed a bug with the icon next the player's name in the dark
  • Fixed a typo in the allowDefenseKeybind gamerule description
  • Fixed some Issues with the AFK System
  • Added Keybind for Defense (Under the Multiplayer Section)
  • Added /afk command
  • Added /defense command
  • /defense (playername) (on/off/refresh)
  • /defense (on/off/refresh)
  • Added pet and mount protection
  • Added visual indicator to defense button in inventory to show how much time is left
  • Added Gamerules
  • afkTimerSeconds (time in seconds)
  • allowDefenseKeybind (true/false)
  • defenseDurationMinutes (time in minutes)
  • mountsProtected (true/false)
  • petsProtected (true/false)
  • Fixed various bugs!
Fixed the bug described in 1.21-0.3.0-BETA1
## **NEW BETA FEATURE:** The AFK System
When a player has been AFK for 1 minute, the mod will now toggle Defense on and display a new AFK GUI to tell them they are AFK. Clicking "Back to Game" will close the GUI and toggle off Defense.

This new system is subject to change! We're laying the groundworks for this and will continue to add improvements and features as we see the need.

  • KNOWN BUG:**\
The AFK system will trigger when the player is in their ESC menu, even if the player is adjusting settings, and will open the AFK Screen. This will be addressed in the future!


### Regular Changelog
  • Improved icon selection menu
  • Icon opacity fixed behind blocks
  • Added new icons
  • Brand new icon selection menu
  • Fixed icon rendering bugs with water and behind walls
  • Added a server side verification to force the mod installation on the clients
  • Fixed a critical bug that was synchronizing PVP of all players and spamming messages in chat
  • = **Initial Release** =-
  • Added Defense System
  • Toggle switch in player inventory
  • Protects player from incoming player damage (including projectiles & TNT)
  • Prevents player from damaging other players
  • Defense Lasts for 20 minutes
  • Chat message notification will notify player and give them the opportunity to reset their timer
  • Displays custom shield icon next to nametag in-game
  • Same shield icon will sync between inventory toggle and nametag
  • Each player can select their own icon to display to other players
  • Adds Shield selection button in "Skin Customization"
  • 21 icons available at launch
  • Shield icons are cosmetic and do not provide any gameplay advantage. They just look cool!
Defense Icon
Download Defense
Select game version
Select platform