Skip to content

Commit

Permalink
cannon makes your arms longer
Browse files Browse the repository at this point in the history
  • Loading branch information
TropheusJ committed Jan 12, 2025
1 parent bcd78cd commit 2ee58a1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,19 @@
import net.fabricmc.fabric.api.loot.v3.LootTableEvents;
import net.minecraft.Util;
import net.minecraft.core.cauldron.CauldronInteraction;
import net.minecraft.core.component.DataComponents;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.entity.EquipmentSlotGroup;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.AttributeModifier.Operation;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.food.Foods;
import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.BucketItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.SignItem;
import net.minecraft.world.item.component.ItemAttributeModifiers;
import net.minecraft.world.item.equipment.ArmorType;
import net.minecraft.world.level.block.DispenserBlock;
import net.minecraft.world.level.storage.loot.BuiltInLootTables;
Expand Down Expand Up @@ -57,6 +63,15 @@ public class PortalCubedItems {

public static final ConstructionCannonItem CONSTRUCTION_CANNON = REGISTRAR.items.create("construction_cannon", ConstructionCannonItem::new)
.properties(s -> s.stacksTo(1).fireResistant())
.properties(p -> p.component(
DataComponents.ATTRIBUTE_MODIFIERS,
ItemAttributeModifiers.builder().add(
Attributes.BLOCK_INTERACTION_RANGE,
new AttributeModifier(ConstructionCannonItem.REACH_BOOST, 2.5, Operation.ADD_VALUE),
EquipmentSlotGroup.MAINHAND
)
.build()
))
.build();

public static final Item LEMON = REGISTRAR.items.create("lemon", Item::new)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import java.util.List;

import io.github.fusionflux.portalcubed.PortalCubed;
import net.minecraft.resources.ResourceLocation;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -47,6 +50,7 @@
import net.minecraft.world.level.levelgen.structure.BoundingBox;

public class ConstructionCannonItem extends Item implements CustomHoldPoseItem {
public static final ResourceLocation REACH_BOOST = PortalCubed.id("construction_cannon_reach_boost");
public static final Component MATERIAL_TOOLTIP = translate("material").withStyle(ChatFormatting.GRAY);
public static final Component CONSTRUCT_TOOLTIP = translate("construct_set").withStyle(ChatFormatting.GRAY);

Expand Down

0 comments on commit 2ee58a1

Please sign in to comment.