Posted February 11, 20232 yr Hello, I have a problem. I have created a class representing my block that extends the Block class. I want to implement lamp-like behavior: the block can be powered or not. I want to detect this change somehow. Unfortunately, after a long time of searching, I couldn't find a solution. On the Internet I found the use of various methods from the BlockBehaviour class, but most of them are deprecated, e.g. use, neighborChanged, getSignal, etc. Is there any substitute for such methods? I will be grateful for your help!
February 12, 20232 yr On 2/11/2023 at 8:49 AM, Adixe said: Hello, I have a problem. I have created a class representing my block that extends the Block class. I want to implement lamp-like behavior: the block can be powered or not. I want to detect this change somehow. Unfortunately, after a long time of searching, I couldn't find a solution. On the Internet I found the use of various methods from the BlockBehaviour class, but most of them are deprecated, e.g. use, neighborChanged, getSignal, etc. Is there any substitute for such methods? I will be grateful for your help! Look at the minecraft code? Specifically, the RedstoneLampBlock since that is doing exactly what you want.
February 12, 20232 yr Author 7 minutes ago, ChampionAsh5357 said: Look at the minecraft code? Specifically, the RedstoneLampBlock since that is doing exactly what you want. Oh, thanks! I hadn't thought of such a solution. Indeed, I found everything I need. Next time I'll just look at a similar block.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.