Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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!

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.

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.

  • Author

So update, The entities are actually spawning items of their blocks that respect their velocity. I'm rather confused.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.