diff --git a/src/main/java/net/ugi/sculk_depths/portal/Portals.java b/src/main/java/net/ugi/sculk_depths/portal/Portals.java index c4f86086..e13892f9 100644 --- a/src/main/java/net/ugi/sculk_depths/portal/Portals.java +++ b/src/main/java/net/ugi/sculk_depths/portal/Portals.java @@ -4,6 +4,7 @@ import net.kyrptonaught.customportalapi.api.CustomPortalBuilder; import net.kyrptonaught.customportalapi.portal.PortalIgnitionSource; import net.minecraft.block.Blocks; +import net.minecraft.item.ItemStack; import net.minecraft.util.Identifier; import net.ugi.sculk_depths.item.ModItems; @@ -18,8 +19,11 @@ public static void registerModPortals() { .setPortalSearchYRange(0,120) .registerIgniteEvent((player, world, portalPos, framePos, portalIgnitionSource) -> { if (portalIgnitionSource.sourceType == PortalIgnitionSource.SourceType.USEITEM && player != null) { - if(player.isCreative()) return; - player.getMainHandStack().decrement(1); + if (player.isCreative()) + return; + ItemStack heldItem = player.getMainHandStack().getItem() == ModItems.SOUL_HEART ? + player.getMainHandStack() : player.getOffHandStack(); + heldItem.decrement(1); } }) .registerPortal();