Electroblob's Wizardry
  • Home
  • Changelog
  • Addons
  • Credits
  • Gameplay content
    • Particles
    • Spells
      • Magic Missile
  • 💾Dev
    • ParticleBuilder and ParticleWizardry
    • Create Temporally Blocks
Powered by GitBook
On this page
  1. Dev

Create Temporally Blocks

Using the example, the Spectral Block (Cast by spells):

  1. You will need a Block that extends BlockWithEntity (Or anyone related)

public class SpectralBlock extends BlockWithEntity {
    public SpectralBlock() {
        super(
        //ITEM SETTINGS HERE
        );
    }

}
  1. Now just createBlockEntity create a BlockEntityTimer and set the max time

public class SpectralBlock extends BlockWithEntity {
    public SpectralBlock() {
        super(
        //ITEM SETTINGS HERE
        );
    }

    @Nullable
    @Override
    public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
        BlockEntityTimer blockEntityTimer = new BlockEntityTimer(pos, state);
        blockEntityTimer.setMaxTime(1200);

        return blockEntityTimer;
    }
}
  1. Now just put your own functions and features to your fantastic block ^^

PreviousParticleBuilder and ParticleWizardry

Last updated 1 year ago

💾