Development Assistance [Solved] How to make eating particle effect

Discussion in 'Plugin Help/Development/Requests' started by moo3oo3oo3, Dec 6, 2014.

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

    moo3oo3oo3

    How would I go about making the eating particle effect? I tried:
    Code:java
    1. CraftPlayer cPlayer = ((CraftPlayer) player);
    2. PacketPlayOutEntityStatus eat = new PacketPlayOutEntityStatus(cPlayer.getHandle(), (byte) 9);
    3. cPlayer.getHandle().playerConnection.sendPacket(eat);

    but it appears to do nothing...

    P.S. I'm using Spigot API and Spigot jar but it includes bukkit and craft bukkit in it.

    EDIT: You have to right click the food and run
    Code:java
    1. CraftPlayer cPlayer = ((CraftPlayer) player);
    2. PacketPlayOutEntityStatus eat = new PacketPlayOutEntityStatus(cPlayer.getHandle(), (byte) 9);
    3. cPlayer.getHandle().playerConnection.sendPacket(eat);

    Example code:
    Code:java
    1. if (player.getItemInHand() != null && player.getItemInHand().getType() != Material.AIR) {
    2. if (e.getAction() == e.getAction().RIGHT_CLICK_AIR || e.getAction() == e.getAction().RIGHT_CLICK_BLOCK) {
    3. if (player.getItemInHand().getType() == Material.APPLE) {
    4. CraftPlayer cPlayer = ((CraftPlayer) player);
    5. PacketPlayOutEntityStatus eat = new PacketPlayOutEntityStatus(cPlayer.getHandle(), (byte) 9);
    6. cPlayer.getHandle().playerConnection.sendPacket(eat);
    7. }
    8. }
    9. }

     
  2. Offline

    teej107

    Spigot != CraftBukkit. End of story.
     
  3. Offline

    moo3oo3oo3

    Spigot = Bukkit + more. So far I'm using only bukkit stuff
     
  4. Offline

    Skionz

    moo3oo3oo3 I believe that is the iconcrack effect but I am not sure go on the wiki and look at the list. Use particle packets to create them.
     
  5. Offline

    moo3oo3oo3

    bukkit wiki does not have bukkit 1.8 features. Spigot java docs requires login which I don't know where the register button is :p. There is no iconcrack method in playEffect :(
     
  6. Offline

    Skionz

    moo3oo3oo3 Do you mean the particles that fall when you eat an apple or such?
     
  7. Offline

    moo3oo3oo3

    yes
     
  8. Offline

    Skionz

    moo3oo3oo3 Use particle packets. The correct particle effect is near the bottom of the minecraft wiki.
     
  9. Offline

    moo3oo3oo3

  10. Offline

    Skionz

  11. Offline

    moo3oo3oo3

    ok... so now what...
     
  12. Offline

    Skionz

    moo3oo3oo3 I told you. Use particle packets and use the iconcrack effect.
     
  13. Offline

    moo3oo3oo3

    example :)
     
  14. Offline

    Skionz

    moo3oo3oo3
    Code:
    PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particle, x, y, z, xOffset, yOffset, zOffset, amount, data);
     
  15. Offline

    moo3oo3oo3

    any idea how I would set it to eating and the type of food particle it is (ex. apple particle or bread particle)? http://wiki.vg/Protocol#Particle
     
  16. Offline

    Skionz

  17. Offline

    moo3oo3oo3

    what do I put for particle? None of the particles listed are the ones I need? How do I do that data?
     
  18. Offline

    Skionz

  19. Offline

    moo3oo3oo3

    None of the particle ids look like the eating particles and I don't understand how to do the data
     
  20. Offline

    Skionz

  21. Offline

    moo3oo3oo3

    what do I put for particle id then
     
  22. Offline

    Skionz

    moo3oo3oo3 Whatever item id you want. I can't read minds.
     
  23. Offline

    moo3oo3oo3

    Which one is the eating particle?
     
  24. Offline

    Skionz

    moo3oo3oo3
     
Thread Status:
Not open for further replies.

Share This Page