Friends

插件

· 作者 TheeCobra

Friends 是一款社交插件,允许玩家在您的服务器上添加好友、发送消息、邮件和礼物,以及创建队伍。支持跨 BungeeCord 和 Velocity 网络使用。

0 本站下载 0 关注 更新于 1 周前

最新 1.6.4 · 26.3 · Bukkit / BungeeCord

一键开服(送7天)

Friends 是一款社交插件,允许玩家在服务器上添加好友、发送消息、邮件和礼物,并组建小队。支持跨 BungeeCord 和 Velocity 网络运行,并完全兼容 Folia。

功能特性

  • 好友系统 – 添加好友、挚友、收藏好友、分组、备注和昵称。
  • 好友聊天 – /fc 频道可一次性向所有在线好友广播消息。
  • 礼物系统 – 向好友发送物品,具备防滥用保护机制(冷却时间、每日上限、黑名单)。
  • 私聊功能 – 支持回复功能的直接消息以及声音通知。
  • 邮件系统 – 向离线玩家发送留言。可在服务器全局范围内禁用。
  • 小队系统 – 创建小队、邀请好友并管理群组。
  • 小队特效 – 小队成员在近距离时获得药水效果加成。
  • 小队信标 – 动作栏箭头指向最近的小队成员或特定的锁定目标。
  • 最后上线查询 – /friend seen <player> 可查看任意玩家的最后上线时间。
  • 排行榜 – 显示好友数量最多、赠送礼物最多和发送消息最多的排名。
  • 统计数据 – 追踪你的社交数据并查看你的排名。
  • 图形界面 – 简洁的库存菜单,支持资源包的自定义模型数据。
  • 跨服支持 – 单个 JAR 文件即可完整支持 BungeeCord 和 Velocity。
  • Folia 兼容 – 开箱即用,完美适配 Folia 的区域线程调度器。
  • PlaceholderAPI – 提供 25+ 个占位符,可用于记分板等场景。
  • WorldGuard 集成 – 好友组可自动共享你的 WG 区域访问权限。
  • GriefPrevention 集成 – 小队成员会被自动信任为队长领地中的居民。
  • 数据库支持 – 支持 MySQL 和 SQLite,并提供自动迁移功能。
  • 开发者 API – 提供完整的 API 供其他插件集成使用。

命令

好友

  • /friend add <player> – 发送好友请求。
  • /friend remove <player> – 移除好友。
  • /friend accept <player> – 接受请求。
  • /friend deny <player> – 拒绝请求。
  • /friend list – 查看你的好友列表。
  • /friend requests – 查看待处理的请求。
  • /friend best <player> – 切换挚友状态。
  • /friend fav <player> – 切换收藏状态。
  • /friend nick <player> <nickname> – 为好友设置昵称。
  • /friend note <player> <note> – 添加关于好友的备注。
  • /friend group create/delete/set/list – 管理好友分组。
  • /friend tp <player> – 传送至某位好友处。
  • /friend jump <player> – 跳转至某位好友所在的服务器。
  • /friend info <player> – 查看好友详细信息。
  • /friend seen <player> – 查询任意玩家的最后上线时间。
  • /friend block/unblock <player> – 屏蔽或解除屏蔽某玩家。
  • /friend chat [message] – 切换好友聊天模式或发送一次性消息。
  • /friend compass – 切换小队指南针。
  • /friend waypoint <player|clear> – 将指南针锁定在特定成员上。
  • /friend emote <player> <type> – 发送粒子表情动作。
  • /friend status <message> – 设置你的状态消息。
  • /friend menu – 打开好友菜单。

消息与邮件

  • /msg <player> <message> – 发送私聊消息。
  • /reply <message> – 回复上一条消息。
  • /mail read [page] – 阅读你的邮件。
  • /mail send <player> <message> – 发送邮件。
  • /mail delete <id/all> – 删除邮件。
  • /fc [message] – 好友聊天频道。

