Topic category: User side tutorials
I figured out how to make a MCreator block emit redstone power, and as there was nothing on the forums or the YouTube tutorial list, I thought I would share what I found.
1) Create the block in MCreator. Make sure that all the features of the block except for the redstone output are as you want them, because after this step there is no way to change them.
2) Lock the code for the block and open up the code for the block in the built in text editor for the block's Java file.
3) insert the code shown below into the code underneath the block's constructor. (The constructor looks like this: public CustomBlock() { } )
public boolean canProvidePower(BlockState state) {
return true;
}
public int getWeakPower(BlockState blockState, IBlockReader blockAccess, BlockPos pos, Direction side) {
return 15;
}
That's it! The block should now emit a redstone power level of 15 on all sides.
Wonderful!
I was searching how to do this. One question tough: is there a way to emit power only when certain conditions are met? (ie Day light Sensor that activates only at day/night)
PS: Sorry for my bad english, I'm french
Could you give an example please i'm not sure where to put it.
Could you make a tutorial on this? I am not to sure how to do this.
do you have a template?
is there a way to emit on one side ?