Posted April 21, 20196 yr I have a problem to unable to set a property to IBlockState. Here is my code. public class BlockDock extends Block { public static final EnumProperty<EnumContainer> CONTAINER = EnumProperty.<EnumContainer>create("container", EnumContainer.class); public BlockDock(String name) { super(Properties.create(Material.IRON).hardnessAndResistance(1.5F, 1.0F).sound(SoundType.METAL)); setRegistryName(new ResourceLocation(ContainerMod.MODID, name)); setDefaultState(getDefaultState().with(CONTAINER, EnumContainer.EMPTY)); } } and error... Caused by: java.lang.IllegalArgumentException: Cannot set property EnumProperty{name=container, clazz=class com.snowstep115.container.util.EnumContainer, values=[EMPTY, QUEUE, STACK]} as it does not exist in Block{minecraft:air} at net.minecraft.state.AbstractStateHolder.func_206870_a(SourceFile:106) at com.snowstep115.container.block.BlockDock.<init>(BlockDock.java:36) at com.snowstep115.container.item.ItemDock.<init>(ItemDock.java:10) at com.snowstep115.container.ModItems.<clinit>(ModItems.java:11) ... 30 more Would you tell me the correct way to do it. Thank you.
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.