Making Modded Block Emit Redstone Power

Started by NinjaCow on

Topic category: User side tutorials

Active 4 years ago
Joined Apr 2021
Points:
574

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 0
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.

 

Active 9 months ago
Joined May 2020
Points:
731

User statistics:

  • Modifications: 3
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 128
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

Active 4 years ago
Joined Aug 2020
Points:
615

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1
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.

Active 11 months ago
Joined Jun 2019
Points:
804

User statistics:

  • Modifications: 1
  • Forum topics: 20
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 71
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.

Active 2 years ago
Joined Sep 2022
Points:
373

User statistics:

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

do you have a template?

 

Active 2 years ago
Joined Feb 2023
Points:
272

User statistics:

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

is there a way to emit on one side ?