-
|
So i am trying to create a custom block.I am using instance.setBlock() to modify my block before placing it in the onPlace() method.The problem is instance.setBlock() triggers onPlace() method. Is there a way to modify/set block without triggering onPlace() method? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hey! BlockHandlers aren't particularly meant to be modifying blocks at all, but adding functionality on top of them--think falling blocks like anvil, gravel, sand, etc. In your scenario I would look into a BlockPlacementRule, shown off for two blocks in the demo folder: Dripstone and Beds. Although it sounds funky to have a BlockPlacementRule here, it is the only way to modify the block BEFORE placing it that I'm aware of right now :p |
Beta Was this translation helpful? Give feedback.
Hey! BlockHandlers aren't particularly meant to be modifying blocks at all, but adding functionality on top of them--think falling blocks like anvil, gravel, sand, etc.
In your scenario I would look into a BlockPlacementRule, shown off for two blocks in the demo folder: Dripstone and Beds.
Although it sounds funky to have a BlockPlacementRule here, it is the only way to modify the block BEFORE placing it that I'm aware of right now :p