Eclipse says I don"t have the latest JDK, and now I cannot install the JDK.
Venus Miner, you need to install the Java Development Kit Version 6 or 7. The thing is all of the users must be using java 7 for the mod. Also you can compile the mod with java 6 by setting it , but i don't know how to
It has to be JDK 7. Forge doesn't support JDK 8 yet. there is a wiki. You can find your specific answer by typing forge 1.7.2 Source. It should be a minecraft forge wiki site with the title Installation/Source
When I go to test my mod (click the green 'play button') Everything works and has no errors, but my block doesnt have the correct texture or name. The name is like "tile.BlockName.something" and the texture is pink and black. what am I doing wrong?
When I go to test my mod (click the green 'play button') Everything works and has no errors, but my block doesnt have the correct texture or name. The name is like "tile.BlockName.something" and the texture is pink and black. what am I doing wrong?
Do you have the en_US.lang file? If not, you going to want to create that.
After you have that, tell me if you still get textures missing, as well as providing some code and the file's source path.
Yes I have the en_US.lang file(setup like in the tutorial) but it's still not working. I have texture errors still as well. I created the Library and have the image in the library.
Yes I have the en_US.lang file(setup like in the tutorial) but it's still not working. I have texture errors still as well. I created the Library and have the image in the library.
Move your assets.yourname.lang and assets.yourname.textures into the src/main/resources right below the java folder. Your textures code looks alright, except you can remove the .png in your code.
Move your assets.yourname.lang and assets.yourname.textures into the src/main/resources right below the java folder. Your textures code looks alright, except you can remove the .png in your code.
im afraid there was no change after doing these things.... Also, what exactly is the point of the en_US.lang? It does seen to be doing anything...
im afraid there was no change after doing these things.... Also, what exactly is the point of the en_US.lang? It does seen to be doing anything...
Could post the contents of your en_US.lang file? The lang file basically gives a name to your items -- without, your items would be called "item.itemname.name".
*items can be changed to tiles for blocks and itemGroup for CreativeTabs
I'll look over your code again and see what I can find.
Edit: It looks good, but have your removed the .png inside your code? That would be something causing an issue.
Can you quickly tell me how to have a new effect happen to a mob, such as the way they look if something happens to them
I've haven't done anything like that, but you can try looking at some Endermen files. For example, and endermen opens its mouth when it attacks someone/something.
[size=13.33px][size=13.33px][/size][size=13.33px][size=13.33px][/size][size=13.33px] onBlockPlacedBy(World world, Random random, [/size][size=13.33px][size=13.33px][/size][size=13.33px] x, [/size][size=13.33px][size=13.33px][/size][size=13.33px] y, [/size][size=13.33px][size=13.33px][/size][size=13.33px] z, EntityLivingBase entity, ItemStack itemstack)[/size]
{
//Super
[size=13.33px][size=13.33px][/size][size=13.33px].onBlockPlacedBy(world, x, y, z, entity, itemstack);[/size]
//Sets the block to air on the x, y, and z coords from where you placed the block
world.setBlockToAir(x, y, z);
//Sets the block on the x, y, and z coords starting from where you placed the block
[size=13.33px]world.setBlock(x, y, z, [/size][size=13.33px][size=13.33px][/size][size=13.33px].[/size][size=13.33px][size=13.33px][/size][size=13.33px]);[/size]
//Sets the block(with set metadata) on the x, y, and z coords from where you placed the block
[size=13.33px]world.setBlock(x, y, z, [/size][size=13.33px][size=13.33px][/size][size=13.33px].[/size][size=13.33px][size=13.33px][/size][size=13.33px], 2, 2); [/size][size=13.33px][size=13.33px][/size]
Eclipse says I don"t have the latest JDK, and now I cannot install the JDK.
Venus Miner, you need to install the Java Development Kit Version 6 or 7. The thing is all of the users must be using java 7 for the mod. Also you can compile the mod with java 6 by setting it , but i don't know how to
Do you have the en_US.lang file? If not, you going to want to create that.
After you have that, tell me if you still get textures missing, as well as providing some code and the file's source path.
http://prntscr.com/45cx5y
Move your assets.yourname.lang and assets.yourname.textures into the src/main/resources right below the java folder. Your textures code looks alright, except you can remove the .png in your code.
im afraid there was no change after doing these things.... Also, what exactly is the point of the en_US.lang? It does seen to be doing anything...
Could post the contents of your en_US.lang file? The lang file basically gives a name to your items -- without, your items would be called "item.itemname.name".
*items can be changed to tiles for blocks and itemGroup for CreativeTabs
I'll look over your code again and see what I can find.
Edit: It looks good, but have your removed the .png inside your code? That would be something causing an issue.
I've haven't done anything like that, but you can try looking at some Endermen files. For example, and endermen opens its mouth when it attacks someone/something.
Mod code: http://prntscr.com/45l8ag
en_US.lang: http://prntscr.com/45l8ky
Then copy this code into your en_US.lang file:
Put the setBlockName and setBlockTextureName into the actual block file, and see if that works out.
I just copyed and pasted what you had.
[size=13.33px][size=13.33px][/size][size=13.33px] com.example.dragonborn.blocks;[/size]
[size=13.33px][size=13.33px][/size][size=13.33px] java.util.Random;[/size]
[size=13.33px][size=13.33px][/size][size=13.33px] net.minecraft.block.Block;[/size]
[size=13.33px][size=13.33px][/size][size=13.33px] net.minecraft.block.material.Material;[/size]
[size=13.33px][size=13.33px][/size][size=13.33px] net.minecraft.entity.EntityLivingBase;[/size]
[size=13.33px][size=13.33px][/size][size=13.33px] net.minecraft.init.Blocks;[/size]
[size=13.33px][size=13.33px][/size][size=13.33px] net.minecraft.item.ItemStack;[/size]
[size=13.33px][size=13.33px][/size][size=13.33px] net.minecraft.world.World;[/size]
[size=13.33px][size=13.33px][/size][size=13.33px][size=13.33px][/size][size=13.33px] CambrianBuilder [/size][size=13.33px][size=13.33px][/size][size=13.33px] Block[/size]
{
[size=13.33px]Blocks [/size][size=13.33px][size=13.33px][/size][size=13.33px];[/size]
[size=13.33px][size=13.33px][/size][size=13.33px] CambrianBuilder(Material material)[/size]
{
[size=13.33px][size=13.33px][/size][size=13.33px](material);[/size]
}
[size=13.33px][size=13.33px][/size][size=13.33px][size=13.33px][/size][size=13.33px] onBlockPlacedBy(World world, Random random, [/size][size=13.33px][size=13.33px][/size][size=13.33px] x, [/size][size=13.33px][size=13.33px][/size][size=13.33px] y, [/size][size=13.33px][size=13.33px][/size][size=13.33px] z, EntityLivingBase entity, ItemStack itemstack)[/size]
{
//Super
[size=13.33px][size=13.33px][/size][size=13.33px].onBlockPlacedBy(world, x, y, z, entity, itemstack);[/size]
//Sets the block to air on the x, y, and z coords from where you placed the block
world.setBlockToAir(x, y, z);
//Sets the block on the x, y, and z coords starting from where you placed the block
[size=13.33px]world.setBlock(x, y, z, [/size][size=13.33px][size=13.33px][/size][size=13.33px].[/size][size=13.33px][size=13.33px][/size][size=13.33px]);[/size]
//Sets the block(with set metadata) on the x, y, and z coords from where you placed the block
[size=13.33px]world.setBlock(x, y, z, [/size][size=13.33px][size=13.33px][/size][size=13.33px].[/size][size=13.33px][size=13.33px][/size][size=13.33px], 2, 2); [/size][size=13.33px][size=13.33px][/size]
}
}
Put all of your code in a place like pastebin. I'll put in eclipse and see if I can figure out the problem :).
Main Mod File: http://pastebin.com/gudcjVNx
BlockMyBlock: http://pastebin.com/FURR7yCr
For some reason I called the block My Block lol. I'm really only focused on the MyBlock so i only included the BlockMyBlock.
Package setup: http://prntscr.com/45s3he
Thanks again
Copy and paste the following code into eclipse. Everything should work, and if it doesn't, it's probably something with your package setup.
Main Mod File:
package com.piratecody.forums;
- public static String NAME = "name";
//Start declarations - This is where the variables for mod elements are declared.
- NoahBlock = new BlockNoah();
GameRegistry.registerBlock(NoahBlock, "NoahBlock");
import com.piratecody.forums.blocks.*;
import assets.piratecody.*;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
@Mod(modid= "PirateCody", name= "ModName", version= "Alpha 0.1")
public class Main
{
public static String MODID = "modid";
public static String VERSION = "version";
/* Blocks */
public static Block MyBlock;
public static Block StrongisBlock;
public static Block NoahBlock;
@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
}
@EventHandler
public void init(FMLInitializationEvent e)
{
//My Block//
MyBlock = new BlockMyBlock();
GameRegistry.registerBlock(MyBlock, "PirateCodyBlock");
//Strongis Block//
StrongisBlock = new BlockStrongis();
GameRegistry.registerBlock(StrongisBlock, "StrongisBlock");
//Noah (zTehBeast) Block//
}
@EventHandler
public void postInit(FMLPostInitializationEvent e)
{
}
}
Sorry about the numbers, nothing I could do to get them out.
package com.piratecody.forums.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.*;
import net.minecraft.creativetab.CreativeTabs;
import assets.piratecody.textures.blocks.*;
public class BlockMyBlock extends Block
{
public BlockMyBlock(Material sponge)
{
super(Material.sponge);
this.setBlockName("MyBlock");
this.setBlockTextureName("piratecody_modname" + ":" + getUnlocalizedName().substring(5));
}
}