Jump to content

Property EnumProperty not found on block[1.18.2]


严 郭乐

Recommended Posts

When I run the task "runData",I keep getting the same error and I can't understand it

Here's part of log in IdeaJ's console:

[14:14:41] [main/INFO] [minecraft/DataGenerator]: Starting provider: Block States: candycraft
Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:39)
    at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53)
    at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71)
    at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:106)
    at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:77)
    at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26)
    at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23)
    at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:149)
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at MC-BOOTSTRAP/[email protected]/net.minecraftforge.fml.loading.targets.ForgeDataUserdevLaunchHandler.lambda$launchService$0(ForgeDataUserdevLaunchHandler.java:41)
    at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
    ... 7 more
Caused by: java.lang.IllegalArgumentException: Property EnumProperty{name=axis, clazz=class net.minecraft.core.Direction$Axis, values=[x, y, z]}=x not found on block Block{candycraft:candyland_portal}
    at MC-BOOTSTRAP/[email protected]/com.google.common.base.Preconditions.checkArgument(Preconditions.java:435)
    at TRANSFORMER/[email protected]/net.minecraftforge.client.model.generators.VariantBlockStateBuilder$PartialBlockstate.<init>(VariantBlockStateBuilder.java:180)
    at TRANSFORMER/[email protected]/net.minecraftforge.client.model.generators.VariantBlockStateBuilder$PartialBlockstate.with(VariantBlockStateBuilder.java:191)
    at TRANSFORMER/[email protected]/cn.breadnicecat.codeovencore.datagen.CocBlockStateProvider$BlockStateModelGenerator.lambda$static$2(CocBlockStateProvider.java:98)
    at TRANSFORMER/[email protected]/cn.breadnicecat.codeovencore.datagen.CocBlockStateProvider.lambda$registerStatesAndModels$0(CocBlockStateProvider.java:67)
    at java.base/java.util.HashMap.forEach(HashMap.java:1421)
    at TRANSFORMER/[email protected]/cn.breadnicecat.codeovencore.datagen.CocBlockStateProvider.registerStatesAndModels(CocBlockStateProvider.java:67)
    at TRANSFORMER/[email protected]/net.minecraftforge.client.model.generators.BlockStateProvider.run(BlockStateProvider.java:98)
    at TRANSFORMER/[email protected]/net.minecraft.data.DataGenerator.run(DataGenerator.java:44)
    at TRANSFORMER/[email protected]/net.minecraftforge.forge.event.lifecycle.GatherDataEvent$DataGeneratorConfig.lambda$runAll$0(GatherDataEvent.java:98)
    at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.api.LamdbaExceptionUtils.lambda$rethrowConsumer$0(LamdbaExceptionUtils.java:34)
    at java.base/java.util.HashMap$Values.forEach(HashMap.java:1065)
    at TRANSFORMER/[email protected]/net.minecraftforge.forge.event.lifecycle.GatherDataEvent$DataGeneratorConfig.runAll(GatherDataEvent.java:94)
    at TRANSFORMER/[email protected]/net.minecraftforge.data.loading.DatagenModLoader.begin(DatagenModLoader.java:45)
    at TRANSFORMER/[email protected]/net.minecraft.data.Main.main(Main.java:67)
    ... 13 more
Caused by: java.lang.reflect.InvocationTargetException

Caused by: java.lang.IllegalArgumentException: Property EnumProperty{name=axis, clazz=class net.minecraft.core.Direction$Axis, values=[x, y, z]}=x not found on block Block{candycraft:candyland_portal}


> Task :runData FAILED

Execution failed for task ':runData'.
> Process 'command 'C:\Program Files\Java\jdk-17.0.4.1\bin\java.exe'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.


Here's the core code of this function.(Create a new portal model like nether portal)

	BlockStateModelGenerator PORTAL_GENERATOR = (provider, name, block) -> {
			String blockLoc = BLOCK_FOLDER + "/" + name;
			ResourceLocation blockTexture = provider.modLoc(blockLoc);
			String block_ns = blockLoc + "_ns";
			String block_ew = blockLoc + "_ew";
			provider.models().withExistingParent(block_ns, BLOCK_FOLDER + "/nether_portal_ns")
					.texture("portal", blockTexture)
					.texture("particle", blockTexture);
			provider.models().withExistingParent(block_ew, BLOCK_FOLDER + "/nether_portal_ew")
					.texture("portal", blockTexture)
					.texture("particle", blockTexture);
			provider.getVariantBuilder(block)
					.partialState().with(RotatedPillarBlock.AXIS, Direction.Axis.X).modelForState().modelFile(provider.modelFile(block_ns));
		};

 

Link to comment
Share on other sites

Looks like your block doesn't have that block property.

See for example RotatedPillarBlock.createBlockStateDefinition()

 

To make a question answerable, you need to post all the relevant code (not just snippets out of context). Preferably on github.

Edited by warjort

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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