Block Only Placable on Certain Sides

Started by TheReallyFatChicken on Mon, 06/08/2020 - 19:27

Topic category: Help with modding (Java Edition)

Last seen on 22:49, 17. Mar 2021
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Block Only Placable on Certain Sides
Mon, 06/08/2020 - 19:27

Is there any way to check what side of a block something is being placed on? For example, making something that can only be placed on the sides of other blocks, or only on the top, etc.

Sorry if I'm phrasing this poorly.

Last seen on 23:27, 4. Apr 2021
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You may want to set the…
Tue, 06/09/2020 - 18:26

You may want to set the first block to have no rotation, then for the second block which you want to be only placeable on certain sides of the first you can verify if the block at given direction(x+1,x-1,z+1,z-1,y+1 or y-1) is the first block, if not then destroy it and drop it. If you want the first block to have rotation, then set rotation on it but the second will also need to verify which direction is the first block facing(not sure if you can, guess so), it will make the code more complex and you will need to write down all the right possibilities.