Started by
Xavion
on
Topic category: Help with Minecraft modding (Java Edition)
I want to make a block that emits a redstone signal when right-clicked (Like a lever). The right-click part is easy, I have that working already. I just have two variants (on and off) of the block, and right-clicking it switches which one it is.
However, upon looking through the forums, I have found that MCREATOR doesn't have a (working) "redstone output" option. So i'm going to try edit the code of the block itself. Ideally by copying whatever code the "Block of Redstone" uses. Problem is...I can't find that code anywhere. Anybody have the code for the Redstone block?
Put this in your block class:
public boolean canProvidePower(BlockState state) {
return true;
}
public int getWeakPower(BlockState blockState, IBlockReader blockAccess, BlockPos pos, Direction side) {
return 15;
}
The other answer is perfect but you go to the third item down in the external libraries > net > minecraft > block > RedstoneBlock
Thanks guys! I have it working perfectly now, thanks to the two of you (: !
How do I get to the external libraries?
do you know how i could add something like this? im trying to make essentially a duplicate of redstone