I have made a custom block, I want the block to do something whenever it is powered by redstone but I have been unable to figure out what function I would need to use.
I looked around inn the code and first I found blockActivated but
blockActivated seems to be if a player R-click the block, so I looked at the dispenser and noticed that it is only activating dispenseItem via the function updateTick so I belived that updateTick would be the one I would need to use.
But so far I can't to get it to work, so could anyone please be so kind to explain to me how I need to set up my functions? :smile.gif:
World has methods called (something like this, from memory) isBlockGettingPowered/isBlockGettingPoweredIndirectly. These will return true if your block is being powered by redstone. I honestly am not sure of the difference between the two. If you want to check for when the redstone state changes, you can use onNeighborBlockChange because anything that would change redstone state from off to on or vice versa would also change block ID or metadata and thus cause a block update.
I looked around inn the code and first I found blockActivated but
blockActivated seems to be if a player R-click the block, so I looked at the dispenser and noticed that it is only activating dispenseItem via the function updateTick so I belived that updateTick would be the one I would need to use.
But so far I can't to get it to work, so could anyone please be so kind to explain to me how I need to set up my functions? :smile.gif:
INFORMATION WANTS TO BE WRONG
- I refuse to write a signature, and you cannot make me. No.