Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onMove(PlayerMoveEvent e) {
- Player p = e.getPlayer();
- for (Entity enty : p.getNearbyEntities(50.0, 50.0, 50.0)) {
- if (enty instanceof Pig) {
- Location loc = p.getTargetBlock((HashSet<Material>) null, 99).getLocation();
- ((CraftPig)enty).getHandle().getNavigation().a(loc.getX(), loc.getY(), loc.getZ(), 1.5);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement