Jump to content

Recommended Posts

Posted

Hello,

I try to make a food mod with crops in 1.13.2 but with the new change i have somme dificulty's.

So i make the code here but when i run client. My minecraft display this error :

Food Mod (modfood) encountered an error during the load_registries event phase

Cannot set property IntegerProperty(name=age,clazz=class java.lang.Interger . values = [0.1.

 

package com.Exs.modfood.blocks;

import com.Exs.modfood.init.ModBlocks;
import com.Exs.modfood.init.ModItem;
import net.minecraft.block.Block;
import net.minecraft.block.BlockCrops;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.state.IProperty;
import net.minecraft.state.IntegerProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraft.world.chunk.BlockStateContainer;

import java.util.Random;

public class SaladeCropBlocks extends BlockCrops {

    public static final IntegerProperty CROP_AGE = IntegerProperty.create("age",0,4);

    public SaladeCropBlocks(Properties builder) {
        super(builder);

    }

    @Override
    protected boolean isValidGround(IBlockState state, IBlockReader worldIn, BlockPos pos) {
        return state.getBlock() == Blocks.FARMLAND;
    }

    @Override
    public IntegerProperty getAgeProperty() {
        return CROP_AGE;
    }

    @Override
    public int getMaxAge() {
        return 4;
    }

    @Override
    protected IItemProvider getSeedsItem() {
        return ModItem.SALAD_SEED_ITEM;
    }

    @Override
    protected IItemProvider getCropsItem() {
        return ModItem.SALAD;
    }


    @Override
    protected int getBonemealAgeIncrease(World worldIn) {
        return 3;
    }

    @Override
    public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) {
        return true;
    }

}

Log:

[07mai2019 15:39:06.124] [Client thread/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Caught exception during event RegistryEvent.Register<minecraft:blocks> dispatch for modid modfood
java.lang.IllegalArgumentException: Cannot set property IntegerProperty{name=age, clazz=class java.lang.Integer, values=[0, 1, 2, 3, 4]} as it does not exist in Block{minecraft:air}
    at net.minecraft.state.AbstractStateHolder.with(AbstractStateHolder.java:105) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
    at net.minecraft.block.BlockCrops.<init>(BlockCrops.java:25) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
    at com.Exs.modfood.blocks.SaladeCropBlocks.<init>(SaladeCropBlocks.java:26) ~[classes/:?]
    at com.Exs.modfood.init.ModBlocks.registerBlock(ModBlocks.java:24) ~[classes/:?]
    at net.minecraftforge.eventbus.ASMEventHandler_1_ModBlocks_registerBlock_Register.invoke(.dynamic) ~[?:?]
    at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80) ~[eventbus-0.8.1-service.jar:?]
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:266) ~[eventbus-0.8.1-service.jar:?]
    at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:105) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:25.0]
    at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_211]
    at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_211]
    at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:111) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
    at net.minecraftforge.fml.ModList.lambda$dispatchSynchronousEvent$4(ModList.java:111) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
    at java.util.ArrayList.forEach(ArrayList.java:1257) ~[?:1.8.0_211]
    at net.minecraftforge.fml.ModList.dispatchSynchronousEvent(ModList.java:111) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
    at net.minecraftforge.fml.ModList.lambda$static$0(ModList.java:82) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
    at net.minecraftforge.fml.LifecycleEventProvider.dispatch(LifecycleEventProvider.java:70) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
    at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:153) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
    at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:896) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
    at net.minecraftforge.fml.ModLoader.loadMods(ModLoader.java:141) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
    at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:62) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
    at net.minecraft.client.Minecraft.init(Minecraft.java:455) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:385) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
    at net.minecraft.client.main.Main.main(Main.java:117) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_211]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:19) [modlauncher-1.0.0.jar:?]
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:32) [modlauncher-1.0.0.jar:?]
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:50) [modlauncher-1.0.0.jar:?]
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:57) [modlauncher-1.0.0.jar:?]
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:43) [modlauncher-1.0.0.jar:?]
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:98) [forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar:?]
[07mai2019 15:39:06.238] [Client thread/FATAL] [net.minecraftforge.fml.ModLoader/]: Failed to complete lifecycle event LOAD_REGISTRIES, 1 errors found
[07mai2019 15:39:06.363] [Client thread/INFO] [net.minecraft.resources.SimpleReloadableResourceManager/]: Reloading ResourceManager: forge-1.13.2-25.0.191_mapped_snapshot_20180921-1.13-recomp.jar, main, Default
[07mai2019 15:39:20.922] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager/]: Starting up SoundSystem version 201809301515...
[07mai2019 15:39:21.148] [Thread-5/INFO] [net.minecraft.client.audio.SoundManager/]: Initializing No Sound
[07mai2019 15:39:21.148] [Thread-5/INFO] [net.minecraft.client.audio.SoundManager/]: (Silent Mode)
[07mai2019 15:39:22.610] [Thread-5/INFO] [net.minecraft.client.audio.SoundManager/]: OpenAL initialized.
[07mai2019 15:39:22.614] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager/SOUNDS]: Preloading sound minecraft:sounds/ambient/underwater/underwater_ambience.ogg
[07mai2019 15:39:22.617] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager/SOUNDS]: Sound engine started
[07mai2019 15:39:29.099] [Client thread/INFO] [net.minecraft.client.renderer.texture.TextureMap/]: Max texture size: 16384
[07mai2019 15:39:32.076] [Client thread/INFO] [net.minecraft.client.renderer.texture.TextureMap/]: Created: 512x512 textures-atlas
[07mai2019 15:39:35.314] [Client thread/ERROR] [net.minecraftforge.fml.ModLoader/]: Skipping lifecycle event ENQUEUE_IMC, 1 errors found.
[07mai2019 15:39:35.314] [Client thread/FATAL] [net.minecraftforge.fml.ModLoader/]: Failed to complete lifecycle event ENQUEUE_IMC, 1 errors found
[07mai2019 15:39:37.586] [Client thread/INFO] [com.mojang.text2speech.NarratorWindows/]: Narrator library for x64 successfully loaded
[07mai2019 15:39:38.544] [Realms Notification Availability checker #1/INFO] [com.mojang.realmsclient.client.RealmsClient/]: Could not authorize you against Realms server: Invalid session id
 

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

    • 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" } } }  
    • All versions of Minecraft Forge suddenly black screen even without mods (tried reinstalling original Minecraft, Java, updating drivers doesn't work)
  • Topics

×
×
  • Create New...

Important Information

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