Advertisement
BillyGalbreath

Paper PR

Apr 13th, 2019
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. public class TestPlugin extends JavaPlugin {
  2.     @Override
  3.     public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
  4.         ((Player) sender).getNearbyEntities(16, 16, 16).stream()
  5.                 .filter(entity -> entity instanceof LivingEntity)
  6.                 .filter(entity -> !(entity instanceof Player))
  7.                 .forEach(entity -> {
  8.                     LivingEntity livingEntity = (LivingEntity) entity;
  9.                     livingEntity.getNearbyEntities(5, 5, 5).stream()
  10.                             .filter(item -> item instanceof Item)
  11.                             .forEach(item ->
  12.                                     livingEntity.playPickupItemAnimation((Item) item));
  13.                 });
  14.         return true;
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement