You are running code only on server side (!world.isRemote) and particles are client only feature. make your code look like this http://pastebin.com/LzaEtwYg
You are running code only on server side (!world.isRemote) and particles are client only feature. make your code look like this http://pastebin.com/LzaEtwYg
Actually, server side is the place to put it if you want all players to see them. The entities will automatically be sent to all players from the server.
Actually, server side is the place to put it if you want all players to see them. The entities will automatically be sent to all players from the server.
No. Particles are not entities. (they used to be but even then they didn't act like one. The are not synced as a normal entity, they are not saved) If you look at world spawnParticle function you will see that it passes the data to listeners and upon more reverse engineering you will see that a listener for spawning particles is added only on client side so spawnParticle is effectively an empty function on server side.
Rollback Post to RevisionRollBack
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
You are running code only on server side (!world.isRemote) and particles are client only feature. make your code look like this http://pastebin.com/LzaEtwYg
Actually, server side is the place to put it if you want all players to see them. The entities will automatically be sent to all players from the server.
So how do I go about this?
I want all the players to see these particles, but for some reason they are not appearing to me (at least in singleplayer)
No. Particles are not entities. (they used to be but even then they didn't act like one. The are not synced as a normal entity, they are not saved) If you look at world spawnParticle function you will see that it passes the data to listeners and upon more reverse engineering you will see that a listener for spawning particles is added only on client side so spawnParticle is effectively an empty function on server side.
Yes they are entities. Especially when you consider this is 1.7.10. I might be wrong, but I'm 100% sure they are entities and this is how they work. I should know since I've made custom particles for 1.7.10 and above. And no, they don't work like normal entities becuase other entities like mobs extend EntityLivingBase which adds all the functionality you're used to seeing. Particles just extend EntityFX which in turn ends up just extending Entity, which doesn't have your usual mob traits.
As I said, sorry if I'm wrong. I can accept being wrong if I am
The best way to go about this would be to make a packet called spawn particles and then send from server to all players in a radius if 32 blocks (or how many blocks is the limit for particle spawning)
But if the code is running on both sides than you can get away with code that I linked. (if you don't know on what side it's running then just print isRemote)
The best way to go about this would be to make a packet called spawn particles and then send from server to all players in a radius if 32 blocks (or how many blocks is the limit for particle spawning)
But if the code is running on both sides than you can get away with code that I linked. (if you don't know on what side it's running then just print isRemote)
I'm pretty sure the code is running on the server side because I added !(world.isRemote) check. Isn't there an easier way of spawning particles other than using packets?
Yes they are entities. Especially when you consider this is 1.7.10. I might be wrong, but I'm 100% sure they are entities and this is how they work. I should know since I've made custom particles for 1.7.10 and above. And no, they don't work like normal entities becuase other entities like mobs extend EntityLivingBase which adds all the functionality you're used to seeing. Particles just extend EntityFX which in turn ends up just extending Entity, which doesn't have your usual mob traits.
As I said, sorry if I'm wrong. I can accept being wrong if I am
Yeah you are right EntityLivingBase adds extra functionality but even if a particle is extended to EntityLivingBase it would not be handled correctly because it's not running in same environment (or more correctly engine) as all other entities.
If particles were ever sent as a full entity to clients than I would actually go out of my way to contact mojang dev team and ask them what is wrong with them...
Rollback Post to RevisionRollBack
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
I can't use the world parameter, because otherwise the particles will spawn hell knows where. I need the particles to spawn in around the player.
You give the particles a location... They'll spawn exactly where you tell them to. Use the world parameter, not the one from the player. What you're saying is nonsense, it's false.
You give the particles a location... They'll spawn exactly where you tell them to. Use the world parameter, not the one from the player. What you're saying is nonsense, it's false.
Okay, I've reviewed some stuff I've made myself and I have to admit it looks like I was wrong. So I'm sorry about the confusion.
What I have is that I'm spawning particles using the following method (don't use it exactly the same, it's recommended to save Minecraft to somewhere rather than get it EVERY time):
Okay, I've reviewed some stuff I've made myself and I have to admit it looks like I was wrong. So I'm sorry about the confusion.
What I have is that I'm spawning particles using the following method (don't use it exactly the same, it's recommended to save Minecraft to somewhere rather than get it EVERY time):
I don't think you can get the effect renderer any other way.
Thing is, though is that if I place the particle spawn code right outside of if(!world.isRemote) then everything works. Sorry, forgot to mention earlier.
I will try what you suggested though.
World#spawnParticle does nothing on the server and spawns a particle on the client. Use WorldServer#func_147487_a on the server to send a packet to all clients within 16 blocks that spawns the specified particles.
1.7.10 is extremely outdated and no longer supported by Forge, you should update to 1.10.2.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
World#spawnParticle does nothing on the server and spawns a particle on the client. Use WorldServer#func_147487_a on the server to send a packet to all clients within 16 blocks that spawns the specified particles.
1.7.10 is extremely outdated and no longer supported by Forge, you should update to 1.10.2.
thanks for your reply. I'll try it.
And I said before I will be upgrading to more recent versions too.
World#spawnParticle does nothing on the server and spawns a particle on the client. Use WorldServer#func_147487_a on the server to send a packet to all clients within 16 blocks that spawns the specified particles.
1.7.10 is extremely outdated and no longer supported by Forge, you should update to 1.10.2.
Sorry for the double post, but could you explain the parameters for WorldServer.func_147487_a to me please. I can't find anything about the params on the web too. Thanks.
Sorry for the double post, but could you explain the parameters for WorldServer.func_147487_a to me please. I can't find anything about the params on the web too. Thanks.
Look in the WorldServer class what arguments the method takes.
They simply don't want to spawn.
http://pastebin.com/9zRBReBF
You are running code only on server side (!world.isRemote) and particles are client only feature. make your code look like this http://pastebin.com/LzaEtwYg
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
Actually, server side is the place to put it if you want all players to see them. The entities will automatically be sent to all players from the server.
No. Particles are not entities. (they used to be but even then they didn't act like one. The are not synced as a normal entity, they are not saved) If you look at world spawnParticle function you will see that it passes the data to listeners and upon more reverse engineering you will see that a listener for spawning particles is added only on client side so spawnParticle is effectively an empty function on server side.
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
So how do I go about this?
I want all the players to see these particles, but for some reason they are not appearing to me (at least in singleplayer)
Yes they are entities. Especially when you consider this is 1.7.10. I might be wrong, but I'm 100% sure they are entities and this is how they work. I should know since I've made custom particles for 1.7.10 and above. And no, they don't work like normal entities becuase other entities like mobs extend EntityLivingBase which adds all the functionality you're used to seeing. Particles just extend EntityFX which in turn ends up just extending Entity, which doesn't have your usual mob traits.
As I said, sorry if I'm wrong. I can accept being wrong if I am
The best way to go about this would be to make a packet called spawn particles and then send from server to all players in a radius if 32 blocks (or how many blocks is the limit for particle spawning)
But if the code is running on both sides than you can get away with code that I linked. (if you don't know on what side it's running then just print isRemote)
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
Instead of using player.worldObj, just use the world that's passed in as a parameter. I don't know why you weren't already.
I'm pretty sure the code is running on the server side because I added !(world.isRemote) check. Isn't there an easier way of spawning particles other than using packets?
I can't use the world parameter, because otherwise the particles will spawn hell knows where. I need the particles to spawn in around the player.
Yeah you are right EntityLivingBase adds extra functionality but even if a particle is extended to EntityLivingBase it would not be handled correctly because it's not running in same environment (or more correctly engine) as all other entities.
If particles were ever sent as a full entity to clients than I would actually go out of my way to contact mojang dev team and ask them what is wrong with them...
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
You give the particles a location... They'll spawn exactly where you tell them to. Use the world parameter, not the one from the player. What you're saying is nonsense, it's false.
Ok I changed to . And nothing happened.
Okay, I've reviewed some stuff I've made myself and I have to admit it looks like I was wrong. So I'm sorry about the confusion.
What I have is that I'm spawning particles using the following method (don't use it exactly the same, it's recommended to save Minecraft to somewhere rather than get it EVERY time):
Minecraft.getMinecraft().effectRenderer.addEffect()
It takes a class extending EntityFX I believe.
If you want to see how I've used it (only with old, bad code ;D this was back when I was testing particles) then have a look here:
https://github.com/thebrightspark/ParticleWand/blob/master/src/main/java/com/brightspark/particlewand/item/ItemParticleWand.java
I have been told to absolutely never use Minecraft.getMinecraft() unless it's unavoidable :/
I don't think you can get the effect renderer any other way.
Thing is, though is that if I place the particle spawn code right outside of if(!world.isRemote) then everything works. Sorry, forgot to mention earlier.
I will try what you suggested though.
World#spawnParticle does nothing on the server and spawns a particle on the client. Use WorldServer#func_147487_a on the server to send a packet to all clients within 16 blocks that spawns the specified particles.
1.7.10 is extremely outdated and no longer supported by Forge, you should update to 1.10.2.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
thanks for your reply. I'll try it.
And I said before I will be upgrading to more recent versions too.
Sorry for the double post, but could you explain the parameters for WorldServer.func_147487_a to me please. I can't find anything about the params on the web too. Thanks.
Look in the WorldServer class what arguments the method takes.