Jump to content

Recommended Posts

Posted (edited)

I'm attempting to add an axis property to my block, but I encounter this error:

"Cannot set property EnumProperty{name=axis, clazz=class net.minecraft.util.EnumFacing$Axis, values=[x,y,z]} as it does not exist in Block{null}."

 

The source for my Block:
 

public class BlockAxle extends Block {
	
	public BlockAxle(String registryName) {
		super(Block.Properties.create(Material.IRON).sound(SoundType.ANVIL).hardnessAndResistance(3f, 3f));
		this.setDefaultState(this.getDefaultState().with(BlockStateProperties.AXIS, EnumFacing.Axis.X));
		this.setRegistryName(Assemblia.MOD_ID, registryName);
	}
	
	@Override
	public TileEntity createTileEntity(IBlockState state, IBlockReader world) {
		return new TileAxle();
	}	
}

 

In case it's due to how I've structured my mod, and not the block, the entire mod is hosted at https://github.com/Eliwood/Assemblia

 

EDIT:  Oh, right.  The log:

 

[14Apr2019 07:28:29.510] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher starting: java version 1.8.0_201
[14Apr2019 07:28:29.589] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmluserdevclient, --fml.forgeVersion, 25.0.48, --fml.mcpVersion, 20190213.203750, --fml.mcpMappings, snapshot_20190222-1.13.1, --fml.mcVersion, 1.13.2, --fml.forgeGroup, net.minecraftforge, --accessToken, ????????, --version, FMLDev, --assetIndex, 1.13.1, --assetsDir, C:\Users\Patrick Hansberry\.gradle\caches\forge_gradle\assets, --userProperties, {}]
[14Apr2019 07:28:29.916] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust
[14Apr2019 07:28:30.655] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmluserdevclient' with arguments [--gameDir, ., --launchTarget, fmluserdevclient, --fml.forgeVersion, 25.0.48, --fml.mcpVersion, 20190213.203750, --fml.mcpMappings, snapshot_20190222-1.13.1, --fml.mcVersion, 1.13.2, --fml.forgeGroup, net.minecraftforge, --accessToken, ????????, --version, FMLDev, --assetIndex, 1.13.1, --assetsDir, C:\Users\Patrick Hansberry\.gradle\caches\forge_gradle\assets, --userProperties, {}]
[14Apr2019 07:28:32.722] [Client thread/INFO] [net.minecraft.client.Minecraft/]: Setting user: Player794
[14Apr2019 07:28:41.664] [Client thread/ERROR] [net.minecraft.util.registry.IRegistry/]: Registry 'minecraft:block' was empty after loading
[14Apr2019 07:28:41.685] [Client thread/ERROR] [net.minecraft.util.registry.IRegistry/]: Registry 'minecraft:potion' was empty after loading
[14Apr2019 07:28:41.686] [Client thread/ERROR] [net.minecraft.util.registry.IRegistry/]: Registry 'minecraft:biome' was empty after loading
[14Apr2019 07:28:41.686] [Client thread/ERROR] [net.minecraft.util.registry.IRegistry/]: Registry 'minecraft:block_entity_type' was empty after loading
[14Apr2019 07:28:41.686] [Client thread/ERROR] [net.minecraft.util.registry.IRegistry/]: Registry 'minecraft:enchantment' was empty after loading
[14Apr2019 07:28:41.686] [Client thread/ERROR] [net.minecraft.util.registry.IRegistry/]: Registry 'minecraft:entity_type' was empty after loading
[14Apr2019 07:28:41.686] [Client thread/ERROR] [net.minecraft.util.registry.IRegistry/]: Registry 'minecraft:item' was empty after loading
[14Apr2019 07:28:41.686] [Client thread/ERROR] [net.minecraft.util.registry.IRegistry/]: Registry 'minecraft:mob_effect' was empty after loading
[14Apr2019 07:28:41.686] [Client thread/ERROR] [net.minecraft.util.registry.IRegistry/]: Registry 'minecraft:sound_event' was empty after loading
[14Apr2019 07:28:41.858] [Client thread/WARN] [net.minecraft.client.GameSettings/]: Skipping bad option: lastServer:
[14Apr2019 07:28:42.033] [Client thread/INFO] [net.minecraft.client.Minecraft/]: LWJGL Version: 3.1.6 build 14
[14Apr2019 07:28:44.307] [modloading-worker-2/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Forge mod loading, version 25.0.48, for MC 1.13.2 with MCP 20190213.203750
[14Apr2019 07:28:44.307] [modloading-worker-2/INFO] [net.minecraftforge.common.MinecraftForge/FORGE]: MinecraftForge v25.0.48 Initialized
[14Apr2019 07:28:44.782] [Client thread/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/]: Exception caught during firing event: Cannot set property EnumProperty{name=axis, clazz=class net.minecraft.util.EnumFacing$Axis, values=[x, y, z]} as it does not exist in Block{null}
	Index: 2
	Listeners:
		0: NORMAL
		1: ASM: class eli.assemblia.init.ModEventSubscriber onRegisterTileEntities(Lnet/minecraftforge/event/RegistryEvent$Register;)V
		2: ASM: class eli.assemblia.init.ModEventSubscriber onRegisterBlocks(Lnet/minecraftforge/event/RegistryEvent$Register;)V
		3: ASM: class eli.assemblia.init.ModEventSubscriber onRegisterItems(Lnet/minecraftforge/event/RegistryEvent$Register;)V
java.lang.IllegalArgumentException: Cannot set property EnumProperty{name=axis, clazz=class net.minecraft.util.EnumFacing$Axis, values=[x, y, z]} as it does not exist in Block{null}
	at net.minecraft.state.AbstractStateHolder.with(SourceFile:106)
	at eli.assemblia.block.BlockAxle.<init>(BlockAxle.java:18)
	at eli.assemblia.init.ModEventSubscriber.onRegisterBlocks(ModEventSubscriber.java:26)
	at net.minecraftforge.eventbus.ASMEventHandler_1_ModEventSubscriber_onRegisterBlocks_Register.invoke(.dynamic)
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:257)
	at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:105)
	at java.util.function.Consumer.lambda$andThen$0(Unknown Source)
	at java.util.function.Consumer.lambda$andThen$0(Unknown Source)
	at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:100)
	at net.minecraftforge.fml.ModList.lambda$dispatchSynchronousEvent$4(ModList.java:111)
	at java.util.ArrayList.forEach(Unknown Source)
	at net.minecraftforge.fml.ModList.dispatchSynchronousEvent(ModList.java:111)
	at net.minecraftforge.fml.ModList.lambda$static$0(ModList.java:82)
	at net.minecraftforge.fml.LifecycleEventProvider.dispatch(LifecycleEventProvider.java:70)
	at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:145)
	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:814)
	at net.minecraftforge.fml.ModLoader.loadMods(ModLoader.java:133)
	at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:52)
	at net.minecraft.client.Minecraft.init(Minecraft.java:411)
	at net.minecraft.client.Minecraft.run(Minecraft.java:344)
	at net.minecraft.client.main.Main.main(SourceFile:144)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55)
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:19)
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:35)
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53)
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:58)
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:44)
	at net.minecraftforge.userdev.UserdevLauncher.main(UserdevLauncher.java:77)

