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



×
×
  • Create New...

Important Information

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