Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Spring

Members
  • Joined

  • Last visited

Everything posted by Spring

  1. { "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
  2. Ok i try to do
  3. It means I need to implement a complete set of furnace code, right?
  4. 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?
  5. Yes, but I think they are too difficult to understand, and I don’t know which method to use
  6. 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.
  7. 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
  8. I got it, I didn't recreate the world
  9. I deleted it because I didn’t write it in the video tutorial, And i don't know what is needed inside
  10. 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()); } }
  11. I don’t really understand, what else do I need to register?
  12. 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
  13. 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); }
  14. 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 !
  15. @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 !
  16. But I want to return to the bowl after eating my custom food. If super.finishUsingItem is used, the bowl will not be returned.
  17. saturationMod does not work I am using Google Translate, if you don’t understand, I’m sorry
  18. 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 !

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.