1.13.2 Change particles in CustomSlimeEntity

Discussion in 'Spigot Plugin Development' started by kutas, Mar 23, 2020.

  1. Hello, I want to change Slime particles, which are used, when slime lands. I looked into NMS EntitySlime, and I found, that method l() returns that particles, however, when I try to override that method, it doesn't work - there are still Slime particles. Here's piece of my code:
    Code (Java):
    @Override
        protected ParticleParam l() {
            System.out.println(l.particleSkins.get(owner).getParticle().name());
            return CraftParticle.toNMS(l.particleSkins.get(owner).getParticle());
        }
    I've inserted System.out to check, if particle is being loaded from HashMap properly
    Code (Text):
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    [19:35:53] [Server thread/INFO]: NAUTILUS
    It seems, that particle loads properly. Where is mistake then? Is there something else I should do?
     
    • Optimistic Optimistic x 1
  2. I think it's not possible to change particles :/
     
  3. NMS class suggests, that particles are spawned by the server. If it's serverside, there must be some way to do it.
     
    • Optimistic Optimistic x 1
  4. I think these particles are handled client side. I do not think each single entity has their own particle, but I might be wrong.
     
  5. I think it must be somehow handled by server if there is function in NMS class. I looked deeper into that class and partciles function are called in tick() method. I tried overriding that method too, but then slimes freezed in air - I Had to call super.tick() but it was pointless. Any other ideas? Anyone?
     
  6. Try to intercept the particle packet, also afaik server code has a lot of client code and probably the particle per entity is a little of that
     
  7. I've copied the whole tick() methods from all super classes, and remove the particle spawn line - it still apeared, so it looks your were right. I am going to stop next to floor, and spawn particles by my own
     
    • Like Like x 1