小队

  • /party create – 创建小队。
  • /party invite <player> – 邀请某玩家加入。
  • /party accept/deny <player> – 处理邀请。
  • /party leave – 离开当前小队。
  • /party kick <player> – 踢出某玩家。
  • /party info – 查看小队信息。
  • /party disband – 解散小队。
  • /party transfer <player> – 转移领导权。
  • /party effects – 查看生效中的特效。
  • /party shop – 购买小队特效升级(需要 Vault 支持)。
  • /party chat [message] – 切换小队聊天模式或发送一次性消息。
  • /pc [message] – 小队聊天快捷指令。

礼物

  • /gift <player> – 将手中持有的物品发送给好友。
  • /gift pending – 查看待处理的礼物。
  • /gift accept <id> – 接受礼物。
  • /gift deny <id> – 拒绝礼物。

菜单与管理

  • /settings – 打开通知设置菜单。
  • /stats – 查看你的社交统计数据。
  • /leaderboard – 查看好友排行榜。
  • /freload – 重新加载插件配置。
  • /fupdate – 检查插件更新。

所有主要命令也接受以 f 为前缀的别名(如 /fmsg、/freply、/fmail、/fparty、/fgift、/fstats、/fsettings、/fleaderboard),适用于存在命名冲突的服务器。插件启动时,如果检测到其他插件占用了任何主要命令名称,会发出警告。

权限

权限 默认值 描述
friends.use true 基本好友命令
friends.mail true 邮件系统访问权限
friends.party true 小队系统访问权限
friends.party.effects true 小队特效访问权限
friends.chat true 好友聊天频道访问权限
friends.teleport true 传送至好友处
friends.jump true 跳转至好友所在服务器
friends.network true 跨服功能
friends.reload op 重载命令
friends.admin op 所有管理命令

PlaceholderAPI

  • %friends_count% – 好友总数
  • %friends_online% – 在线好友
  • %friends_offline% – 离线好友
  • %friends_best_friends% – 挚友数量
  • %friends_favorites% – 收藏好友数量
  • %friends_max% – 好友上限
  • %friends_requests% – 待处理的好友请求
  • %friends_gifts_pending% – 待领取的礼物
  • %friends_gifts_sent% – 已发送的礼物总数
  • %friends_gifts_received% – 已接收的礼物总数
  • %friends_gifts_daily_remaining% – 今日仍可发送的礼物数量
  • %friends_gifts_cooldown% – 礼物冷却剩余时间(秒)
  • %friends_messages_sent% – 已发送消息数
  • %friends_mail_total% – 邮件总数
  • %friends_mail_unread% – 未读邮件
  • %friends_messaging_enabled% – 私聊开关
  • %friends_status% – 你的状态消息
  • %friends_in_party% – 是否在队伍中(true/false)
  • %friends_party_size% – 队伍人数
  • %friends_party_name% – 队伍名称
  • %friends_party_leader% – 队长名称
  • %friends_is_party_leader% – 你是否为队长(true/false)
  • %friends_rank_friends% – 排行榜排名(好友)
  • %friends_rank_gifts% – 排行榜排名(礼物)
  • %friends_rank_messages% – 排行榜排名(消息)

多服务器设置 (BungeeCord / Velocity)

仅分发一个 jar 文件:Friends.jar。它应放置在你网络中的每个后端 Spigot/Paper/Folia 服务器上。代理服务器无需安装。

1. 安装插件

将 Friends.jar 放入网络中每个后端服务器的 /plugins/ 目录。

2. 设置 MySQL

所有服务器共享同一个数据库。在每个服务器上打开 database.yml 并设置:

database:
  type: mysql
  host: your-database-ip
  port: 3306
  name: friends
  username: your-user
  password: your-password
  pool:
    max-connections: 10
    timeout: 30000
    keep-alive: true

确保 friends 数据库已存在。表将在首次启动时自动创建。

3. 配置每个服务器

在 config.yml 中设置唯一的服务器名称并启用网络同步:

server-name: "lobby"

network:
  enabled: true
  channel: "friends:network"

为每个后端服务器使用唯一的 server-name(例如 survival、skyblock、lobby)。

4. 在每个后端启用代理模式

BungeeCord (spigot.yml):

settings:
  bungeecord: true

Velocity (paper-global.yml):

proxies:
  velocity:
    enabled: true
    online-mode: true
    secret: "your-velocity-secret"

5. 重启所有后端服务器。 好友请求、消息、邮件和队伍邀请将在整个网络中同步。

