Particle

Discussion in 'Plugin Development' started by Zettos, Nov 24, 2020.

  1. Offline

    Zettos

    Hey guys, i don´t know how to create Particle boots. In the 1.8 i had done it with EnumParticle but that doesn´t work anymore in the 1.16.4. I saw a new something with player.spawnParticle, but i tried a little but and it doens´t work also. I have to say, that i didn´t delete my old Particle Api, but normally that shouldn´t overlap in the PlayermoveEvent. Please don´t wonder what ist that Cache.boots meaning, actually its only a Arraylist which controlls if a player is wearing the boots.

    PS: Sorry for my bad English.

    Code:
    Code:
    public class MoveEvent implements Listener{
    
        @EventHandler
        public void onMove(PlayerMoveEvent e) {
           
           
            try {
                Player p = e.getPlayer();
               
                if(Cache.boots.contains(p.getUniqueId())) {
                   
                    if(p.getInventory().getBoots().getItemMeta().getDisplayName().equals("§8Cloud Boots")) {
                       
                           
                            p.spawnParticle(Particle.CLOUD, p.getLocation(), 0, 0, 0, 1, 1, 0);
                    }
    /\
    |
    Only a short cutout, but the principle is the same as the other boots.


    Exeption:
     

    Attached Files:

  2. Offline

    timtower Administrator Administrator Moderator

    @Zettos How do you get compilation errors on the server?
     
  3. Offline

    MrDaniel

    @Zettos
    You are using an outdated library. The one you are using is pre 1.9. The replacement for EnumParticle in 1.9+ is Particles. The way you can summon those particles is by using packets.

    Packet:
    Code:
    PacketPlayOutWorldParticles particle = new PacketPlayOutWorldParticles(Particles.SMOKE, true, loc.getX(), loc.getY(), loc.getZ(), 0, 0, 0, 0, 1);
    
    If you want to find out what all of those arguments mean I recommend googling for some threads
     

Share This Page