Started by
retibalt
on
Topic category: Help with Minecraft modding (Java Edition)
as I do so that tile.name does not appear in my mod
I do not want the red texts in my mod as I remove it
Topic category: Help with Minecraft modding (Java Edition)
as I do so that tile.name does not appear in my mod
I do not want the red texts in my mod as I remove it
Try to remove that block and remake it with a different mcreator mid element name (not the GUi name but the name shown in the mods elements list)
Change the texture because that's like redstone...
Hey Raol, This didn't work for me.
I think the error is in Mcreator itself. I took a look at the code yesterday and found out that it's missing the part where it actually names the item/block.
It might be a gradle error or a missing file.
I think you dont have the error, and that is really interesting.
Can you quickly make a short mod with a (named) item, and share the code please. I will take a look at it and see what kind of error it is. (and hopefully fix it)
Thanks.
There are simply most two places where can be the issue:
1st - the code itself. You have to use Block#setUnlocalizedName() / Item#setUnlocalizedName() for setting the unlocalized name , that is later used in lang file for getting proper translation.
2nd - the lang file/s. The translation of the unlocalized name is set in the format:
item.unlocalized_name.name=name (for items)
tile.item.unlocalized_name.name=name (for blocks)
The issue here can be that the unlocalized name is written wrong, or the translation is not even there.
You can find and edit it in MCreator\user\lang , or you can use LanguageRegistry class for setting it directly from code.
I don't have this error because I don't update RaolCraft 3 from weeks
package mod.mcreator;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraft.world.World;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item;
import net.minecraft.init.Blocks;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.Minecraft;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.Block;
import java.util.Random;
import java.util.List;
@SuppressWarnings("unchecked")
public class mcreator_thisIsAnItem {
public mcreator_thisIsAnItem() {
}
public static Item block;
public static Object instance;
public void load(FMLInitializationEvent event) {
if (event.getSide() == Side.CLIENT)
Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
.register(block, 0, new ModelResourceLocation("testenvironmentmod:ThisIsAnItem", "inventory"));
GameRegistry.addRecipe(new ItemStack(block, 1), new Object[]{"XXX", "X4X", "XXX", Character.valueOf('4'),
new ItemStack(Blocks.SANDSTONE, 1, 2),});
GameRegistry.addSmelting(new ItemStack(Blocks.LEAVES2, 1, 0), new ItemStack(block), 1.0f);
}
public void generateNether(World world, Random random, int chunkX, int chunkZ) {
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
}
public int addFuel(ItemStack fuel) {
return 0;
}
public void serverLoad(FMLServerStartingEvent event) {
}
public void preInit(FMLPreInitializationEvent event) {
}
public void registerRenderers() {
}
static {
block = (new ItemthisIsAnItem());
}
static class ItemthisIsAnItem extends Item {
public ItemthisIsAnItem() {
setMaxDamage(0);
maxStackSize = 64;
setUnlocalizedName("ThisIsAnItem");
setRegistryName("ThisIsAnItem");
GameRegistry.register(this);
setCreativeTab(CreativeTabs.MISC);
}
@Override
public int getItemEnchantability() {
return 0;
}
@Override
public int getMaxItemUseDuration(ItemStack par1ItemStack) {
return 0;
}
@Override
public float getStrVsBlock(ItemStack par1ItemStack, IBlockState par2Block) {
return 1.0F;
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
list.add("adf");
}
}
}
I dont see any errors in it, but the name still isn't displaying.
Show your lang file.
Where is that located?
#Lang file was made using MCreator
#Fri Sep 22 18:57:45 AST 2017
item.ThisIsAnItem.name=Cool Item Dude
item.dimensionTest_trigger.name=The Key of Life
This was located in C:\Pylo\MCreator175\user\lang
Ok, try this:
Go to: MCreator\forge\src\main\resources
Here is a file named: pack.mcmeta
Open it and change pack_format from 1 to 2.
@#9 Oops... my mistake, the default value is 3, not 1, but that does not really matter because 1 is not valid, it is treated in same way as 1.
So as I stated in the comment above, change it to 2.
OMG BRO!!! It worked!
You are Epic Dude! Thanks..!
The default value was 3, but i changed it to 2, and it worked!
Im having the same problem and i changed pack.mcmeta to 1 and its still the same.
Yes thx it worked just go to MCreator175\forge\src\main\resources and then open pack.mcmeta and change pack format to 2.
I can only find mcmod.info there :O