
Everything posted by SuperHB
-
[1.11] [Solved] How do I use BlockStates without metadata?
That was just a typo when copying and pasting to here. It would have given me an error if that was the problem. Here is the EnumHouse code: public enum EnumHouse implements IStringSerializable { ARRYN(0, "arryn", "House Arryn"), BARATHEON(1, "baratheon", "House Baratheon"), BOLTON(2, "bolton", "House Bolton"), FREY(3, "frey", "House Frey"), GREYJOY(4, "greyjoy", "House Greyjoy"), KARSTARK(5, "karstark", "House Karstark"), LANNISTER(6, "lannister", "House Lannister"), MARTELL(7, "martell", "House Martell"), MORMONT(8, "mormont", "House Mormont"), STARK(9, "stark", "House Stark"), TARGARYEN(10, "targaryen", "House Targaryen"), TULLY(11, "tully", "House Tully"), TYRELL(12, "tyrell", "House Tyrell"), UMBER(13, "umber", "House Umber"); private int id; private String nid; private String name; private static final EnumHouse[] VALUES = new EnumHouse[values().length]; EnumHouse (int id, String nid, String name) { this.id = id; this.nid = nid; this.name = name; } @Override public String getName () { return nid; } public static EnumHouse getValue (int id) { return values()[id]; } public static String getNid (int id) { return values()[id].nid; } }
-
[1.11] [Solved] How do I use BlockStates without metadata?
Model file { "textures" : { "base" : "got:blocks/base", "banner_top" : "blocks/debug", "banner_bottom" : "blocks/debug", "particle" : "got:blocks/base" }, "elements" : [ { "from" : [ 2, 17, 10 ], "to" : [ 14, 30, 11 ], "name" : "banner_top", "faces" : { "down" : { "uv" : [ 1, 14, 13, 15 ], "texture" : "#banner_top" }, "south" : { "uv" : [ 1, 1, 13, 14 ], "texture" : "#banner_top" }, "east" : { "uv" : [ 0, 1, 1, 14 ], "texture" : "#banner_top" }, "west" : { "uv" : [ 13, 1, 14, 14 ], "texture" : "#banner_top" }, "up" : { "uv" : [ 1, 0, 13, 1 ], "texture" : "#banner_top" }, "north" : { "uv" : [ 1, 1, 13, 14 ], "texture" : "#banner_bottom" } } } ], "display" : { "thirdperson_righthand" : { "rotation" : [ 75, 180, 0 ], "translation" : [ 0, 2.5, 0 ], "scale" : [ 0.375, 0.375, 0.375 ] }, "firstperson_lefthand" : { "rotation" : [ 0, 225, 0 ], "translation" : [ 0, 0, 0 ], "scale" : [ 0.4, 0.4, 0.4 ] }, "fixed" : { "rotation" : [ 0, 0, 0 ], "translation" : [ 0, 0, 0 ], "scale" : [ 1, 1, 1 ] }, "ground" : { "rotation" : [ 0, 0, 0 ], "translation" : [ 0, 3, 0 ], "scale" : [ 1, 1, 1 ] }, "firstperson_righthand" : { "rotation" : [ 0, 180, 0 ], "translation" : [ 0, 0, 0 ], "scale" : [ 0.8, 0.8, 0.8 ] }, "gui" : { "rotation" : [ 30, 315, 0 ], "translation" : [ 0, 0, 0 ], "scale" : [ 0.625, 0.625, 0.625 ] } } } Blockstate file { "forge_marker" : 1, "variants" : { "house" : { "arryn" : { "textures" : { "banner_top" : "got:blocks/arryn", "banner_bottom" : "got:blocks/arryn" } }, "umber" : { "textures" : { "banner_top" : "got:blocks/banner", "banner_bottom" : "got:blocks/banner" } }, "martell" : { "textures" : { "banner_top" : "got:blocks/banner", "banner_bottom" : "got:blocks/banner" } }, "greyjoy" : { "textures" : { "banner_top" : "got:blocks/banner", "banner_bottom" : "got:blocks/banner" } }, "tully" : { "textures" : { "banner_top" : "got:blocks/banner", "banner_bottom" : "got:blocks/banner" } }, "bolton" : { "textures" : { "banner_top" : "got:blocks/banner", "banner_bottom" : "got:blocks/banner" } }, "targaryen" : { "textures" : { "banner_top" : "got:blocks/banner", "banner_bottom" : "got:blocks/banner" } }, "stark" : { "textures" : { "banner_top" : "got:blocks/banner", "banner_bottom" : "got:blocks/banner" } }, "frey" : { "textures" : { "banner_top" : "got:blocks/banner", "banner_bottom" : "got:blocks/banner" } }, "tyrell" : { "textures" : { "banner_top" : "got:blocks/banner", "banner_bottom" : "got:blocks/banner" } }, "karstark" : { "textures" : { "banner_top" : "got:blocks/banner", "banner_bottom" : "got:blocks/banner" } }, "baratheon" : { "textures" : { "banner_top" : "got:blocks/banner", "banner_bottom" : "got:blocks/banner" } }, "mormont" : { "textures" : { "banner_top" : "got:blocks/banner", "banner_bottom" : "got:blocks/banner" } }, "lannister" : { "textures" : { "banner_top" : "got:blocks/banner", "banner_bottom" : "got:blocks/banner" } } }, "hanging" : { "false" : { "base" : "got:blocks/base" }, "true" : { "base" : "got:blocks/base" } } } }
-
[1.11] [Solved] How do I use BlockStates without metadata?
How can you tell? Also, don't use ITileEntityProvider. Override the hasTileEntity and getTileEntity methods that are in the Block class. In the model i set the texture in the model to blocks/debug, in the variant all other variants are set to white wool, variant arryn is set to red wool. Anytime I place the block it uses the debug texture. I tried removing the texture thinking maybe that it was just overriding the variant texture but it didn't.
-
[1.11] [Solved] How do I use BlockStates without metadata?
I've been trying to use getActualState that returns the state the withProperty. I originally had a TileEntity to set which property to use with NBT Tags but the model wasn't changing, so I decided to set the property manually like so: @Override public IBlockState getActualState (IBlockState state, IBlockAccess worldIn, BlockPos pos) { return state.withProperty(HOUSE, EnumHouse.STARK); } This didn't seem to change the state either, then I noticed that it wasn't using the default state either. Here is everything I have so far: Block class public class BlockBanner extends Block implements ITileEntityProvider { public static final PropertyEnum HOUSE = PropertyEnum.create("house", EnumHouse.class); public BlockBanner (Material material) { super(material); setDefaultState(blockState.getBaseState().withProperty(HOUSE, EnumHouse.ARRYN)); isBlockContainer = true; } @Override public ItemStack getPickBlock (IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) { return new ItemStack(Item.getItemFromBlock(this), 1, getMetaFromState(world.getBlockState(pos))); } @Override protected BlockStateContainer createBlockState () { return new BlockStateContainer(this, new IProperty[] { HOUSE }); } @Override public IBlockState getStateFromMeta (int meta) { return getDefaultState(); } @Override public int getMetaFromState (IBlockState state) { return 0; } @Override public IBlockState getActualState (IBlockState state, IBlockAccess worldIn, BlockPos pos) { return state.withProperty(HOUSE, EnumHouse.ARRNY); } @Override public int damageDropped (IBlockState state) { return getMetaFromState(state); } @Override public void breakBlock (World world, BlockPos pos, IBlockState state) { super.breakBlock(world, pos, state); world.removeTileEntity(pos); } // didn't do anything either @Override public IBlockState onBlockPlaced (World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return getStateFromMeta(meta).withProperty(HOUSE, EnumHouse.ARRYN); } @Override public boolean eventReceived (IBlockState state, World world, BlockPos pos, int eventID, int eventParam) { super.eventReceived(state, world, pos, eventID, eventParam); TileEntity tile = world.getTileEntity(pos); return tile == null ? false : tile.receiveClientEvent(eventID, eventParam); } @Override public boolean hasTileEntity (IBlockState state) { return true; } @Override public TileEntity createNewTileEntity (World world, int meta) { return new TileEntityBanner(); } } How do I go about doing this, as from what I could gather from other questions, all I needed was getActualState, getStateFromMeta, getMetaFromState.
-
[1.11] Animating blocks.
The Minecraft Forge GitHub has an example for this here: https://github.com/MinecraftForge/MinecraftForge/blob/1.11.x/src/test/java/net/minecraftforge/debug/ModelAnimationDebug.java Here is the resources for the code above: https://github.com/MinecraftForge/MinecraftForge/tree/1.11.x/src/test/resources/assets/forgedebugmodelanimation There is still a bug that it doesn't rotate anywhere else except at the origin.
-
[1.10.2] Change damage of explosion
The problem with changing the strength of the explosion below 2 is not only particle effect though. It also changed the radius of the explosion.
-
What am I supposed to name my texture files?
Here's my code. I hope I did it right. I got an error message on new ModelResourceLocation(chainMail.getRegistryName()); It says, "The constructor ModelResourceLocation(ResourceLocation) is undefined". What do I do now? The constructor your using takes a string and your giving it a ResourceLocation. All you have to do is add a comma and add the string "inventory" after the comma like so: ModelResourceLocation chainMailLocation = new ModelResourceLocation(chainMail.getRegistryName(), "inventory"); or do what Draco18s suggested
-
[1.10.2] Is there a simple tutorial for creating items?
MrCrayFish has a tutorial for Minecraft 1.9 that works with 1.10. You can find it here: I'm not sure if he still does this but dont use getUnlocalizedName().substring(5), instead use getRegistryName() instead (After you set the registry name of course).
-
Multiple Creative Tabs in Same Class
When I create a Creative Tab for my mod I just have it has a variable in my main class like so public class Main { public static CreativeTabs tab = new CreativeTabs("tab") { public Item getTabIconItem () { return ModItems.AN_ITEM; } }; } I don't need it to place it in one of FML's initialization events. Maybe try that and see if it fixes your problem.
-
[1.10.2] Change damage of explosion
When I use spawn Explosion_Large/Normal/Huge it doesn't spawn anything. Also how would that change the damage of the explosion other than give off no damage at all?
-
[1.10.2] Change damage of explosion
I think he's asking how to change how much damage the explosion does to entities, without affecting block damage? No, when changing the strength of the explosion, it creates little to no particles basically looking like nothing exploded if I made the strength less than 2, and with the strength at 2 the damage is half health to full damage on a player. I was wondering if I can change the damage value of the explosion (ex: doing only 3 hearts of damage instead) without having to change the strength.
-
[1.10.2] Change damage of explosion
I'm currently creating a projectile that when it hits anything, it explodes. I was wondering if it was possible to change the damage value of the explosion that the projectile creates. Currently I'm just using world.createExplosion with a strength of 2. But when I change it to anything below 2 it just a smaller explosion particle (which I don't want).
-
[1.10.2] [SOLVED] Can't set blockstate after block is placed
Lets only do this on the client because the server has control over everything. Why? Raisins. I'm stupid... thank you
-
[1.10.2] [SOLVED] Can't set blockstate after block is placed
When I place down a block and right click it, I want to change the blockstate. But when I right click the block, it changes blockstates for a second before switching back. Here is the code: Block public class BlockSentry extends Block implements ISpecialBlock, ITileEntityProvider { public static final PropertyEnum LEVEL = PropertyEnum.create("level", BlockSentry.EnumLevel.class); public static final PropertyEnum TEAM = PropertyEnum.create("team", EnumTeam.class); public BlockSentry (Material material) { super(material); setDefaultState(blockState.getBaseState().withProperty(LEVEL, EnumLevel.ONE).withProperty(TEAM, EnumTeam.BLU)); } @Override protected BlockStateContainer createBlockState () { return new BlockStateContainer(this, new IProperty[] { LEVEL, TEAM }); } @Override public IBlockState getStateFromMeta (int meta) { switch (meta) { case 0: return getDefaultState().withProperty(LEVEL, EnumLevel.MINI).withProperty(TEAM, EnumTeam.BLU); case 1: return getDefaultState().withProperty(LEVEL, EnumLevel.ONE).withProperty(TEAM, EnumTeam.BLU); case 2: return getDefaultState().withProperty(LEVEL, EnumLevel.TWO).withProperty(TEAM, EnumTeam.BLU); case 3: return getDefaultState().withProperty(LEVEL, EnumLevel.THREE).withProperty(TEAM, EnumTeam.BLU); case 4: return getDefaultState().withProperty(LEVEL, EnumLevel.MINI).withProperty(TEAM, EnumTeam.RED); case 5: return getDefaultState().withProperty(LEVEL, EnumLevel.ONE).withProperty(TEAM, EnumTeam.RED); case 6: return getDefaultState().withProperty(LEVEL, EnumLevel.TWO).withProperty(TEAM, EnumTeam.RED); case 7: return getDefaultState().withProperty(LEVEL, EnumLevel.THREE).withProperty(TEAM, EnumTeam.RED); } return getDefaultState().withProperty(LEVEL, EnumLevel.MINI).withProperty(TEAM, EnumTeam.BLU); } @Override public boolean onBlockActivated (World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (worldIn.isRemote) { TileEntity tile = worldIn.getTileEntity(pos); if (tile instanceof TileEntitySentry) { TileEntitySentry sentry = (TileEntitySentry)tile; if (heldItem != null) { if (heldItem.getItem() == TFCItems.wrench) { worldIn.setBlockState(pos, getStateFromMeta(6)); } } } } return true; } @Override public TileEntity createNewTileEntity (World worldIn, int meta) { return new TileEntitySentry(meta); } } TileEntity public class TileEntitySentry extends TileEntity { public static int level; private static int meta; public TileEntitySentry (int meta) { level = getLevelFromMeta(meta); this.meta = meta; } public void setLevel (int level) { this.level = level; } public int getLevel () { return level; } public int getMeta () { return meta; } @Override public NBTTagCompound writeToNBT (NBTTagCompound compound) { super.writeToNBT(compound); compound.setTag("sentry", new NBTTagList()); NBTTagCompound sentry = compound.getCompoundTag("sentry"); sentry.setInteger("level", level); return compound; } @Override public void readFromNBT (NBTTagCompound compound) { super.readFromNBT(compound); level = compound.getInteger("level"); } private int getLevelFromMeta (int meta) { switch (meta) { case 0: return 0; case 1: return 1; case 2: return 2; case 3: return 3; case 4: return 0; case 5: return 1; case 6: return 2; case 7: return 3; } return 0; } @Override public boolean shouldRefresh (World world, BlockPos pos, IBlockState old, IBlockState newState) { return false; } }
-
1.10.2 CraftingManager Error
Use addRecipe. Also if you don't want to restrict the items to only beable to be placed in the center of the crafting table remove the blank strings.
-
[1.10.2] Animated Block is only animated in inventory
I've fixed the problem. Apparently it only works when I use the facing and static variant for the block state.
-
[1.10.2] Animated Block is only animated in inventory
bump
-
[1.10.2] Item 3D rendering
If I'm reading this correctly, it probably has to do with the rotation of the block in the inventory try adding this to the top of your model json "parent": "block/block",
-
[1.10.2] Animated Block is only animated in inventory
Still doesn't work even if I switch it
-
[1.10.2] Animated Block is only animated in inventory
Sorry about that, I just used MrCrayFish's old tutorial around a year ago to update another mod and I just stuck with that format ever since. I'll switch as soon as I get this to work.
-
[1.10.2] Animated Block is only animated in inventory
- [1.10.2] Animated Block is only animated in inventory
I'm currently trying to use the animation system to move the sentry gun back and forth which I got it to animate in my inventory, but when I place it down its just a static block. All I did was just copy the code from the MinecraftForge GitHub on this but I can't figure out why this is happening. Here is the code: Main @Mod(modid = Refrence.MODID, name = Refrence.MODID, version = Refrence.VERSION) public class Main { @SidedProxy(clientSide = Refrence.CLIENT_PROXY, serverSide = Refrence.COMMON_PROXY) public static CommonProxy proxy; @Instance(Refrence.MODID) public static Main instance; @EventHandler public void preInit (FMLPreInitializationEvent event) { TFCBlocks.init(); TFCBlocks.register(); proxy.init(); ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySentry.class, new AnimationTESR<TileEntitySentry>() { @Override public void handleEvents(TileEntitySentry te, float time, Iterable<Event> pastEvents) { super.handleEvents(te, time, pastEvents); te.handleEvents(time, pastEvents); } }); } @EventHandler public void init (FMLInitializationEvent event) { GameRegistry.registerTileEntity(TileEntitySentry.class, Refrence.MODID + ":sentry_tile"); } } ClientProxy public class ClientProxy extends CommonProxy { @Override public void init () { TFCBlocks.registerRenders(); } @Override public IAnimationStateMachine load(ResourceLocation location, ImmutableMap<String, ITimeValue> parameters) { return ModelLoaderRegistry.loadASM(location, parameters); } } TFCBlocks public class TFCBlocks { public static Block sentry; public static void init () { sentry = new BlockSentry(Material.IRON).setUnlocalizedName("sentry").setCreativeTab(tab); } public static void register () { //registerBlock(sentry); GameRegistry.register(sentry.setRegistryName(sentry.getUnlocalizedName().substring(5))); ItemBlockSentry sen = new ItemBlockSentry(sentry); sen.setRegistryName(sentry.getRegistryName()); GameRegistry.register(sen); } public static void registerRenders () { registerRender(sentry); } public static void registerRender (Block block) { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(Refrence.MODID + ":" + block.getUnlocalizedName().substring(5), "inventory")); } } BlockSentry public class BlockSentry extends Block implements ITileEntityProvider { public BlockSentry(Material materialIn) { super(materialIn); } @Override public boolean isFullCube (IBlockState state) { return false; } @Override public boolean isOpaqueCube (IBlockState state) { return false; } @Nonnull @Override protected ExtendedBlockState createBlockState () { //return new ExtendedBlockState(this, new IProperty[] { Properties.StaticProperty }, new IUnlistedProperty[] { Properties.AnimationProperty }); return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] { Properties.AnimationProperty }); } @Override public boolean hasTileEntity (IBlockState state) { return true; } @Override public TileEntity createNewTileEntity (World worldIn, int meta) { return new TileEntitySentry(); } } TileEntitySentry public class TileEntitySentry extends TileEntity { private final IAnimationStateMachine stateMachine; private final VariableValue cycleLength = new VariableValue(4); private final VariableValue clickTime = new VariableValue(Float.NEGATIVE_INFINITY); public TileEntitySentry () { stateMachine = Main.proxy.load(new ResourceLocation(Refrence.MODID, "asms/block/sentry.json"), ImmutableMap.<String, ITimeValue>of("cycle_length", cycleLength, "click_time", clickTime)); } public void handleEvents (float time, Iterable<Event> pastEvents) { for (Event event : pastEvents) { System.out.println("Event: " + event.event() + " " + event.offset() + " " + getPos() + " " + time); } } @Override public boolean hasFastRenderer() { return true; } public void click (boolean sneaking) { if (stateMachine != null) { if (sneaking) { cycleLength.setValue(6 - cycleLength.apply(0)); } else if (stateMachine.currentState().equals("default")) { float time = Animation.getWorldTime(getWorld(), Animation.getPartialTickTime()); clickTime.setValue(time); stateMachine.transition("starting"); } else if (stateMachine.currentState().equals("moving")) { clickTime.setValue(Animation.getWorldTime(getWorld(), Animation.getPartialTickTime())); stateMachine.transition("stopping"); } } } @Override public boolean hasCapability(Capability<?> capability, EnumFacing facing) { if (capability == CapabilityAnimation.ANIMATION_CAPABILITY) return true; return super.hasCapability(capability, facing); } @Override public <T> T getCapability(Capability<T> capability, EnumFacing facing) { if (capability == CapabilityAnimation.ANIMATION_CAPABILITY) return CapabilityAnimation.ANIMATION_CAPABILITY.cast(stateMachine); return super.getCapability(capability, facing); } } ItemBlockSentry public class ItemBlockSentry extends ItemBlock { public ItemBlockSentry (Block block) { super(block); } @Override public ICapabilityProvider initCapabilities (ItemStack stack, NBTTagCompound nbt) { return new ItemAnimationHolder(); } } ItemAnimationHolder public class ItemAnimationHolder implements ICapabilityProvider { private final VariableValue cycleLength = new VariableValue(4); private final IAnimationStateMachine asm = Main.proxy.load(new ResourceLocation(Refrence.MODID, "asms/block/sentry.json"), ImmutableMap.<String, ITimeValue>of("cycle_length", cycleLength)); public boolean hasCapability (Capability<?> capability, EnumFacing facing) { return capability == CapabilityAnimation.ANIMATION_CAPABILITY; } public <T> T getCapability (Capability<T> capability, EnumFacing facing) { if (capability == CapabilityAnimation.ANIMATION_CAPABILITY) return CapabilityAnimation.ANIMATION_CAPABILITY.cast(asm); return null; } } armatures/block/sentry_gun { "joints": { "back": { "2": [1.0] }, "gun": { "0": [1.0] }, "barrel": { "1": [1.0] } }, "clips": { "default": { "loop": false, "joint_clips": {}, "events": {} }, "moving": { "loop": true, "joint_clips": { "back": [{ "variable": "axis_y", "type": "uniform", "interpolation": "nearest", "samples": [1] }, { "variable": "angle", "type": "uniform", "interpolation": "linear", "samples": [ 0, 120, 240, 0, 120, 240, 0, 120, 240, 0, 120, 240 ] }], "gun": [{ "variable": "axis_y", "type": "uniform", "interpolation": "nearest", "samples": [1] }, { "variable": "angle", "type": "uniform", "interpolation": "linear", "samples": [ 0, 120, 240, 0, 120, 240, 0, 120, 240, 0, 120, 240 ] }], "barrel": [{ "variable": "axis_y", "type": "uniform", "interpolation": "nearest", "samples": [1] }, { "variable": "angle", "type": "uniform", "interpolation": "linear", "samples": [ 0, 120, 240, 0, 120, 240, 0, 120, 240, 0, 120, 240 ] }] }, "events": { "0.5": "boop" } } } } asms/block/sentry { "parameters": { "world_to_cycle": [ "/", "#cycle_length"], "round_cycle": [ "compose", [ "R", "#cycle_length" ], "#click_time" ], "end_cycle": [ "-", "#round_cycle" ] }, "clips": { "default": "tfc:block/sentry_gun@default", "starting": [ "trigger_positive", "#default", "#end_cycle", "!transition:moving" ], "moving": [ "apply", "tfc:block/sentry_gun@moving", "#world_to_cycle" ], "stopping": [ "trigger_positive", "#moving", "#end_cycle", "!transition:default" ] }, "states": [ "default", "starting", "moving", "stopping" ], "transitions": { "default": "starting", "starting": [ "moving" ], "moving": "stopping", "stopping": "default" }, "start_state": "moving" } blockstate/sentry { "forge_marker": 1, "variants": { "normal": [{ "model": "tfc:sentry", "submodel": { "gun": { "model": "tfc:sentry_gun" } }, "textures": { "color": "tfc:blocks/sentry_blue" } }], "inventory": [{ "model": "tfc:sentry", "submodel": { "gun": { "model": "tfc:sentry_gun" } }, "textures": { "color": "tfc:blocks/sentry_blue" } }] } }- [1.10.2] Items with metadata dont have textures
Putting it in preInit fixed it. Thank you- [1.10.2] Items with metadata dont have textures
Here is the json models pda.json { "parent": "item/generated", "textures": { "layer0": "tfc:items/pda_0" } } pda_0.json { "parent": "item/generated", "textures": { "layer0": "tfc:items/pda_0" } } pda_1.json { "parent": "item/generated", "textures": { "layer0": "tfc:items/pda_1" } } I also changed the code: public static void registerRenders () { ModelLoader.setCustomModelResourceLocation(pda, 0, new ModelResourceLocation(Refrence.MODID + ":pda_0", "inventory")); ModelLoader.setCustomModelResourceLocation(pda, 1, new ModelResourceLocation(Refrence.MODID + ":pda_1", "inventory")); } still no textures- [1.10.2] Items with metadata dont have textures
I'm currently trying to make an item with a subtype and they don't have textures on them. Here is my code: Item Code public class ItemPDA extends Item { public ItemPDA () { maxStackSize = 1; setHasSubtypes(true); setMaxDamage(0); } @Override public String getUnlocalizedName(ItemStack stack) { return super.getUnlocalizedName(stack) + "_" + stack.getMetadata(); } @SideOnly(Side.CLIENT) @Override public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) { for (int i = 0; i < 1; i++) { subItems.add(new ItemStack(itemIn, 1, i)); } } } public class TFCItems { public static Item pda; public static void init () { pda = new ItemPDA().setUnlocalizedName("pda").setCreativeTab(tab); } public static void register () { registerItem(pda); } public static void registerItem (Item item) { GameRegistry.register(item.setRegistryName(item.getUnlocalizedName().substring(5))); } public static void registerRenders () { Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(pda, 0, new ModelResourceLocation(Refrence.MODID + ":pda_0", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(pda, 1, new ModelResourceLocation(Refrence.MODID + ":pda_1", "inventory")); } } In the console it shows that the model pda.json isn't found but when I do make it, it doesn't use the texture defined by the model file. How would I go about fixing this? - [1.10.2] Animated Block is only animated in inventory
IPS spam blocked by CleanTalk.
Important Information
By using this site, you agree to our Terms of Use.