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

Hey,

 

I made a mod with 2 custom simple blocks, but i was thinking how can i make that for example Block numer 2 can only be placed on Block numer 1 and on no other block. I am also interested how can i make a chat message for the block breaker for example when player break a Block number 2 it will show a message on the chat only for the breaker 'Hey its me' :D ??

 

Sorry for my English.

BaX

I made a mod with 2 custom simple blocks, but i was thinking how can i make that for example Block numer 2 can only be placed on Block numer 1 and on no other block.

 

This will work if the position indeed needs to be corrected with an offset, otherwise remove that part.

 

@Override  // In Block 2
public boolean canPlaceBlockAt(World worldIn, BlockPos pos) 
{
     // Block block1 = new Block1();
     if (worldIn.getBlockState(pos.offset(EnumFacing.DOWN)).getBlock().equals(block1))
     {
          return true;
     }
     else return false;
}

I still haven't published a mod because I can never get that in-dev version just right to warrant a public release. And yes, after two years of mod development I am still learning to speak Java.

 

Follow me on GitHub: https://github.com/yooksi

Contact me on Twitter: https://twitter.com/yooksi

Read my Minecraft blog: https://yooksidoesminecraft.blogspot.de/

A method like that does not exist in Block, however you can take a look at ItemStack#canPlaceOn. I've never used it so I am unsure about what exactly does it do but I believe it's worth to take a look.

I still haven't published a mod because I can never get that in-dev version just right to warrant a public release. And yes, after two years of mod development I am still learning to speak Java.

 

Follow me on GitHub: https://github.com/yooksi

Contact me on Twitter: https://twitter.com/yooksi

Read my Minecraft blog: https://yooksidoesminecraft.blogspot.de/

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.