Posted January 27, 20169 yr 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' ?? Sorry for my English. BaX
January 28, 20169 yr Author I know also there is a method in command block "canPlaceON" or something like that. Where can i find that?
January 28, 20169 yr 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/
January 28, 20169 yr Author Yee i know, it work, but i am interested where can i read about canPlaceOn method
January 29, 20169 yr 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.