Jump to content

Recommended Posts

Posted

package example.items;

 

import net.minecraft.block.Block;

import net.minecraft.item.EnumToolMaterial;

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import net.minecraft.item.ItemSword;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.common.registry.LanguageRegistry;

 

public class Items {

 

public static void init() {

    EspadaDeObsidiana = new ItemSword(ItemInfo.WAND_ID, EnumToolMaterial);

 

}

 

public static Item EspadaDeObsidiana;

public static void addNames() {

LanguageRegistry.addName(new ItemStack(EspadaDeObsidiana, 1), ItemInfo.WAND_NAME);

}

 

public static void registerRecipes() {

GameRegistry.addRecipe(new ItemStack (EspadaDeObsidiana, 1),

    new Object[] {  " O ",

                    " O ",

                    " / ",

 

 

                    'O', Block.obsidian,

                    '/', Item.stick,

 

            });

  }

 

}

 

 

                   

                   

what I can write in the part:

 

public static void init() {

    EspadaDeObsidiana = new ItemSword(ItemInfo.WAND_ID, (here));

 

appear error in that part, I think I must write EnumToolMaterial, but the recipe uses Obsidian, the obsidian is not in the type EnumToolMaterial, what can I do?

Posted

1. Use code tags or paste code into https://gist.github.com/ (with JAVA syntax highlighting!).

 

2. When you have an error, you should always mention what the error says.

 

 

Now I'll look into your error :)

You aren't going to like what I have to say though :(

You're problem is unrelated to Minecraft's code, even to forge.

The main problem you are having right now is with basic programming logic and Java syntax.

It may be a simple typo, but then you would have realized by the error message, combined with your other code I'm sure in my assesment.

 

Most people will just ignore such advise, but if you care to learn see below :P

 

  Reveal hidden contents

 

 

PPS:

You are doing

Class = new ItemSword(/*args */);

you can't set a class to something.

You need to set the variable, not the class ;)

  Quote

If you guys dont get it.. then well ya.. try harder...

Posted
  On 11/19/2013 at 6:24 PM, Mazetar said:

1. Use code tags or paste code into https://gist.github.com/ (with JAVA syntax highlighting!).

 

2. When you have an error, you should always mention what the error says.

 

 

Now I'll look into your error :)

You aren't going to like what I have to say though :(

You're problem is unrelated to Minecraft's code, even to forge.

The main problem you are having right now is with basic programming logic and Java syntax.

It may be a simple typo, but then you would have realized by the error message, combined with your other code I'm sure in my assesment.

 

Most people will just ignore such advise, but if you care to learn see below :P

 

  Reveal hidden contents

 

 

PPS:

You are doing

Class = new ItemSword(/*args */);

you can't set a class to something.

You need to set the variable, not the class ;)

 

I agree with Mazetar. If the buttons aren't working, use the


tag, or even better, as Mazetar said (once again), use Gist on Github.

 

And yes, you want to have some basic knowledge about Java. You can use the link Mazetar gave you, or you can follow TheNewBoston's tutorials, if you don't want lengthy videos and are lazy.

 

The way I learnt java? I learnt java in fifth grade (at the age of 10) from a book called Head First Java. They use really easy-to-follow language and use good examples. Learning from there, here I am - coding minecraft mods(released one a few days ago) at the age of 12(seventh grade)!

 

 

The thing I want to say, is you can't just get to coding before learning the language.

 

P.S to Mazetar -

 

You said

 

  Quote

PPS:

You are doing

Class = new ItemSword(/*args */);

you can't set a class to something.

You need to set the variable, not the class ;)

 

I think you are wrong. If you look closely, he is using the variable but he is initializing the variable AFTER declaration, which results in Java not being able to find the variable.

 

Regards,

Ablaze.

Add me on Skype: AblazeTheBest. Send a message saying "#HeyAblaze"

 

Currently: Making a mod!

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

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