Repository navigation
Delay for a custom tnt before blowing up #2864
Unanswered
DeeZasterArts
asked this question in
Q&A
Replies: 1 comment
|
The same way vanilla TNT does it - an entity that the block spawns when it lights. However if you want to avoid that you could look into scheduling a tick (I believe theres a scheduleTick method on Level to call and a tick method on Block to override), but you won't really be able to do fancy visuals with that (like how TNT flashes). This would also mean someone could move the block or mine it to cancel the explosion. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hey guys I'm trying to make a custom tnt, this is what I made for now.
I wanted to add a delay before it blows up, what's the best way to do that?
`@Override
protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, BlockPos neighborPos, boolean movedByPiston) {
super.neighborChanged(state, level, pos, neighborBlock, neighborPos, movedByPiston);
public void explode(Level level, BlockPos pos){ ExplosionHandler.explode(new ExplosionContext( ExplosionContext.SimulationType.POLYHEDRAL, level, getVec3(pos), 25f, false, false, false, false, null )); }All reactions