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.

Featured Replies

Posted

hi im trying to get it so that when i use bonemeal on soul soil it turns into ferilized soul soil

i can get it so when i use bone meal on any block it changes to fertilized soul soil but as as soon as i try to restrict it to only soul soil it stops working

@SubscribeEvent public void onSoulSoilClick(PlayerInteractEvent.RightClickBlock e) { World world = e.getWorld(); PlayerEntity player = e.getPlayer(); ItemStack hand = e.getItemStack(); BlockPos targetpos = e.getPos(); BlockState state = world.getBlockState(targetpos); Block block = state.getBlock(); if (world.isRemote) { return; } if (!hand.getItem().equals(Items.BONE_MEAL)) { return; } if (block.equals(Blocks.SOUL_SOIL)) { world.setBlockState(targetpos, ModBlocks.FERTILE_SOUL_SOIL.get().getDefaultState()); } }

       @SubscribeEvent
    public void onSoulSoilClick(PlayerInteractEvent.RightClickBlock e) {
        World world = e.getWorld();
        PlayerEntity player = e.getPlayer();
        ItemStack hand = e.getItemStack();
        BlockPos targetpos = e.getPos();
        BlockState state = world.getBlockState(targetpos);
        Block block = state.getBlock();
        if (world.isRemote) {
            return;
        }
        if (!hand.getItem().equals(Items.BONE_MEAL)) {
            return;
        }
        if (block.equals(Blocks.SOUL_SOIL)) {
            world.setBlockState(targetpos, ModBlocks.FERTILE_SOUL_SOIL.get().getDefaultState());
        }
        if (!player.isCreative()) {
            hand.shrink(1);
        }
        }

 

Edited by TamsynnImogen

  • Author

the fertilized soul soil allows crops to grow on it. original plan was to get soul soil to be tillable and then get it so it acts like farmland but needing lava instead of water but couldnt figure out how to get it to be tillable so changed the plan and got it so you craft it with bone meal to make it fertilized and that'll take over wich worked but thought would be more fun to have it instead of a crafting recipe to get it done in world sortta thing

  • Author

oh ok

well ive fixed it anyway all it was instead of

 

if (block.equals(Blocks.SOUL_SOIL))

i used

if (block == (Blocks.SOUL_SOIL))

and it works (probably could remove the brackes around Blocks.SOUL_SOIL but was just a v quick test

 

i'll look into what you susgested later though as its probably better but for now im just glad it worked

  • Author

well for some reason with the 1st option it didnt work but when used the second option it worked. im not questioning it as long as it works for now is good enough for me

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.