Jump to content

Temenstro

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Temenstro

  1. how would you solve this problem? I mean adding a timeout before the block expires
  2. @Override public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) { if(!level.isClientSide&&hand == InteractionHand.MAIN_HAND) { boolean lit = state.getValue(LIT); if (lit) { new Thread(() -> { player.hurt(DamageSource.LIGHTNING_BOLT, 2); level.setBlock(pos, state.cycle(LIT), 3); try { Thread.sleep(300); }catch (Exception e){} level.setBlock(pos, state.cycle(LIT), 3); }).start(); } } return super.use(state, level, pos, player, hand, hitResult); } i`m sory
  3. @Override public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) { if(!level.isClientSide&&hand == InteractionHand.MAIN_HAND) { boolean lit = state.getValue(LIT); if (lit) { new Thread(() -> { player.hurt(DamageSource.LIGHTNING_BOLT, 2); level.setBlock(pos, state.cycle(LIT), 3); try { Thread.sleep(300); }catch (Exception e){} level.setBlock(pos, state.cycle(LIT), 3); }).start(); } } return super.use(state, level, pos, player, hand, hitResult); } Why this not work? it doesn't go out
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.