blocks you can only place on specific other blocks

Started by TheRidiculousR on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
blocks you can only place on specific other blocks

I have made a mod that includes a bunch of trees, and one of them grows fruits in the form of modeled blocks.
when you get this block you can place it anywhere and it looks like they're just floating there and its quite messy, so is there any way to make it only placeable below leaves, or not placeable at all?
or being able to swap the model out when it's placed on the ground?

Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Do a tick Event for it then…
Wed, 07/01/2020 - 10:07

Do a tick Event for it then do:

get block at x y[-1/+1] z is the same block as {Leaves or another block you want it to place on}

then do if the block isnt the Right block [Destroy block at x y z and spawn a gem of ot]

Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It already works like that…
Thu, 07/02/2020 - 08:30

It already works like that now, but it would be a lot cleaner if i could make it just like how you cant even place a lilypad on normal blocks or cant even place cocoa beans on other logs.
though i made it drop an item duplicate that looks the same but it's food instead of a placable block.

Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could do that shall I…
Thu, 07/02/2020 - 10:03

You could do that shall I explain how ?

Please Response cause it will take some time to explaine it!

 

Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
no, I don't need this…
Sun, 07/12/2020 - 12:04

no, I don't need this anymore because I came up with something else, where the block drops a food item instead of the block itself. still thanks for the help

Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
but actually if you know how…
Sun, 07/12/2020 - 12:05

but actually if you know how to make something placeable on water, i'd love help with that