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.

TheRedstoneWiz

Members
  • Joined

  • Last visited

  1. I heard that im not supposed to follow youtube tutorials like technovision and harrytalks, but if so, then what is the best way of learning to code and create a minecraft mod? (assuming the person already has basic understanding of Java)
  2. I was following Harry talks tutorial to weapons and tools, and while following, i encountered an error when making the SwordItem on this line: "ItemList.wooden_katana = new SwordItem(ToolMaterialList.katana_wooden_material, -1.0f, 6.0f, new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location(wooden_katana));" At the end of this line, where it says "wooden_katana", it gives the following error: "wooden_katana cannot be resolved to a variable" even though i set the variable in the class "ToolMaterialList". The second error on the line is shown in the typical red underlines from "new SwordItem" to "ItemGroup.Misc))" which says: "The constructor SwordItem(ToolMaterialList, float, float, Item.Properties) is undefined" How do I fix these errors? ToolMaterialList.java package redstonewiz.asianweaponry.lists; import net.minecraft.item.IItemTier; import net.minecraft.item.Item; import net.minecraft.item.crafting.Ingredient; public enum ToolMaterialList implements IItemTier { katana_diamond_material(3.0F, 0.0F, 2000, 3, 14, ItemList.katana_diamond_material), katana_iron_material(2.5F, 0.0F, 2000, 3, 14, ItemList.katana_diamond_material), katana_gold_material(1F, 0.0F, 2000, 3, 14, ItemList.katana_diamond_material), katana_stone_material(2.0F, 0.0F, 2000, 3, 14, ItemList.katana_diamond_material), katana_wooden_material(1.0F, 0.0F, 2000, 3, 14, ItemList.katana_diamond_material); private float attackDamage, efficiency; private int durability, HarvestLevel, enchantibility; private Item repairMaterial; private ToolMaterialList(float attackDamage, float efficiency, int durability, int HarvestLevel, int enchantibility, Item repairMaterial) { // TODO Auto-generated constructor stub this.attackDamage = attackDamage; this.efficiency = efficiency; this.durability = durability; this.HarvestLevel = HarvestLevel; this.enchantibility = enchantibility; this.repairMaterial = repairMaterial; } @Override public int getMaxUses() { // TODO Auto-generated method stub return this.durability; } @Override public float getEfficiency() { // TODO Auto-generated method stub return this.efficiency; } @Override public float getAttackDamage() { // TODO Auto-generated method stub return this.attackDamage; } @Override public int getHarvestLevel() { // TODO Auto-generated method stub return this.HarvestLevel; } @Override public int getEnchantability() { // TODO Auto-generated method stub return this.enchantibility; } @Override public Ingredient getRepairMaterial() { // TODO Auto-generated method stub return Ingredient.fromItems(this.repairMaterial); } } ItemList.java package redstonewiz.asianweaponry.lists; import net.minecraft.item.Item; import net.minecraft.item.SwordItem; public class ItemList { public static Item bluesteel_ingot; public static Item katana_diamond_material; public static SwordItem diamond_katana; public static SwordItem iron_katana; public static SwordItem golden_katana; public static SwordItem stone_katana; public static SwordItem wooden_katana; } AsianWeaponryMod.java (my main) package redstonewiz.asianweaponry; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; import net.minecraft.item.SwordItem; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import redstonewiz.asianweaponry.items.ItemCustomKatana; import redstonewiz.asianweaponry.lists.ItemList; import redstonewiz.asianweaponry.lists.ToolMaterialList; @Mod("asianweaponrymod") public class AsianWeaponryMod { public static AsianWeaponryMod instance; public static final String modid = "asianweaponrymod"; private static final Logger logger = LogManager.getLogger(modid); public AsianWeaponryMod() { instance = this; FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientRegistries); // TODO Auto-generated constructor stub MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { logger.info("Setup method registered"); } private void clientRegistries(final FMLCommonSetupEvent event) { logger.info("clientRegistries method registered"); } @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public static class RegistryEvents { @SubscribeEvent public static void registerItems(final RegistryEvent.Register<Item> event) { event.getRegistry().registerAll ( ItemList.wooden_katana = new SwordItem(ToolMaterialList.katana_wooden_material, -1.0f, 6.0f, new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location(wooden_katana)); logger.info("Items registered."); } private static ResourceLocation location(String name) { return new ResourceLocation(modid, name); } } }
  3. How do i change the attack cooldown of the sword? whenever i try to copy the code for attack speed to my ToolKatana and run it, it still shows the same 1.6 speed. How do i fix this? Here is my code: package com.redstonewiz.ancientweapons.items.tools; import com.google.common.collect.Multimap; import com.redstonewiz.ancientweapons.Main; import com.redstonewiz.ancientweapons.init.ModItems; import com.redstonewiz.ancientweapons.util.IHasModel; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemSword; public class ToolKatana extends ItemSword implements IHasModel { private final float attackDamage; public ToolKatana(String name, ToolMaterial material) { super(material); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(CreativeTabs.COMBAT); this.attackDamage = 10.0F + material.getAttackDamage(); ModItems.ITEMS.add(this); } @Override public void registerModels() { // TODO Auto-generated method stub Main.proxy.registerItemRenderer(this, 0, "inventory"); } @Override public void RegisterModels() { // TODO Auto-generated method stub } public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) { Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot); if (equipmentSlot == EntityEquipmentSlot.MAINHAND) { multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -2.4D, 5)); } return multimap; } }
  4. Are there any ideas for Minecraft mods which haven't been done yet? im struggling to find any good ideas as people have already done everything, but i still have hope that there is still something i can do or take advantage of. Are there any ideas that i can take from the real world? Or from other fictional work. Thank you for your time.

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.