Making Modded Block Emit Redstone Power

Started by NinjaCow on

Topic category: User side tutorials

Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Making Modded Block Emit Redstone Power

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.

 

Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wonderful! I was  searching…
Wed, 04/07/2021 - 11:03

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

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Could you give an example…
Mon, 04/26/2021 - 21:27

Could you give an example please i'm not sure where to put it.

Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Could you make a tutorial on…
Tue, 03/08/2022 - 03:25

Could you make a tutorial on this? I am not to sure how to do this.

Joined Sep 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
do you have a template?  
Sat, 09/10/2022 - 15:56

do you have a template?

 

Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
is there a way to emit on…
Sun, 04/16/2023 - 13:09

is there a way to emit on one side ?