Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.8] My Item got no Texture and name


kriegnes
 Share

Recommended Posts

I really hate this update xD

I already modded in 1.7 and had no problems but now my item got no texture and its name is wrong.

My codes:

main code:

http://pastebin.com/137hyyXc

Item code:

http://pastebin.com/NkBNT11M

json:

http://pastebin.com/PaAhLdfc

 

I hope somebody can help me. its probably something really stupid like always xD i think i wrote something in caps but i cant find the mistake :/

Im not a native speaker so plserino no haterino

Link to comment
Share on other sites

yeah i forgot about the en_US.lang :P

i couldnt find anything wrong with the names so i deleted something and downloaded the workspace from then tutorial i watched. first it worked but then i changed a bit and it stopped working. i downloaded it again but now, even if i change nothing, the item is missing. (the other items are still there)

looks like i will just delete everything and not only src. good that i still got my 1.7.10 version :P

Im not a native speaker so plserino no haterino

Link to comment
Share on other sites

1.7.10 version you need to use IIcon for texture. You need a png file as assets/<your_mode_name>/textures/items/<your_item_name>.png.

 

This is the code for giving texture;

	@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister reg) {
	this.itemIcon = reg.registerIcon(ref.uid + ":" + (this.getUnlocalizedName().substring(5)));
}

 

Or you can only use this.setTextureName when you register item.

 

Also maybe you forgot to register item like; GameRegistry.registerItem(<item_uid>, "<item_name>");

 

There can be many mistakes, if you explain what the problem is and what you changed clearly, we can help you.

Link to comment
Share on other sites

1.7.10 version you need to use IIcon for texture. You need a png file as assets/<your_mode_name>/textures/items/<your_item_name>.png.

 

This is the code for giving texture;

	@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister reg) {
	this.itemIcon = reg.registerIcon(ref.uid + ":" + (this.getUnlocalizedName().substring(5)));
}

 

Or you can only use this.setTextureName when you register item.

 

Also maybe you forgot to register item like; GameRegistry.registerItem(<item_uid>, "<item_name>");

 

There can be many mistakes, if you explain what the problem is and what you changed clearly, we can help you.

Please, look at the title...

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

pastebin is blocked by my network server so I can't see your code, if you paste it here, I can help you better, ah sorry I answered you question for 1.7.10 because you said I still got 1.7.10 so I think you use it, ok for 1.8 my item class is this;

 

package net.extend.mod.functions;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class additem extends Item {

public additem(int stack, String name, CreativeTabs tab, boolean craftReturn) {
	super();

	this.setMaxStackSize(stack);
	this.setCreativeTab(tab);
	this.setUnlocalizedName(name);
		if (craftReturn) {
			this.setContainerItem(this);
		}
	GameRegistry.registerItem(this, name);
}
}

 

I am using that way to register;

 

	public static Item blackDiamond;

 

for Preinit:

	blackDiamond = new additem(64, "blackdiamond", CreativeTabs.tabMaterials, false);

 

for Renders, add this to your main class;

public static void registerRender(Item item) {
	String name = ref.uid + ":" + (item.getUnlocalizedName().substring(5)); //You have to use your modid for ref.uid.
	ModelResourceLocation location = new ModelResourceLocation(name, "inventory");
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, location);
}

 

After that in init section; (Not preinit!)

	registerRender(blackDiamond);

 

blackdiamond.json: (extend is my mod id, you need to type there your modid.)

{
    "parent": "builtin/generated",
    "textures": {
        "layer0": "extend:items/blackdiamond"
    },
    "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]
        }
    }
}

Link to comment
Share on other sites

I am still having problems, here is what my item looks like in game, it is not a block it is an item like a stick

Here is my code:

texture manager http://pastebin.com/aDxGVt5t

main registry http://pastebin.com/JsaWNs4C

HarryPotterWand.json file in \src\main\resources\assets\harrypottercraft\models\item (ive tried the last folder as item and items and still no luck)

http://pastebin.com/QXtfpVJv

ref strings: http://pastebin.com/H9N83HXd

my texture is 128x128, if that is the problem is there any way I can set it to accept images of that size

Link to comment
Share on other sites

You need to setUnlocalizedName in your wand class. Because textures load as a name. if your items unlocalizedname is ABC it will check ABC.json file for texture, and if you paste your wand class we can help you better, because we can't see where are you register item.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I know this chat is outdated but can you guys help me with this because i'm having the same problem and i am unable to get into the files because i am on mac
    • You only ever set the block on the client. See HoneycombItem.useOn() for the "correct" logic.
    • public InteractionResult use(BlockState blockState, Level level, BlockPos blockPos, Player player, InteractionHand hand, BlockHitResult blockHitResult) { ItemStack itemstack = player.getItemInHand(hand); boolean successfullyDyed = false; if (level.isClientSide) { if(player.getAbilities().mayBuild == true){ if(itemstack.getItem() == Items.RED_DYE){ level.setBlock(blockPos,blockState.setValue(TYPE,0),0); successfullyDyed = true; } else if(itemstack.getItem() == Items.ORANGE_DYE){ level.setBlock(blockPos,blockState.setValue(TYPE,1),0); successfullyDyed = true; } else if(itemstack.getItem() == Items.YELLOW_DYE){ level.setBlock(blockPos,blockState.setValue(TYPE,2),0); successfullyDyed = true; } else if(itemstack.getItem() == Items.GREEN_DYE){ level.setBlock(blockPos,blockState.setValue(TYPE,3),0); successfullyDyed = true; } else if(itemstack.getItem() == Items.BLUE_DYE){ level.setBlock(blockPos,blockState.setValue(TYPE,4),0); successfullyDyed = true; } else if(itemstack.getItem() == Items.PURPLE_DYE){ level.setBlock(blockPos,blockState.setValue(TYPE,5),0); successfullyDyed = true; } else{ player.displayClientMessage(Component.translatable("block.thingamajigs.lava_lamp.wrong_dye"), true); return InteractionResult.CONSUME; } // update THIS block, no matter what happens if(successfullyDyed == true){ level.updateNeighborsAt(blockPos,this); level.playSound(null, blockPos, SoundEvents.DYE_USE, SoundSource.BLOCKS, 1.0F, 1.0F); return InteractionResult.SUCCESS; } if(!player.isCreative()) { if (itemstack.getCount() > 1) { itemstack.setCount(itemstack.getCount() - 1); } else { itemstack.setCount(0); } } } } return InteractionResult.CONSUME; } Hey there, I was working on a block's 'use' method, however the behavior is not quite what I wanted. In-game, the block will flash to the desired state, then revert back to the state it was in previously, and won't actually update. I was wondering if perhaps I was updating the block wrong? The only state I am trying to update is an Integer value called 'TYPE' from 0-5 by using dyes.
    • Your log doesn't show any mods getting loaded besides the core mods. Maybe you have that broken browser plugin that downloads jar files as .jar.zip ? Forge will only load mods if they end with .jar
    • I don't see a crash. I see the server successfully starting then shutting down 40 seconds later. [25Sep2022 02:07:36.925] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer/]: Done (16.794s)! For help, type "help" [25Sep2022 02:07:36.929] [Server thread/DEBUG] [net.minecraftforge.common.ForgeI18n/CORE]: Loading I18N data entries: 208 [25Sep2022 02:07:36.932] [Server thread/INFO] [net.minecraftforge.server.permission.PermissionAPI/]: Successfully initialized permission handler forge:default_handler [25Sep2022 02:08:15.588] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Stopping the server Maybe you started the server from the command line then closed the window?
  • Topics

×
×
  • Create New...

Important Information

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