Jump to content

coolboy4531

Members
  • Posts

    584
  • Joined

  • Last visited

Posts posted by coolboy4531

  1. Don't know the cause, but I usually put my events in PreInit (see if that makes a difference - in fact, I never use Init, only PreInit for everything).

     

    Another thing:

    - Try adding System.out.println methods around that event and see if it's actually being called. It could be side issues.

     

    EDIT:

    I think I may have found your issue.

    HarvestDropsEvent is only called when an item is "dropped" from your block (in this case: saplings or apples).

    Since leaves only drop those items in a low chance, it will only drop your item (which is a stick) if it drops a sapling or apple of itself.

     

    To fix this issue you should not use HarvestDropsEvent and use BreakEvent, I think you can figure which "BreakEvent" to use.

    (lazy:  BlockEvent.BreakEvent)

  2. Two things.

     

    You haven't even set a texture location (path) for your item, no wonder it shows a missing texture.

    If I remember you need to bind/set both models and textures to "that" specific item.

     

    Take a look at this. Although it's outdated, I bet you can find a way to work around the methods and things. c:

     

  3. One thing to note.

    Don't register or create blocks/items during class construction <clinit>.

     

    You need to do them like you did with your creative tab.

     

    Example:

    public static Block block;
    @EventHandler
    public void preInit(PreInitializationEvent event) {
    block = new TutorialBlock().setUnlocalizedName("tutBlock");
    }
    
    //Note: This is an "example."\\
    

  4. I think that this is null. (thrown by NullPointerException)

    ItemStack itemstack = Periodicsystem.getSmeltingResult(slots[0].getItem(), slots[1].getItem(),slots[2].getItem(),slots[2].getItem(),slots[3].getItem(),slots[4].getItem());
    

     

    You have created the ItemStack[] "slots" but who knows what that .getItem() can be, you've never arranged it.

  5. You shouldn't use programs (generators) to get code.

    You need to do it manually.

     

    Loops are statements that you call that sets a value until it is stopped by an integer you set.

     

    Example:

    for (int i = 0; i < 30; i++) {
         world.setBlock(x + i, y, z);
    }
    
    //It adds world.setBlock (however many times you put as that integer, in this case 30).
    

  6. You need to "register" that class in your main class.

     

    Don't know how?

    Okay. Let me show you.

     

    Do you have a main class? (with the PreInit stuff)

    If you do, then in that place use the MinecraftForge eventbus.

     

    Example:

    //Note that this is an example and that you should only use the registration method I put in preInit.
    public void preInit(FMLPreInitializationEvent event) {
         MinecraftForge.EVENT_BUS.register(new YourEventClass()); //in your case would be LivingDropsEvent
    }
    

     

    Hey, btw. Aren't you from PMC? lol. I think I may know you.

×
×
  • Create New...

Important Information

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