Posted July 23, 20196 yr I don't understand why this isn't working. No matter what I do, the blocks always fall strait down. public void execute(Chunk chunk, int topIn){ World world = chunk.getWorld(); if(world.isRemote) return; Random rand = new Random(); int x = (chunk.getPos().getXEnd() - chunk.getPos().getXStart())/2 + chunk.getPos().getXStart(); int z = (chunk.getPos().getZEnd() - chunk.getPos().getZStart())/2 + chunk.getPos().getZStart(); BlockPos top = new BlockPos(x,topIn,z); for(MutableBlockPos pos : BlockPos.getAllInBoxMutable(top.add(-3, -3, -3), top.add(3, 3, 3))){ EntityFallingBlock entity = new EntityFallingBlock(world, pos.getX(), pos.getY()+2, pos.getZ(), Blocks.STONE.getDefaultState()); if(rand.nextInt(100)+1 < 20){ world.spawnEntity(entity); entity.fallTime = 1; entity.addVelocity(range(rand,10,20), range(rand,10,20), range(rand,10,20)); } } } private int range(Random rand, int min, int max){ return rand.nextInt((max - min) + 1) + min; } Any help is appreciated, Thanks!
July 27, 20196 yr On 7/23/2019 at 12:00 PM, Pikachu923 said: entity.addVelocity(range(rand,10,20), range(rand,10,20), range(rand,10,20)); Your velocity is way to high. That's 10-20 blocks per tick. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
July 27, 20196 yr Author I turned it up a lot because they're not moving at all. And they still don't move, just fall.
July 27, 20196 yr 26 minutes ago, Pikachu923 said: I turned it up a lot because they're not moving at all. And they still don't move, just fall. What did you change it to? VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
July 27, 20196 yr Author So update, The entities are actually spawning items of their blocks that respect their velocity. I'm rather confused.
July 27, 20196 yr 3 hours ago, Pikachu923 said: The 10-20 was the change What? Make it like 1 or a decimal maximum. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
July 30, 20196 yr Author With Decimals, they are still just falling straight down Edited July 30, 20196 yr by Pikachu923
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.