
Nati_Waty
Members-
Posts
5 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Nati_Waty's Achievements

Tree Puncher (2/8)
0
Reputation
-
I want to create a feature to generate a trunk without leaves on my custom biome but when I try to create a new world or entering an existing one, I have this error : [Render thread/ERROR]: Feature: Not a JSON object: "minecraft:spring_water"; Not a JSON object: "minecraft:patch_pumpkin"; Not a JSON object: "minecraft:patch_sugar_cane"; Not a JSON object: "minecraft:patch_grass_forest"; Not a JSON object: "minecraft:flower_default"; Not a JSON object: "minecraft:glow_lichen"; Not a JSON object: "minecraft:forest_flower_vegetation"; Not a JSON object: "vanillaenhancer:sakura_trunk" Here are all the files related to the custom feature and biome: In order: Feature JSON, Biome JSON, Feature Class, FeatureInit Class, BiomeInit Class { "type": "minecraft:decorated", "config": { "decorator": { "type": "minecraft:count", "config": { "count": { "type": "minecraft:constant", "value": 4 } } }, "feature": { "type": "minecraft:decorated", "config": { "decorator": { "type": "minecraft:decorated", "config": { "outer": { "type": "minecraft:square", "config": {} }, "inner": { "type": "minecraft:heightmap_spread_double", "config": { "heightmap": "WORLD_SURFACE" } } } }, "feature": { "type": "vanillaenhancer:sakura_trunk", "config": {} } } } } } { "surface_builder": "minecraft:grass", "depth": 0.1, "scale": 0.2, "temperature": 0.6, "downfall": 0.6, "precipitation": "rain", "category": "forest", "player_spawn_friendly": false, "effects": { "sky_color": 8037887, "fog_color": 12638463, "water_color": 4159204, "water_fog_color": 329011, "mood_sound": { "sound": "minecraft:ambient.cave", "tick_delay": 6000, "block_search_extent": 8, "offset": 2 } }, "starts": [ "minecraft:mineshaft", "minecraft:stronghold", "minecraft:ruined_portal" ], "spawners": { "monster": [ { "type": "minecraft:spider", "weight": 100, "minCount": 4, "maxCount": 4 }, { "type": "minecraft:zombie", "weight": 95, "minCount": 4, "maxCount": 4 }, { "type": "minecraft:zombie_villager", "weight": 5, "minCount": 1, "maxCount": 1 }, { "type": "minecraft:skeleton", "weight": 100, "minCount": 4, "maxCount": 4 }, { "type": "minecraft:creeper", "weight": 100, "minCount": 4, "maxCount": 4 }, { "type": "minecraft:slime", "weight": 100, "minCount": 4, "maxCount": 4 }, { "type": "minecraft:enderman", "weight": 10, "minCount": 1, "maxCount": 4 }, { "type": "minecraft:witch", "weight": 5, "minCount": 1, "maxCount": 1 } ], "creature": [ { "type": "minecraft:sheep", "weight": 12, "minCount": 4, "maxCount": 4 }, { "type": "minecraft:pig", "weight": 10, "minCount": 4, "maxCount": 4 }, { "type": "minecraft:chicken", "weight": 10, "minCount": 4, "maxCount": 4 }, { "type": "minecraft:cow", "weight": 8, "minCount": 4, "maxCount": 4 } ], "ambient": [ { "type": "minecraft:bat", "weight": 10, "minCount": 8, "maxCount": 8 } ], "underground_water_creature": [ { "type": "minecraft:glow_squid", "weight": 10, "minCount": 4, "maxCount": 6 }, { "type": "minecraft:axolotl", "weight": 10, "minCount": 4, "maxCount": 6 } ], "water_creature": [], "water_ambient": [], "misc": [] }, "spawn_costs": {}, "carvers": { "air": [ "minecraft:cave", "minecraft:canyon" ] }, "features": [ [], [ "minecraft:lake_water", "minecraft:lake_lava" ], [ "minecraft:amethyst_geode" ], [ "minecraft:monster_room" ], [], [], [ "minecraft:ore_dirt", "minecraft:ore_gravel", "minecraft:ore_granite", "minecraft:ore_diorite", "minecraft:ore_andesite", "minecraft:ore_tuff", "minecraft:ore_deepslate", "minecraft:ore_coal", "minecraft:ore_iron", "minecraft:ore_gold", "minecraft:ore_redstone", "minecraft:ore_diamond", "minecraft:ore_lapis", "minecraft:ore_copper", "minecraft:disk_sand", "minecraft:disk_clay", "minecraft:disk_gravel" ], [ "minecraft:rare_dripstone_cluster", "minecraft:rare_small_dripstone" ], [ "vanillaenhancer:sakura_trunk", "minecraft:forest_flower_vegetation", "minecraft:glow_lichen", "minecraft:flower_default", "minecraft:patch_grass_forest", "minecraft:patch_sugar_cane", "minecraft:patch_pumpkin", "minecraft:spring_water" ], [ "minecraft:freeze_top_layer" ] ] } package fr.nati.vanillaenhancer.common.world.feature; import com.mojang.serialization.Codec; import fr.nati.vanillaenhancer.core.init.BlockInit; import net.minecraft.core.BlockPos; import net.minecraft.tags.BlockTags; import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelSimulatedReader; import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; public class SakuraTrunk extends Feature<NoneFeatureConfiguration>{ private static final BlockState SAKURA_LOG = BlockInit.SAKURA_LOG.get().defaultBlockState(); public SakuraTrunk(Codec<NoneFeatureConfiguration> codec) { super(codec); } @Override public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> context) { BlockPos pos = context.origin(); WorldGenLevel reader = context.level(); while (pos.getY() > 1) { pos = pos.below(); } pos = pos.above(); for (int i = 0; i < 4; i++) setBlock(reader, pos.above(i), SAKURA_LOG); return false; } } package fr.nati.vanillaenhancer.core.init; import fr.nati.vanillaenhancer.VanillaEnhancer; import fr.nati.vanillaenhancer.common.world.feature.SakuraTrunk; import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraftforge.fmllegacy.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public class FeatureInit { public static final DeferredRegister<Feature<?>> FEATURES = DeferredRegister.create(ForgeRegistries.FEATURES, VanillaEnhancer.MOD_ID); public static final RegistryObject<SakuraTrunk> SAKURA_TRUNK = FEATURES.register("sakura_trunk", () -> new SakuraTrunk(NoneFeatureConfiguration.CODEC)); } package fr.nati.vanillaenhancer.core.init; import java.util.function.Supplier; import fr.nati.vanillaenhancer.VanillaEnhancer; import net.minecraft.core.Registry; import net.minecraft.data.worldgen.biome.VanillaBiomes; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.biome.Biome; import net.minecraftforge.common.BiomeManager; import net.minecraftforge.fmllegacy.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; public class BiomeInit { public static final DeferredRegister<Biome> BIOMES = DeferredRegister.create(ForgeRegistries.BIOMES, VanillaEnhancer.MOD_ID); static { createBiome("sakura_forest", VanillaBiomes::theVoidBiome); } public static ResourceKey<Biome> SAKURA_FOREST = registerBiome("sakura_forest"); public static ResourceKey<Biome> registerBiome(String biomeName) { return ResourceKey.create(Registry.BIOME_REGISTRY, new ResourceLocation(VanillaEnhancer.MOD_ID, biomeName)); } public static RegistryObject<Biome> createBiome(String biomeName, Supplier<Biome> biome) { return BIOMES.register(biomeName, biome); } public static void registerBiomes() { BiomeManager.addBiome(BiomeManager.BiomeType.COOL, new BiomeManager.BiomeEntry(SAKURA_FOREST, 10)); } }
-
[1.17.1] Lily Pad-like block not placing well
Nati_Waty replied to Nati_Waty's topic in Modder Support
I want to create a feature to generate a trunk without leaves on my custom biome but when I try to create a new world or entering an existing one, I have this error : [Render thread/ERROR]: Feature: Not a JSON object: "minecraft:spring_water"; Not a JSON object: "minecraft:patch_pumpkin"; Not a JSON object: "minecraft:patch_sugar_cane"; Not a JSON object: "minecraft:patch_grass_forest"; Not a JSON object: "minecraft:flower_default"; Not a JSON object: "minecraft:glow_lichen"; Not a JSON object: "minecraft:forest_flower_vegetation"; Not a JSON object: "vanillaenhancer:sakura_trunk" I don't know which class or json file I need to show you to help you with my problem -
[1.17.1] Lily Pad-like block not placing well
Nati_Waty replied to Nati_Waty's topic in Modder Support
Thank you so much it works now ! I have also a second question, can I ask it here or do I have to create another topic ? -
[1.17.1] Lily Pad-like block not placing well
Nati_Waty replied to Nati_Waty's topic in Modder Support
Thank you for your answer ! But I register a BlockItem with this code: @SubscribeEvent public static void onRegisterItems(final RegistryEvent.Register<Item> event) { BlockInit.BLOCKS.getEntries().stream().map(RegistryObject::get).forEach(block -> { event.getRegistry().register(new BlockItem(block, new Item.Properties().tab(CreativeModeTab.TAB_MISC)) .setRegistryName(block.getRegistryName())); }); } And I don't know how to "remove" my block of sakura leaves from this code to register it differently -
Hi ! I'm new to modding and coding, sorry in advance if it's an obvious question but I wanted to create a block lily pad-esque but in game I can place this block only on ice or on the side of a full block next to water, but not just on water. I don't understand what I did wrong since I just copy pasted the lily pad code ahah Here's my block class: package fr.nati.vanillaenhancer.common.block; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.vehicle.Boat; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.BushBlock; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Material; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.PlantType; public class DroppedLeavesBlock extends BushBlock implements IPlantable { public DroppedLeavesBlock(BlockBehaviour.Properties properties) { super(properties); } private static final VoxelShape SHAPE = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 1.5D, 15.0D); @SuppressWarnings("deprecation") public void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) { super.entityInside(state, level, pos, entity); if (level instanceof ServerLevel && entity instanceof Boat) { level.destroyBlock(new BlockPos(pos), true, entity); } } public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { return SHAPE; } @Override public boolean mayPlaceOn(BlockState state, BlockGetter world, BlockPos pos) { FluidState fluidstate = world.getFluidState(pos); FluidState fluidstate1 = world.getFluidState(pos.above()); return (fluidstate.getType() == Fluids.WATER || state.getMaterial() == Material.ICE) && fluidstate1.getType() == Fluids.EMPTY; } @Override public PlantType getPlantType(BlockGetter world, BlockPos pos) { return PlantType.WATER; } }