Advertisement
Guest User

Untitled

a guest
Jul 27th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. @EventHandler
  2. public void onPlayerInteract(PlayerInteractEvent e) {
  3. if (e.getClickedBlock() == null) {
  4. return;
  5. }
  6. Location loc = player.getLocation();
  7. int radius = 2;
  8. for(double y = 0; y <= 50; y+=0.05) {
  9. double x = radius * Math.cos(y);
  10. double z = radius * Math.sin(y);
  11. PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(
  12. EnumParticle.HEART, // tipo da particle
  13. true, // true
  14. e.getClickedBlock().getX(), // cordenada x
  15. e.getClickedBlock().getY(), // cordenada y
  16. e.getClickedBlock().getZ(), // cordenada z
  17. 0, // x offset
  18. 0, // y offset
  19. 0, // z offset
  20. 10, // velocidade
  21. 1000, // número de partículas.
  22. null
  23. );
  24.  
  25. ((CraftPlayer) e.getPlayer()).getHandle().playerConnection.sendPacket(packet);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement