Jump to content

Recommended Posts

Posted

Hi, so i followed a tutorial on youtube and tried to make a block breaker. But the problem is when i start the game, it crashes with this:

 

Error:

 

[14:20:52] [Client thread/ERROR] [FML]: Caught exception from TestPack (tp)

java.lang.IllegalArgumentException: Block: class fatalitygc.testpack.blocks.BlockBreaker has property: type with invalidly named value: BASIC

at net.minecraft.block.state.BlockStateContainer.validateProperty(BlockStateContainer.java:115) ~[forgeSrc-1.10.2-12.18.3.2221.jar:?]

at net.minecraft.block.state.BlockStateContainer.<init>(BlockStateContainer.java:75) ~[forgeSrc-1.10.2-12.18.3.2221.jar:?]

at net.minecraft.block.state.BlockStateContainer.<init>(BlockStateContainer.java:60) ~[forgeSrc-1.10.2-12.18.3.2221.jar:?]

at fatalitygc.testpack.blocks.BlockBreaker.createBlockState(BlockBreaker.java:36) ~[bin/:?]

at net.minecraft.block.Block.<init>(Block.java:278) ~[forgeSrc-1.10.2-12.18.3.2221.jar:?]

at net.minecraft.block.Block.<init>(Block.java:287) ~[forgeSrc-1.10.2-12.18.3.2221.jar:?]

at fatalitygc.testpack.blocks.BlockBreaker.<init>(BlockBreaker.java:28) ~[bin/:?]

at fatalitygc.testpack.init.ModBlocks.init(ModBlocks.java:25) ~[bin/:?]

at fatalitygc.testpack.TestPack.preInit(TestPack.java:35) ~[bin/:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]

at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:618) ~[forgeSrc-1.10.2-12.18.3.2221.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]

at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:243) ~[forgeSrc-1.10.2-12.18.3.2221.jar:?]

at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:221) ~[forgeSrc-1.10.2-12.18.3.2221.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]

at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:145) [LoadController.class:?]

at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:624) [Loader.class:?]

at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:259) [FMLClientHandler.class:?]

at net.minecraft.client.Minecraft.startGame(Minecraft.java:477) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_121]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_121]

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]

at GradleStart.main(GradleStart.java:26) [start/:?]

[14:20:52] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:649]: ---- Minecraft Crash Report ----

// Shall we play a game?

 

 

So i went in my BlockBreaker class and see:

 

	this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, ChipTypes.BASIC));

Which is referring to the error, and the ChipTypes.BASIC refers to my enum handler:

public static enum ChipTypes implements IStringSerializable{
	BASIC("basic", 0),
	ADVANCED("advanced", 1);

	private int ID;
	private String name;

	private ChipTypes(String name, int ID){
		this.ID = ID;
		this.name= name;
	}

	@Override
	public String getName() {
		return this.name();
	}

	public int getID() {
		return ID;
	}

	@Override
	public String toString() {
		return getName();
	}

}

 

What could be wrong? I did everything the same as in the tutorial :/

 

thanks for any help!

Posted

You haven't told the game what states your block has, so you've tried to set a state the blockstatecontainer doesn't know about and is therefor invalid.

 

(You're missing a method that you need to override)

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

That is not the problem.

 

You are correct. I was looking for something that wasn't there, but which didn't need to be either.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Read the error message.

 

Thats the thing i dont get

java.lang.IllegalArgumentException: Block: class fatalitygc.testpack.blocks.BlockBreaker has property: type with invalidly named value: BASIC

How is it invalid IF it DOES exist?

Posted

It's invalid in the case that property value names must be all lowercase.

 

This wasnt the case :D

 

Look at this

return this.name();

What is this.name()?

 

This was :P I changed it too return name; instead of return this.name(); and now it works, thanks. I guess the guy changed it not onscreen at the tutorial :D

Posted

I was right, too.

Animefan just told you what to do. Which shows you that you have literally 0 idea what your code is doing. Which is bad.

Yeah, welcome to the age of tutorials where its like;

 

Type this, do this and look it works

without explanation :-)

 

And some code you look at and be like;

How do they know

 

 

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hi, i'm really having problems trying to set the texture to my custom item. I thought i'm doing everything correctly, but all i see is the missing texture block for my item. I am trying this for over a week now and getting really frustrated. The only time i could make the texture work, was when i used an older Forge version (52.0.1) for Minecraft (1.21.4). Was there a fundamental change for textures and models somewhere between versions that i'm missing? I started with Forge 54.1.0 and had this problem, so in my frustration i tried many things: Upgrading to Forge 54.1.1, created multiple new projects, workspaces, redownloaded everything and setting things up multiple times, as it was suggested in an older thread. Therea are no errors in the console logs, but maybe i'm blind, so i pasted the console logs to pastebin anyway: https://pastebin.com/zAM8RiUN The only time i see an error is when i change the models JSON file to an incorrect JSON which makes sense and that suggests to me it is actually reading the JSON file.   I set the github repository to public, i would be so thankful if anyone could take a look and tell me what i did wrong: https://github.com/xLorkin/teleport_pug_forge   As a note: i'm pretty new to modding, this is my first mod ever. But i'm used to programming. I had some up and downs, but through reading the documentation, using google and experimenting, i could solve all other problems. I only started modding for Minecraft because my son is such a big fan and wanted this mod.
    • Please read the FAQ (link in orange bar at top of page), and post logs as described there.
    • Hello fellow Minecrafters! I recently returned to Minecraft and realized I needed a wiki that displays basic information easily and had great user navigation. That’s why I decided to build: MinecraftSearch — a site by a Minecraft fan, for Minecraft fans. Key Features So Far Straight-to-the-Point Info: No extra fluff; just the essentials on items, mobs, recipes, loot and more. Clean & Intuitive Layout: Easy navigation so you spend less time scrolling and more time playing. Optimized Search: Search for anything—items, mobs, blocks—and get results instantly. What I’m Thinking of Adding More data/information: Catch chances for fishing rod, traveling villager trades, biomes info and a lot more. The website is still under development and need a lot more data added. Community Contributions: Potential for user-uploaded tips for items/mobs/blocks in the future. Feature Requests Welcome: Your ideas could shape how the wiki evolves! You can see my roadmap at the About page https://minecraftsearch.com/about I’d love for you to check out MinecraftSearch and see if it helps you find the info you need faster. Feedback is crucial—I want to develop this further based on what the community needs most, so please let me know what you think. Thanks, and happy crafting!
    • Instructions on how to install newer Java can be found in the FAQ
    • That's just plain wrong... newer versions are much better optimised and start a lot faster than 1.8.9, both Forge and Minecraft itself. Comparing Fabric 1.21 with Forge 1.8 is like comparing apples and oranges... one's brand new and the other's over a decade old.
  • Topics

×
×
  • Create New...

Important Information

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