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 have a block whose model is partially transparent. I'm using the randomDisplayTick method to display some particles inside it, specifically the Totem of Undying particles. Everything looks great when the block is on top of another block, but if there's no block below it, the particles will fall down through my block and keep raining down until they hit something. Which looks terrible.

How can I force the particles I'm spawning to despawn/die if they go outside my block's range? I hope I don't need to make an entirely new particle just for that (and if I do, can someone point me to a tutorial for that? The only ones I can find are for 1.7.10 or earlier, and I know the particle system has changed since then).

 

I don't think it's too relevant, but here's the code I'm using to spawn the particles:

	@Override
	@SideOnly(Side.CLIENT)
	public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) {
		for (int i = 0; i < 3; ++i) {
			int j = rand.nextInt(2) * 2 - 1;
			int k = rand.nextInt(2) * 2 - 1;
			double x = (double) pos.getX() + 0.5D + 0.25D * (double) j;
			double y = (double) ((float) pos.getY() + rand.nextFloat() * 0.625);
			double z = (double) pos.getZ() + 0.5D + 0.25D * (double) k;
			worldIn.spawnParticle(EnumParticleTypes.TOTEM, x, y, z, 0, 0, 0);
		}
	}

 

(It's basically copypasta from the Ender Chest code for this, with some values changed.)

 

*EDIT* Actually, an even better solution would be if I could make the particles act as though they've hit a block when they reach the bottom of the inside of my block. That would look superb; I get the feeling that would be much harder to do, though?

Edited by IceMetalPunk

Whatever Minecraft needs, it is most likely not yet another tool tier.

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.