Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Snad

Members
  • Joined

  • Last visited

Everything posted by Snad

  1. i know, but where would it put the tag? The enum? the registry? an entirely new class?
  2. i was using it as an example of the method i had used to get it beforehand. public static final RegistryObject ENCHANTED_PORK = ITEMS.register("enchanted_pork", ItemFoods::new); here it is nonetheless
  3. its for the base items. The items that are used to craft the sword use it.
  4. somewhat self-explanatory. I am making a mod where the item tier is made of items that bear a useless enchant glint, and would like for it to carry over. For the base items i am using import net.minecraft.item.*; public class ItemFoods extends Item { public ItemFoods(){super(new Item.Properties().group(ItemGroup.MATERIALS).food(new Food.Builder().hunger(20).saturation(15.0F).build()));} @Override public boolean hasEffect(ItemStack stack) { return true; } } and my enum file for the tool set is: import net.minecraft.item.IItemTier; import net.minecraft.item.crafting.Ingredient; import net.minecraft.util.IItemProvider; import java.util.function.Supplier; import net.minecraft.item.Items; public enum ModItemTierPork implements IItemTier { PORK(3, 50, 5.0F, 3.0F, 12, () -> {return Ingredient.fromItems((IItemProvider) Items.COOKED_PORKCHOP); }); private final int harvestLevel; private final int maxUses; private final float efficiency; private final float attackDamage; private final int enchantablility; private final Supplier<Ingredient> repairMaterial; ModItemTierPork(int harvestLevel, int maxUses, float efficiency, float attackDamage, int enchantablility, Supplier<Ingredient> repairMaterial) { this.harvestLevel = harvestLevel; this.maxUses = maxUses; this.efficiency = efficiency; this.attackDamage = attackDamage; this.enchantablility = enchantablility; this.repairMaterial = repairMaterial; } @Override public int getMaxUses() { return maxUses; } @Override public float getEfficiency() { return efficiency; } @Override public float getAttackDamage() { return attackDamage; } @Override public int getHarvestLevel() { return harvestLevel; } @Override public int getEnchantability() { return enchantablility; } @Override public Ingredient getRepairMaterial() { return repairMaterial.get(); } my registry for the item is: import com.NoPizzaPlease.smalltweaks.SmallTweaks; import com.NoPizzaPlease.smalltweaks.items.ItemFoods; import com.NoPizzaPlease.smalltweaks.tools.ModItemTierEnc_Pork; import com.NoPizzaPlease.smalltweaks.tools.ModItemTierPork; import com.NoPizzaPlease.smalltweaks.tools.ModItemTierSup_Pork; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; import net.minecraft.item.SwordItem; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public static final RegistryObject<SwordItem> SUP_PORK_SWORD = ITEMS.register("sup_pork_sword", () -> new SwordItem(ModItemTierSup_Pork.SUP_PORK, 3, -1.0F, new Item.Properties().group(ItemGroup.COMBAT).)); i cant figure out where the enchantment glint tag should go. I've tried making a separate class and using the .getclass() attribute but i don't think that will work and i couldn't find the syntax args anywhere. Any help is appreciated. Yes i know my mod is based on pork.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.