Cocoa Bean-like behaviour on specific blocks

Started by brigantes on

Topic category: Help with modding (Java Edition)

Last seen on 11:21, 11. May 2024
Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Cocoa Bean-like behaviour on specific blocks

I'm trying to add a block that behaves like Cocoa Bean pods in vanilla Minecraft (minus the growth stages). I have figured everything out to do except making the block limited to being only placeable on one specific log block. I've tried multiple additional procedures but just can't get it to work. I would ideally also like the block to break once the log block it is attached to is broken.

Last seen on 20:37, 26. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For your first issue, you…
Sun, 10/01/2023 - 14:09
  • For your first issue, you need to first make sure your block is directionally placeable, then just make a placement condition that checks the 'placed against' blockstate is your desired block. (If this doesn't work for some reason, you could also make a procedure that triggers when placed, checks if the block it's attatched to is correct depending on the direction, and breaks it otherwise, but that's not an ideal solution.)
  • For your second problem, just make a neighbor block update procedure that checks if the block it's attatched to is still the correct block, based on the direction.
Last seen on 11:21, 11. May 2024
Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How would I test if the…
Sun, 10/01/2023 - 14:33

How would I test if the block is directionally placeable? I have it set to Y Axis Rotation and it places against blocks just fine, the log also naturally has log rotation.

 

As for the procedure, how would I go about doing that since I've essentially tried doing that already and it just doesn't seem to make a difference. (https://imgur.com/a/3qJpK5t - this is the most recent version I've tried). The problem I have too is getting it to attach to the block, I don't understand how to do that within the procedures

Last seen on 20:37, 26. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Not sure what's up with your…
Sun, 10/01/2023 - 15:46

Not sure what's up with your code, it looks very broken. Do something like this for the 'when neighbor block changed. (This is for a six-directional block, you only really need the 4 cardinal directions.) You can do something very similar for checking if the block can be placed; just return true if the block at the correct position, (based on the direction it was placed), is your correct log block; or make a procedure that, when the block is placed, checks if the attatched block is the correct log type, and breaks the block otherwise.