Perhaps simplify these, could just do p.getInventory().setItem(0, new ItemStack(Material.COMPASS));