快速检查清单

  • 每个后端服务器上都安装了 Friends.jar
  • 所有服务器共享 MySQL 数据库
  • 每个服务器拥有唯一的 server-name
  • 每个服务器都设置了 network.enabled: true
  • 启用了 BungeeCord 模式或 Velocity 转发

故障排除

  • 好友不同步? 检查所有服务器是否指向同一个 MySQL 数据库。
  • 跨服务器消息无法工作? 必须启用 bungeecord: true(针对 BungeeCord)或 Velocity 转发。
  • 玩家显示错误的服务器? 每个服务器需要在 config.yml 中设置唯一的 server-name。
  • 其他插件占用了 /msg, /party 等命令? 请使用带 f 前缀的别名(/fmsg, /fparty)或 /friends:<cmd>。

配置文件

server-name: "lobby"

settings:
  max-friends: 0
  best-friends:
    max-limit: 5
    enabled: true
  friend-groups:
    enabled: true
    max-groups: 10
  friend-teleport:
    enabled: true
    cooldown: 30
  friend-jump:
    enabled: true
    cooldown: 10
  private-messages:
    friends-only: false
    log-to-console: false
    sounds: true
    cross-server: true
    allow-toggle: true

party:
  max-size: 8
  allow-public-parties: true
  effects:
    enabled: true
    proximity-required: true
    proximity-range: 50
    scaling-strength: true
    scale-percentage: 10
    update-interval: 100
    compass:
      enabled: true
      update-interval: 20
    shop:
      enabled: true
      leader-only: true
      reset-on-disband: true

integrations:
  grief-prevention:
    enabled: true
    shared-building: true
    shared-containers: true
    shared-interactions: true
    shared-entities: true
  luck-perms:
    enabled: true
  worldguard:
    enabled: false
    shared-groups:
      - trusted
      - build

network:
  enabled: true
  channel: "friends:network"

mail:
  enabled: true
  auto-cleanup:
    enabled: true
    days-old: 30

gifts:
  enabled: true
  cooldown: 60
  max-daily: 10
  max-stack-size: 64
  expiry-days: 7
  blacklist:
    - BEDROCK
    - BARRIER
    - COMMAND_BLOCK

emotes:
  enabled: true
  cooldown: 5
  range: 10

debug: false

API 用法

好友管理

FriendsAPI.getFriends(playerUUID);                 // 获取玩家的好友列表
FriendsAPI.getOnlineFriends(playerUUID);           // 仅获取在线好友
FriendsAPI.areFriends(playerUUID, otherUUID);      // 检查好友关系状态
FriendsAPI.addFriend(playerUUID, friendUUID);      // 直接添加好友
FriendsAPI.removeFriend(playerUUID, friendUUID);   // 移除好友

好友请求

FriendsAPI.sendFriendRequest(senderUUID, receiverUUID);
FriendsAPI.getPendingRequests(playerUUID);
FriendsAPI.acceptFriendRequest(receiverUUID, senderUUID);
FriendsAPI.denyFriendRequest(receiverUUID, senderUUID);

消息与邮件

FriendsAPI.sendMessage(senderUUID, receiverUUID, message);
FriendsAPI.getPlayerMail(playerUUID);
FriendsAPI.sendMail(senderUUID, receiverUUID, content);

队伍系统

FriendsAPI.createParty(leaderUUID);
FriendsAPI.disbandParty(partyId);
FriendsAPI.invitePlayerToParty(partyId, playerId);
FriendsAPI.getPlayerParty(playerId);
FriendsAPI.getPartyEffects(partyId);
FriendsAPI.sendPartyMessage(player, message);
FriendsAPI.isPartyChatEnabled(playerUUID);

设置与统计

FriendsAPI.getPlayerSettings(playerUUID);
FriendsAPI.getPlayerStats(playerUUID);
FriendsAPI.getLeaderboard(type, limit);

可选依赖

  • PlaceholderAPI – 用于占位符
  • LuckPerms – 用于权限集成
  • GriefPrevention – 用于领地信任集成
  • WorldGuard – 用于按好友组共享区域
  • Vault – 用于小队效果商店
  • ProtocolLib – 用于增强功能

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源