Everything posted by Spring
-
flower state error
{ "parent": "minecraft:block/cross", "textures": { "cross": "chinacraft:block/azalea" } } public class Azalea extends FlowerBlock { public Azalea() { super(Effects.DIG_SPEED, 2, Properties.copy(Blocks.DANDELION)); } } Please help me, see the picture below
- Custom container issue
-
Custom container issue
It means I need to implement a complete set of furnace code, right?
-
Custom container issue
I just want a function of the furnace, just put in coal and burn it. That's it. I don't need other functions Do I need to show you my code?
-
Custom container issue
Yes, but I think they are too difficult to understand, and I don’t know which method to use
-
Custom container issue
I want to implement a function. I now have a custom container. I want to put Furnace that can burn, such as coal. Then she will burn like a Furnace, how can I do it The container code is complete, now only need to put the coal and start burning.
-
Block drop conditions
Hello, I want to implement a function. A block needs a specific enchantment to make it fall, otherwise it will not fall. How to implement it? Is it configured in json or is it a custom block or event? thanks
-
1.16.5 register custom ores
I got it, I didn't recreate the world
-
1.16.5 register custom ores
I deleted it because I didn’t write it in the video tutorial, And i don't know what is needed inside
-
1.16.5 register custom ores
Still not working, I followed the tutorial step by step, did I miss anything? @Mod(value = ApplicationConstants.MOD_ID) public class OceanApplication { public OceanApplication() { MinecraftForge.EVENT_BUS.register(this); IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); ModBlocks.BLOCKS.register(modEventBus); ModItems.ITEMS.register(modEventBus); } } @Mod.EventBusSubscriber(modid = ApplicationConstants.MOD_ID) public class BiomeLoadEvent { @SubscribeEvent public void onBiomeLoading(final BiomeLoadingEvent event) { ModOreGeneration.generateOres(event); } } public class ModOreGeneration { public static void generateOres(final BiomeLoadingEvent event) { for (OreType ore : OreType.values()) { OreFeatureConfig oreFeatureConfig = new OreFeatureConfig( OreFeatureConfig.FillerBlockType.NATURAL_STONE, ore.getBlock().get().defaultBlockState(), ore.getMaxVeinSize()); ConfiguredPlacement<TopSolidRangeConfig> configuredPlacement = Placement.RANGE.configured( new TopSolidRangeConfig(ore.getMinHeight(), ore.getMinHeight(), ore.getMaxHeight())); ConfiguredFeature<?, ?> oreFeature = registerOreFeature(ore, oreFeatureConfig, configuredPlacement); event.getGeneration().getFeatures(GenerationStage.Decoration.UNDERGROUND_ORES).add(() -> oreFeature); } } private static ConfiguredFeature<?, ?> registerOreFeature(OreType ore, OreFeatureConfig oreFeatureConfig, ConfiguredPlacement<?> configuredPlacement) { return Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, Objects.requireNonNull(ore.getBlock().get().getRegistryName()), Feature.ORE.configured(oreFeatureConfig).decorated(configuredPlacement) .squared()); } }
-
1.16.5 register custom ores
I don’t really understand, what else do I need to register?
-
1.16.5 register custom ores
so? public static ConfiguredFeature<?, ?> COPPER_ORE = null; @SubscribeEvent public static void setup(FMLCommonSetupEvent event) { event.enqueueWork(() -> { COPPER_ORE = register(String.valueOf(BlockLoader.COPPER_ORE.get().getRegistryName()), Feature.ORE.configured(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, BlockLoader.COPPER_ORE.get().defaultBlockState(), 17)).range(128) .squared().count(20)); }); } @SubscribeEvent public void onBiomeLoading(final BiomeLoadingEvent biome) { if (biome.getCategory() == Biome.Category.NETHER || biome.getCategory() == Biome.Category.THEEND) { return; } biome.getGeneration().getFeatures(GenerationStage.Decoration.UNDERGROUND_ORES) .add(() -> OreGenerateEvent.COPPER_ORE); } private static <FC extends IFeatureConfig> ConfiguredFeature<?, ?> register(String key, ConfiguredFeature<FC, ?> configuredFeature) { return Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, key, configuredFeature); } What to do next, he still hasn’t taken effect onBiomeLoading() Not loaded
-
1.16.5 register custom ores
like this ? @SubscribeEvent public static void setup(FMLCommonSetupEvent event) { event.enqueueWork(() -> { register(String.valueOf(BlockLoader.COPPER_ORE.get().getRegistryName()), Feature.ORE.configured(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, BlockLoader.COPPER_ORE.get().defaultBlockState(), 17)).range(128) .squared().count(20)); }); } private static <FC extends IFeatureConfig> ConfiguredFeature<?, ?> register(String key, ConfiguredFeature<FC, ?> configuredFeature) { return Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, key, configuredFeature); }
-
1.16.5 register custom ores
hello . I want to register my ore in overworld, but it has no effect Below is my code @Mod.EventBusSubscriber(modid = ApplicationConstants.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class OreGenerateEvent { public static ConfiguredFeature<?, ?> COPPER_ORE = null; @SubscribeEvent public static void setup(FMLCommonSetupEvent event) { ConfiguredFeature<?, ?> register = register(String.valueOf(BlockLoader.COPPER_ORE.get().getRegistryName()), Feature.ORE.configured(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, BlockLoader.COPPER_ORE.get().defaultBlockState(), 17)).range(128) .squared().count(20)); } @SubscribeEvent public void onBiomeLoading(final BiomeLoadingEvent biome) { if (biome.getCategory() == Biome.Category.NETHER || biome.getCategory() == Biome.Category.THEEND) { return; } biome.getGeneration().getFeatures(GenerationStage.Decoration.UNDERGROUND_ORES) .add(() -> OreGenerateEvent.COPPER_ORE); } private static <FC extends IFeatureConfig> ConfiguredFeature<?, ?> register(String key, ConfiguredFeature<FC, ?> configuredFeature) { return Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, key, configuredFeature); } } I refer to the writing of 1.16.4, but it has no effect If I write like this, NullPointException will be thrown public static final ConfiguredFeature<?, ?> ORE_COAL = register("ore_coal", Feature.ORE.configured(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, BlockLoader.COPPER_ORE.get().defaultBlockState(), 17)).range(128).squared().count(20)); my main class @Mod(value = ApplicationConstants.MOD_ID) public class OceanApplication { public OceanApplication() { MinecraftForge.EVENT_BUS.register(this); IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); BlockLoader.BLOCKS.register(modEventBus); ItemLoader.ITEMS.register(modEventBus); } } my BlockLoader class public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, ApplicationConstants.MOD_ID); public static RegistryObject<Block> COPPER_ORE = BLOCKS.register("copper_ore", CopperOre::new); How can he correctly realize the ore generation in the overworld? thanks !
-
Invalid food satiety
@Nonnull @Override public ItemStack finishUsingItem(@Nonnull ItemStack itemStack, @Nonnull World world, @Nonnull LivingEntity livingEntity) { super.finishUsingItem(itemStack, world, livingEntity); return itemStack.isEmpty() ? new ItemStack(Items.BOWL) : itemStack; } solve !
-
Invalid food satiety
But I want to return to the bowl after eating my custom food. If super.finishUsingItem is used, the bowl will not be returned.
-
Invalid food satiety
saturationMod does not work I am using Google Translate, if you don’t understand, I’m sorry
-
Invalid food satiety
hello, i am creating a custom food This is my code public class GrassSalad extends Item { private static final Food FOOD = new Food.Builder().saturationMod(6) .nutrition(6).build(); public GrassSalad() { super(new Properties().tab(GroupDefine.ITEM_GROUP).food(FOOD).stacksTo(1)); } /** * 物品被使用(吃掉) * * @param itemStack 物品堆 * @param world 世界 * @param livingEntity 活着的实体 * @return ItemStack */ @Nonnull @Override public ItemStack finishUsingItem(@Nonnull ItemStack itemStack, @Nonnull World world, @Nonnull LivingEntity livingEntity) { if (!world.isClientSide) { livingEntity.curePotionEffects(itemStack); } //如果是一个玩家并且该玩家是创造模式 if (livingEntity instanceof PlayerEntity && !((PlayerEntity) livingEntity).abilities.instabuild) { itemStack.shrink(1); } return itemStack.isEmpty() ? new ItemStack(Items.BOWL) : itemStack; } } The bowl can be returned correctly, but the fullness of the food is invalid please help me ,thanks !
IPS spam blocked by CleanTalk.