[14Apr2019 07:28:44.784] [Client thread/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Caught exception during event RegistryEvent.Register<minecraft:blocks> dispatch for modid assemblia
java.lang.IllegalArgumentException: Cannot set property EnumProperty{name=axis, clazz=class net.minecraft.util.EnumFacing$Axis, values=[x, y, z]} as it does not exist in Block{null}
	at net.minecraft.state.AbstractStateHolder.with(SourceFile:106) ~[forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:?]
	at eli.assemblia.block.BlockAxle.<init>(BlockAxle.java:18) ~[main/:?]
	at eli.assemblia.init.ModEventSubscriber.onRegisterBlocks(ModEventSubscriber.java:26) ~[main/:?]
	at net.minecraftforge.eventbus.ASMEventHandler_1_ModEventSubscriber_onRegisterBlocks_Register.invoke(.dynamic) ~[?:?]
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80) ~[eventbus-0.7.2-service.jar:?]
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:257) ~[eventbus-0.7.2-service.jar:?]
	at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:105) ~[forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:25.0]
	at java.util.function.Consumer.lambda$andThen$0(Unknown Source) ~[?:1.8.0_201]
	at java.util.function.Consumer.lambda$andThen$0(Unknown Source) ~[?:1.8.0_201]
	at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:100) ~[forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:?]
	at net.minecraftforge.fml.ModList.lambda$dispatchSynchronousEvent$4(ModList.java:111) ~[forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:?]
	at java.util.ArrayList.forEach(Unknown Source) ~[?:1.8.0_201]
	at net.minecraftforge.fml.ModList.dispatchSynchronousEvent(ModList.java:111) ~[forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:?]
	at net.minecraftforge.fml.ModList.lambda$static$0(ModList.java:82) ~[forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:?]
	at net.minecraftforge.fml.LifecycleEventProvider.dispatch(LifecycleEventProvider.java:70) ~[forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:?]
	at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:145) ~[forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:?]
	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:814) ~[forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:?]
	at net.minecraftforge.fml.ModLoader.loadMods(ModLoader.java:133) ~[forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:?]
	at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:52) ~[forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:411) ~[forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:344) ~[forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:?]
	at net.minecraft.client.main.Main.main(SourceFile:144) ~[forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201]
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:?]
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:19) [modlauncher-0.9.5.jar:?]
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:35) [modlauncher-0.9.5.jar:?]
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-0.9.5.jar:?]
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:58) [modlauncher-0.9.5.jar:?]
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:44) [modlauncher-0.9.5.jar:?]
	at net.minecraftforge.userdev.UserdevLauncher.main(UserdevLauncher.java:77) [forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1-recomp.jar:?]
