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.

andytphan

Members
  • Joined

  • Last visited

Everything posted by andytphan

  1. The path to the json file is pathtomodding/src/main/resources/assests/firstmod/models/items/key.json.
  2. For some reason, my texture isn't loading. This is my main FirstMod.java code. package com.andytphan.firstmod; import com.andytphan.firstmod.ItemKey; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.enchantment.Enchantment; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; @Mod(modid = FirstMod.MODID, version = FirstMod.VERSION) public class FirstMod { public static final String MODID = "firstmod"; public static final String VERSION = "1.0"; public static Item key; @EventHandler public void preInit (FMLPreInitializationEvent event) { key = new ItemKey(); GameRegistry.registerItem(key, "key"); } @EventHandler public void init(FMLInitializationEvent event) { GameRegistry.addRecipe(new ItemStack(Items.apple), "XXX", "XXX", "XXX", 'X', Blocks.leaves ); ItemStack enchantedStoneSword = new ItemStack(Items.stone_sword); enchantedStoneSword.addEnchantment(Enchantment.sharpness, 5); enchantedStoneSword.addEnchantment(Enchantment.knockback, 5); GameRegistry.addShapelessRecipe(enchantedStoneSword, Items.stone_sword, Items.flint, Items.gunpowder); } @EventHandler public void postInit(FMLPostInitializationEvent event) { if(event.getSide() == Side.CLIENT) { RenderItem renderItem = Minecraft.getMinecraft().getRenderItem(); renderItem.getItemModelMesher().register(key, 0, new ModelResourceLocation(MODID + ":" + "key", "inventory")); } } } This is my Key item code. package com.andytphan.firstmod; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; public class ItemKey extends Item { public ItemKey() { GameRegistry.registerItem(this, "key"); setUnlocalizedName(FirstMod.MODID + "_" + "key"); setCreativeTab(CreativeTabs.tabMisc); } } Finally, this is my json file code. { "parent": "builtin/generated", "textures": { "layer0": "firstmod/items:key" }, "display": { "thirdperson": { "rotation": [ -90, 0, 0 ], "translation": [ 0, 1, -3 ], "scale": [ 0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [ 0, -135, 25 ], "translation": [0, 4, 2], "scale": [ 1.7, 1.7, 1.7] } } }

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.