Kaboom Roads Posted December 24, 2022 Posted December 24, 2022 (edited) I have a custom tree. I can place it with the place command, and it generates in world gen. But when I try to grow the custom sapling it doesn't work. The sapling works with a vanilla tree grower, but not with my own tree grower. This is my sapling: public static final RegistryObject<Block> ABYSSAL_SAPLING = registerBlockAndItem("abyssal_sapling", () -> new AbyssalSaplingBlock(new AbyssalTreeGrower(), BlockBehaviour.Properties.copy(Blocks.OAK_SAPLING).color(MaterialColor.COLOR_CYAN))); This is my configured features class: public class ExtraConfiguredFeatures { public static final DeferredRegister<ConfiguredFeature<?, ?>> CONFIGURED_FEATURES = DeferredRegister.create(Registries.CONFIGURED_FEATURE, SculkyExtras.MOD_ID); public static final ResourceKey<ConfiguredFeature<?, ?>> ABYSSAL_TREE = createKey("abyssal_tree"); public static final ResourceKey<ConfiguredFeature<?, ?>> ORE_DEEPSLATE = createKey("ore_deepslate"); public static final ResourceKey<ConfiguredFeature<?, ?>> ORE_SCULK = createKey("ore_sculk"); public static final ResourceKey<ConfiguredFeature<?, ?>> ORE_TUFF = createKey("ore_tuff"); public static final ResourceKey<ConfiguredFeature<?, ?>> SCULK_LUSTRE_EXTRA = createKey("sculk_lustre_extra"); public static final ResourceKey<ConfiguredFeature<?, ?>> SCULK_TENDRIL_PATCH = createKey("sculk_tendril_patch"); public static final ResourceKey<ConfiguredFeature<?, ?>> SPRING_SCULK_OPEN = createKey("spring_sculk_open"); public static ResourceKey<ConfiguredFeature<?, ?>> createKey(String name) { return ResourceKey.create(CONFIGURED_FEATURES.getRegistryKey(), new ResourceLocation(name)); } public static void register(IEventBus eventBus) { CONFIGURED_FEATURES.register(eventBus); } } This is my custom tree grower class: public class AbyssalTreeGrower extends AbstractTreeGrower { @Nullable @Override protected ResourceKey<ConfiguredFeature<?, ?>> getConfiguredFeature(@NotNull RandomSource randomSource, boolean largeHive) { return ExtraConfiguredFeatures.ABYSSAL_TREE; } } This is my configured feature { "type": "minecraft:tree", "config": { "decorators": [], "dirt_provider": { "type": "minecraft:simple_state_provider", "state": { "Name": "minecraft:sculk" } }, "foliage_placer": { "type": "minecraft:random_spread_foliage_placer", "foliage_height": 2, "leaf_placement_attempts": 70, "offset": 0, "radius": 3 }, "foliage_provider": { "type": "minecraft:simple_state_provider", "state": { "Name": "sculkyextras:abyssal_leaves", "Properties": { "distance": "7", "persistent": "false", "waterlogged": "false" } } }, "force_dirt": false, "ignore_vines": true, "minimum_size": { "type": "minecraft:two_layers_feature_size", "limit": 1, "lower_size": 0, "upper_size": 1 }, "trunk_placer": { "type": "minecraft:straight_trunk_placer", "base_height": 4, "height_rand_a": 2, "height_rand_b": 0 }, "trunk_provider": { "type": "minecraft:simple_state_provider", "state": { "Name": "sculkyextras:abyssal_log", "Properties": { "axis": "y" } } } } } Edited December 24, 2022 by Kaboom Roads Quote
warjort Posted December 24, 2022 Posted December 24, 2022 Quote public static final ResourceKey<ConfiguredFeature<?, ?>> ABYSSAL_TREE = createKey("abyssal_tree"); -- snip public static ResourceKey<ConfiguredFeature<?, ?>> createKey(String name) { // no mod id passed to new ResourceLocation() as the namespace return ResourceKey.create(CONFIGURED_FEATURES.getRegistryKey(), new ResourceLocation(name)); } Your ABYSSAL_TREE configured feature has the name minecraft:abyssal_tree ? Quote Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
Kaboom Roads Posted December 24, 2022 Author Posted December 24, 2022 I changed new ResourceLocation(name) to new ResourceLocation(SculkyExtras.MOD_ID, name) and now it works. Thanks! Quote
Recommended Posts
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.