[14Apr2019 07:28:44.801] [Client thread/FATAL] [net.minecraftforge.fml.ModLoader/]: Failed to complete lifecycle event LOAD_REGISTRIES, 1 errors found
[14Apr2019 07:28:44.816] [Client thread/INFO] [net.minecraft.resources.SimpleReloadableResourceManager/]: Reloading ResourceManager: forge-1.13.2-25.0.48_mapped_snapshot_20190222-1.13.1.jar, main, Default
[14Apr2019 07:28:45.986] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager/]: Starting up SoundSystem version 201809301515...
[14Apr2019 07:28:46.201] [Thread-4/INFO] [net.minecraft.client.audio.SoundManager/]: Initializing No Sound
[14Apr2019 07:28:46.202] [Thread-4/INFO] [net.minecraft.client.audio.SoundManager/]: (Silent Mode)
[14Apr2019 07:28:46.253] [Thread-4/INFO] [net.minecraft.client.audio.SoundManager/]: OpenAL initialized.
[14Apr2019 07:28:46.593] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager/SOUNDS]: Preloading sound minecraft:sounds/ambient/underwater/underwater_ambience.ogg
[14Apr2019 07:28:46.606] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager/SOUNDS]: Sound engine started
[14Apr2019 07:28:49.781] [Client thread/INFO] [net.minecraft.client.renderer.texture.TextureMap/]: Max texture size: 16384
[14Apr2019 07:28:51.298] [Client thread/INFO] [net.minecraft.client.renderer.texture.TextureMap/]: Created: 512x512 textures-atlas
[14Apr2019 07:28:54.223] [Client thread/ERROR] [net.minecraftforge.fml.ModLoader/]: Skipping lifecycle event ENQUEUE_IMC, 1 errors found.
[14Apr2019 07:28:54.223] [Client thread/FATAL] [net.minecraftforge.fml.ModLoader/]: Failed to complete lifecycle event ENQUEUE_IMC, 1 errors found
[14Apr2019 07:28:54.224] [Client thread/WARN] [net.minecraft.client.GameSettings/]: Skipping bad option: lastServer:
[14Apr2019 07:28:54.275] [Client thread/INFO] [com.mojang.text2speech.NarratorWindows/]: Narrator library for x64 successfully loaded
[14Apr2019 07:28:55.051] [Realms Notification Availability checker #1/INFO] [com.mojang.realmsclient.client.RealmsClient/]: Could not authorize you against Realms server: Invalid session id

 

Edited by Eliwood
Posted

You haven't correctly set up your block to have states.

You need to override createBlockState.

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 (edited)

I wish it were that easy, but I can't even find a createBlockState method.


And to be more specific, I've looked inside the source code for Block and cannot locate said method.  I updated my Forge to the latest build on 1.13, with the same results.

The most relevant bit of code I think I can find is this bit:

 

StateContainer.Builder<Block, IBlockState> builder = new StateContainer.Builder<>(this);
      this.fillStateContainer(builder);
      this.stateContainer = builder.create(BlockState::new);
      this.setDefaultState(this.stateContainer.getBaseState());

Thank you for the help, I do appreciate it.

Edited by Eliwood
Posted (edited)
2 hours ago, Draco18s said:

You need to override createBlockState.

The method is called fillStateContainer in 1.13.

Edited by larsgerrits

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

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

    • that happens every time I enter a new dimension.
    • This is the last line before the crash: [ebwizardry]: Synchronising spell emitters for PixelTraveler But I have no idea what this means
    • What in particular? I barely used that mod this time around, and it's never been a problem in the past.
    • Im trying to build my mod using shade since i use the luaj library however i keep getting this error Reason: Task ':reobfJar' uses this output of task ':shadowJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. So i try adding reobfJar.dependsOn shadowJar  Could not get unknown property 'reobfJar' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. my gradle file plugins { id 'eclipse' id 'idea' id 'maven-publish' id 'net.minecraftforge.gradle' version '[6.0,6.2)' id 'com.github.johnrengelman.shadow' version '7.1.2' id 'org.spongepowered.mixin' version '0.7.+' } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'org.spongepowered.mixin' apply plugin: 'com.github.johnrengelman.shadow' version = mod_version group = mod_group_id base { archivesName = mod_id } // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. java.toolchain.languageVersion = JavaLanguageVersion.of(17) //jarJar.enable() println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" minecraft { mappings channel: mapping_channel, version: mapping_version copyIdeResources = true runs { configureEach { workingDirectory project.file('run') property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' arg "-mixin.config=derp.mixin.json" mods { "${mod_id}" { source sourceSets.main } } } client { // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. property 'forge.enabledGameTestNamespaces', mod_id } server { property 'forge.enabledGameTestNamespaces', mod_id args '--nogui' } gameTestServer { property 'forge.enabledGameTestNamespaces', mod_id } data { workingDirectory project.file('run-data') args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') } } } sourceSets.main.resources { srcDir 'src/generated/resources' } repositories { flatDir { dirs './libs' } maven { url = "https://jitpack.io" } } configurations { shade implementation.extendsFrom shade } dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" implementation 'org.luaj:luaj-jse-3.0.2' implementation fg.deobf("com.github.Virtuoel:Pehkui:${pehkui_version}") annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' minecraftLibrary 'luaj:luaj-jse:3.0.2' shade 'luaj:luaj-jse:3.0.2' } // Example for how to get properties into the manifest for reading at runtime. tasks.named('jar', Jar).configure { manifest { attributes([ 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors, 'Specification-Version' : '1', // We are version 1 of ourselves 'Implementation-Title' : project.name, 'Implementation-Version' : project.jar.archiveVersion, 'Implementation-Vendor' : mod_authors, 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", "TweakOrder" : 0, "MixinConfigs" : "derp.mixin.json" ]) } rename 'mixin.refmap.json', 'derp.mixin-refmap.json' } shadowJar { archiveClassifier = '' configurations = [project.configurations.shade] finalizedBy 'reobfShadowJar' } assemble.dependsOn shadowJar reobf { re shadowJar {} } publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file://${project.projectDir}/mcmodsrepo" } } } my entire project:https://github.com/kevin051606/DERP-Mod/tree/Derp-1.0-1.20
  • Topics

×
×
  • Create New...

Important Information

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