Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Item Restrictions Wiki › Guides › Prevent Players from Using a Weapon Against Mobs

Prevent Players from Using a Weapon Against Mobs

Understanding Combat Restrictions

The mod's combat restriction feature stops players from dealing damage to mobs or other players using specific items. This is useful for creating gameplay challenges or enforcing roleplay rules.

Steps

1. Access your mod's configuration file

2. Locate the combat restrictions or item damage restrictions section

3. Add the weapon's registry name to the restricted list

4. Specify whether the restriction applies to mobs, players, or both

5. Save and reload your configuration

How It Works

When a player attempts to hit a mob or player with a restricted weapon, the damage will not be applied. The attack animation may still play, but no health will be removed from the target. This differs from crafting restrictions—the item remains usable for other purposes like breaking blocks or interacting with the environment.

Test by equipping the restricted weapon and attacking a nearby mob. You should see no damage dealt.