@@ -33,6 +33,8 @@ public class ShieldEvents {
3333 public static final UUID SPEED_MODIFIER_ID = UUID .fromString ("3c1b8a2e-3c62-4f5c-9e9a-5b92fcae4d2c" );
3434
3535 public static boolean onStartUsing (Entity entity , ItemStack stack ) {
36+ if (ShieldExpansionConfig .ITEM_ONLY_MODE ) return false ;
37+
3638 Item item = stack .getItem ();
3739 if (entity instanceof Player player && player .getCooldowns ().isOnCooldown (item )) {
3840 return true ;
@@ -63,6 +65,8 @@ public static boolean onStartUsing(Entity entity, ItemStack stack) {
6365 }
6466
6567 public static void onStopUsing (Entity entity , ItemStack stack ) {
68+ if (ShieldExpansionConfig .ITEM_ONLY_MODE ) return ;
69+
6670 Item item = stack .getItem ();
6771 if (entity instanceof Player player && ShieldExpansionConfig .isShield (item )) {
6872 removeBlocking (player );
@@ -72,6 +76,8 @@ public static void onStopUsing(Entity entity, ItemStack stack) {
7276 }
7377
7478 public static void onUseTick (Entity entity , ItemStack stack ) {
79+ if (ShieldExpansionConfig .ITEM_ONLY_MODE ) return ;
80+
7581 Item item = stack .getItem ();
7682 if (entity instanceof Player player && ShieldExpansionConfig .isShield (item ) && LivingEntityAccess .get (player ).getBlocking () && player .attackAnim > 0 ) {
7783 removeBlocking (player );
@@ -82,6 +88,8 @@ public static void onUseTick(Entity entity, ItemStack stack) {
8288 }
8389
8490 public static void onPlayerTick (Player player ) {
91+ if (ShieldExpansionConfig .ITEM_ONLY_MODE ) return ;
92+
8593 Item item = player .getUseItem ().getItem ();
8694 Item lastShield = LivingEntityAccess .get (player ).getLastShield ().getItem ();
8795
@@ -104,6 +112,8 @@ public static void onPlayerTick(Player player) {
104112 }
105113
106114 public static boolean onLivingHurt (LivingEntity entity , DamageSource source , float amount ) {
115+ if (ShieldExpansionConfig .ITEM_ONLY_MODE ) return false ;
116+
107117 if (!(entity instanceof Player player )) return false ;
108118
109119 if (validateBlocking (player ) && (source .getMsgId ().equals ("player" ) || source .getMsgId ().equals ("mob" ))) {
@@ -194,6 +204,8 @@ private static void handleExplosion(Player player, DamageSource source, float am
194204 }
195205
196206 public static boolean onProjectileImpact (Entity entity , Entity projectile ) {
207+ if (ShieldExpansionConfig .ITEM_ONLY_MODE ) return false ;
208+
197209 if (entity instanceof Player player && validateBlocking (player )) {
198210 Item item = player .getUseItem ().getItem ();
199211 player .level ().playSound (null , player .getOnPos (), SoundEvents .SHIELD_BLOCK , SoundSource .HOSTILE , 1.0f , 1.0f );
0 commit comments