as I do so that tile.name does not appear in my mod

Started by retibalt on Sat, 09/23/2017 - 15:26

Topic category: Help with MCreator modding

Last seen on 20:26, 28. Jul 2019
Joined Jun 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
as I do so that tile.name does not appear in my mod
Sat, 09/23/2017 - 15:26

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

 

Last seen on 19:31, 22. Sep 2019
Joined Jun 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Try to remove that block and
Sat, 09/23/2017 - 15:31

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...

Last seen on 10:21, 4. Mar 2018
Joined Sep 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Hey Raol, This didn't work
Sun, 09/24/2017 - 10:12

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.

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
There are simply most  two
Sun, 09/24/2017 - 11:21

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.

Last seen on 19:31, 22. Sep 2019
Joined Jun 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:Hey Raol, This didn't work
Sun, 09/24/2017 - 12:36

I don't have this error because I don't update RaolCraft 3 from weeks

Last seen on 10:21, 4. Mar 2018
Joined Sep 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
package mod.mcreator;
Sun, 09/24/2017 - 13:04

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.

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
Show your lang file.
Sun, 09/24/2017 - 14:13

Show your lang file.

Last seen on 10:21, 4. Mar 2018
Joined Sep 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Where is that located?
Sun, 09/24/2017 - 14:51

Where is that located?

Last seen on 10:21, 4. Mar 2018
Joined Sep 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
#Lang file was made using
Sun, 09/24/2017 - 14:55

#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

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
Ok, try this:Go to: MCreator
Sun, 09/24/2017 - 16:05

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.

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
RE:Ok, try this:Go to: MCreator
Sun, 09/24/2017 - 16:07

@#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.