Jump to content

Recommended Posts

Posted

Ok so in Eclipse, ive made my first block and throughout the enitre mod there are no errors,however, when i go to run it this keeps popping up:

 

java.lang.IllegalArgumentException: Illegal object for naming null

at cpw.mods.fml.client.FMLClientHandler.getObjectName(FMLClientHandler.java:817)

at cpw.mods.fml.common.FMLCommonHandler.addNameForObject(FMLCommonHandler.java:469)

at net.minecraft.src.ModLoader.addName(ModLoader.java:142)

at net.minecraft.src.ModLoader.addName(ModLoader.java:130)

at net.minecraft.src.tutorial.mod_mymod.addNames(mod_mymod.java:33)

at net.minecraft.src.tutorial.mod_mymod.load(mod_mymod.java:21)

at cpw.mods.fml.common.modloader.ModLoaderModContainer.init(ModLoaderModContainer.java:356)

at cpw.mods.fml.common.Loader.modInit(Loader.java:273)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:628)

at cpw.mods.fml.client.FMLClientHandler.onLoadComplete(FMLClientHandler.java:223)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:429)

at net.minecraft.client.Minecraft.run(Minecraft.java:738)

at java.lang.Thread.run(Thread.java:680)

 

Also heres both my codes if it helps:

 

mod_mymod:

 

package net.minecraft.src.tutorial;

 

import net.minecraft.src.BaseMod;

import net.minecraft.src.Block;

import net.minecraft.src.ModLoader;

 

 

 

 

public class mod_mymod extends BaseMod {

 

public static Block blockRavireBlock;

@Override

public String getVersion() {

return null;

}

 

@Override

public void load() {

this.registerBlocks();

this.addNames();

}

 

 

private void registerBlocks() {

 

ModLoader.registerBlock(blockRavireBlock);

}

 

 

private void addNames(){

 

ModLoader.addName(blockRavireBlock, "Ravire Block");

} }

 

The actual Block class:

 

package net.minecraft.src.tutorial;

 

import net.minecraft.src.Block;

import net.minecraft.src.Material;

import net.minecraft.src.StepSound;

import net.minecraft.src.forge.ITextureProvider;

 

public class blockRavireBlock extends Block implements ITextureProvider {

 

protected blockRavireBlock(int blockID, int textureID) {

 

super(blockID, textureID, Material.wood);

setHardness(3.1F);

setResistance(0.3F);

setLightValue(10);

setStepSound(soundWoodFootstep);

 

}

@Override

public String getTextureFile(){

return "Ravire.png";

}

}

 

Yup thats all of it.

 

 

Posted

Where do you create your block?

Obviously it'll be null.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

have you edited the EnumToolMaterial base class to add in your RAVIRE EnumToolMaterial? because i dont see a variable anywhere in your code for it.

Posted

have you edited the EnumToolMaterial base class to add in your RAVIRE EnumToolMaterial? because i dont see a variable anywhere in your code for it.

This.

And do not use ModLoader.addOverride, that is old, deprecated, and rather useless now, use a new texture sheet instead with setTexture on the blocks/items.

And it is better to use addTranslation instead of addName.

Posted

You aren't creating a block! It's nowhere. Obviously it's gonna be null!

Change public static Block blockRavierBlock; to public static Block blockRavierBlock = new BlockRavierBlock(...);

Done.

Or change the op to reflect your actual mod.

There shouldn't be a problem with the code on pastebin.

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

Posted

You aren't creating a block! It's nowhere. Obviously it's gonna be null!

Change public static Block blockRavierBlock; to public static Block blockRavierBlock = new BlockRavierBlock(...);

Done.

Or change the op to reflect your actual mod.

There shouldn't be a problem with the code on pastebin.

he posted the actual code, but he didnt update his original post.

 

and im pretty sure this was fixed since he hasnt replied back yet.

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I tried do download the essential mod to my mod pack but i didnt work. I paly on 1.21 and it should work. I use neoforge for my modding. The weird things is my friend somehow added the mod to his modpack and many others that I somehow can´t. Is there anything i can do? 
    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
  • Topics

×
×
  • Create New...

Important Information

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