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 attempted to spawn particles into the world using a tutorial, however it wont generate the particles in the world on the entity that has my custom potion effect.

 

here is my bit of code in the EventHandler for LivingUpdateEvent:

 

 

Entity entity = event.entityLiving;
		if(!event.entityLiving.worldObj.isRemote && event.entityLiving.worldObj.rand.nextInt(20) == 0){
			Random rand = new Random();
			double motionX = rand.nextGaussian() * 0.02D;
			double motionY = rand.nextGaussian() * 0.02D;
			double motionZ = rand.nextGaussian() * 0.02D;
			entity.worldObj.spawnParticle("", (double)(entity.posX + rand.nextFloat() * entity.width * 2.0F - entity.width), (double)(entity.posY + 0.5D + rand.nextFloat() * entity.height), (double)(entity.posY + rand.nextFloat() * entity.width * 2.0F - entity.width), motionX, motionY, motionZ);
			System.out.println("Particles on " + entity);

		}

 

 

any help will be welcomed

Particles are client side.

 

You need to call code on client or send packet from server to client saying to do it.

1.7.10 is no longer supported by forge, you are on your own.

Than thats a pretty bad tutorial in my opinion. The only particle that is spawned server side is the xp-orb. But thats because it should be able to be picked up by players.

 

As Ernio said, spawn it ClientSide by either using packets, or using a ClientSide event/method. Maybe try to find where vanilla potion particles are spawned from. Cause than you would be able to implement yours as well!

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

  • Author

My understanding of particles are that they are entities and just like entities and blocks the textures are rendered client side but spawned server side. If anyone has a good tutorial for this or the location if the vanilla particle spawning that would be great

  • Author

btw:

 

You should get off the internet and grab a creeper plushie because you're 7 years old.

I have a creeper plushie, but I am 22....my mom gave it to me for Christmas :P

World#spawnParticle

calls

IWorldAccess#spawnParticle

for every registered

IWorldAccess

.

RenderGlobal

(the client-side

IWorldAccess

) spawns a particle in its implementation of this method,

WorldManager

(the server-side

IWorldAccess

) does nothing.

 

WorldServer#func_147487_a(String particleName, double x, double y, double z, int numParticles, double displacementX, double displacementY, double displacementZ, double velocity)

sends a packet from the server to the clients of the players within 256 blocks of the specified position telling them to spawn particles there.

 

Look at

RenderGlobal#doSpawnParticle

to see which particle names you can use.

 

Use your IDE to find usages of these methods to see how they're used.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.