Development Assistance Help with PacketPlayOutWorldParticles

Discussion in 'Plugin Help/Development/Requests' started by MinecraftMart, Dec 27, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    MinecraftMart

    So this code used to work to make a new Effect that you can put on an arrow. It doesnt work anymore and i dont know what the new code for 1.8 is:

    Code:
     PacketPlayOutWorldParticles arrowParticles = new PacketPlayOutWorldParticles(
                                            "witchMagic", (float) l.getX(), (float) l.getY(), (float) l.getZ(), 0,
                                            0, 0,(float) 0, 100);
    Can anybody help me?
     
  2. Offline

    Xtreme727

    It may work, try setting the last float to 1
    And are you actually playing the packet?
     
  3. Offline

    MinecraftMart

    @Xtreme727

    this is the error: The constructor PacketPlayOutWorldParticles(String, float, float, float, int, int, int, float, int) is undefined

    And setting it to 1 wont work. And what you mean with playing it? I am just defining it for now i think

    Whole code:
    Code:
    BukkitTask task = new BukkitRunnable() {
                                @Override
                                public void run() {
                                    Location l = ar.getLocation();
                                    PacketPlayOutWorldParticles arrowParticles = new PacketPlayOutWorldParticles(
                                            "witchMagic", (float) l.getX(), (float) l.getY(), (float) l.getZ(), 0,
                                            0, 0,(float) 0, 100);
                                    
                                    for(Player player : Bukkit.getOnlinePlayers()) {
                                         ((CraftPlayer) player).getHandle().playerConnection.sendPacket(arrowParticles);
                                    }
                                  
                                }
                            }.runTaskTimer(main, 0, 1);
                            arrowTasks.put(ar.getEntityId(), task.getTaskId());
     
  4. Offline

    Xtreme727

    That's because the constructer is String float float float float float float float int
     
  5. Offline

    MinecraftMart

  6. Offline

    Xtreme727

    Make sure you have the net.minecraft.server import imported
     
  7. Offline

    MinecraftMart

    import net.minecraft.server.v1_8_R1.PacketPlayOutWorldParticles;

    Already done.
     
  8. Offline

    Skionz

    @MinecraftMart The constructor changed in 1.8. It contains an enum or something now
    [​IMG]
    [​IMG]
    New constructor ^
    It is split into two images because it wouldn't fit on the screen.
     
  9. Offline

    MinecraftMart

    @Skionz
    So eehm, how would it look then with my code?
     
  10. Offline

    Skionz

  11. Offline

    MinecraftMart

    @Skionz

    Yeah but like, what do i put at the enum and boolean, its a bit different
     
  12. Offline

    Skionz

    @MinecraftMart It is pretty self explanatory. When the constructor asks for a boolean, you give it a boolean.
     
  13. Offline

    MinecraftMart

    @Skionz
    But i still dont get what that enum is and it has 2 ints now. This is getting confusing...
     
  14. Online

    timtower Administrator Administrator Moderator

    Moved to Bukkit alternatives.
     
Thread Status:
Not open for further replies.

Share This Page