Hugs 拥抱

作者:ShadowMasterG23 发布时间:2017年4月19日 原生版本:未知 测试支持:1.11,1.12,1.13

传播这份爱。

点此下载

插件详细介绍

🤗 Hugs插件是一个简单的Minecraft插件,最初是为朋友制作的,现已发展成为一个爱好。它允许玩家通过指令、粒子效果和声音向其他玩家表达友善的拥抱。插件具有可定制的消息、冷却时间、权限控制和详细的日志记录功能。

🤗 Hugs插件

📌 最新版本

目前开发构建中支持 Minecraft 1.14 - 1.20.4 版本。

开发构建版本可以在我的 Discord 中找到:https://discord.gg/kJyZwBj

✨ 主要功能

  • 可定制的消息:包括发送者和接收者收到的消息,以及接收者收到的标题和副标题。
  • 服务器广播消息:可配置是否启用。
  • 错误消息:例如找不到玩家、权限不足、参数无效、参数过多、冷却时间等。
  • 命令:点击即可使用。
  • 粒子效果和声音:可定制的粒子效果和声音。
  • 恢复生命值和饥饿值:可配置选项,用于恢复玩家的生命值和饥饿值。
  • 详细输出:控制台和文件日志记录。
  • 可配置的冷却时间。
  • 内置的重载命令:无需重启服务器即可更新配置。
  • 控制台名称:可更改控制台的名称。
  • 开发者奖励:拥抱开发者时会收到特殊消息。
  • 命令帮助页面:显示您是否有权限使用命令。
  • 手动更新程序。

⌨️ 命令列表

  • /hug <player> - 给指定玩家一个拥抱
  • /hugs - 插件基础命令,显示插件信息
  • /hugs help - 显示帮助页面和所有可用命令
  • /hugs total - 显示拥抱的总数
  • /hugs info <player> - 显示玩家的拥抱统计信息
  • /hugs reload - 重载配置文件

🔑 权限列表

  • hugs.hug - 允许使用 /hug <player>
  • hugs.hug.everyone - 允许使用 /hug *
  • hugs.bypass.normal - 允许跳过普通拥抱的冷却时间
  • hugs.bypass.mass - 允许跳过群体拥抱的冷却时间
  • hugs.use - 允许使用 /hugs/hugs help
  • hugs.total - 允许使用 /hugs total
  • hugs.info - 允许使用 /hugs info <player>
  • hugs.update - 允许非OP玩家接收插件更新消息
  • hugs.reload - 允许使用 /hugs reload

默认情况下,OP 拥有所有这些权限。

⚙️ 权限管理插件

此插件要求您授予玩家使用命令的权限,因为默认情况下,除了 OP 之外,任何人都无法访问这些命令。以下是一些您可以使用的权限管理插件:

  • LuckPerms
  • zPermissions
  • PermissionsEx
  • bPermissions
  • GroupManager

您可以使用任何您喜欢的权限插件,但请确保您拥有一个。

📌 PlaceholderAPI 支持

该插件支持 PlaceholderAPI 占位符!要利用这些占位符,只需使用任何支持 PlaceholderAPI 的插件,并使用下面列出的占位符之一。

可用占位符:

  • %hugs_total%: 获取拥抱的总数。
  • %hugs_player_total_given%: 获取玩家给予的拥抱总数。
  • %hugs_player_total_received%: 获取玩家收到的拥抱总数。
  • %hugs_player_total_mass_given%: 获取玩家给予的群体拥抱总数。
  • %hugs_player_total_mass_received%: 获取玩家收到的群体拥抱总数。

您可以在这里下载 PlaceholderAPI:

注意:Hugs 插件不支持 PlaceholderAPI 库。这意味着您不能在此插件的配置中使用其他插件的占位符!

⬇️ 安装方法

您可以使用两种方法来更新插件。任一种方法都有效,您可以自行决定使用哪种方法。

方法 1:

  1. 停止服务器,并将 Hugs (v2.0).jar 文件放入服务器的 /plugins/ 目录中。
  2. 启动服务器(插件将生成所有必要的文件)。
  3. 编辑 config.yml 文件,使用所需的设置。(记得保存!)
  4. 编辑 messages.yml 文件,使用您的消息。(记得保存!)
  5. 在服务器上输入 /hugs reload
  6. 完成!

方法 2:

  1. 如果您有 Plugman,请将 Hugs (v2.0).jar 文件放入服务器的 /plugins/ 目录中。
  2. 在游戏中输入 /plugman load Hugs
  3. 编辑 config.yml 文件,使用所需的设置。(记得保存!)
  4. 编辑 messages.yml 文件,使用您的消息。(记得保存!)
  5. 在服务器上输入 /hugs reload
  6. 享受!

如果您没有 Plugman 或不知道 Plugman 是什么,您可以在这里下载/查找有关它的更多信息:

注意:如果这不是您第一次下载此插件,请确保删除 /plugins/ 目录中的 Hugs 文件夹。所有更新都更改了 config.yml 文件,如果您不删除旧的配置,则插件将无法正常工作。

📄 文件说明

此插件有三个文件:config.ymlmessages.ymldata.ymlconfig.yml 易于使用,只需将默认设置更改为您想要的任何设置并保存文件。 messages.yml 也是如此。然后在服务器上键入 /hugs reload,就完成了。至于 data.yml,我建议您不要动它。即使您可以尝试更改它,它也只是用于计算拥抱。

注意:使用大多数插件时,如果您使用内置命令重新加载插件,然后返回到 config.yml 文件,则会弹出一个窗口,提示配置已重新加载,您是否希望将其保存在编辑器中。但是,Hugs 插件并非如此。 Hugs 插件本质上处于只读模式,这意味着没有任何内容被写入 config.ymlmessages.yml。因此,如果您更改文件并使用重载命令,只需知道它有效,并且您可以通过给予拥抱来验证。但是,如果您打开了 data.yml 文件,并且有人拥抱了其他人,然后您返回到 data.yml,则会出现弹出窗口,因为信息正在写入 data.yml 文件。

⚙️ 配置文件 (config.yml)


#
# Hugs - Developed by ShadowMasterGaming
#

# Enable update checking?
check_for_updates: true

# What language is native to your server?
language_file: en_US

# The method of storing plugin data.
# Valid settings include: yaml, yml, & MySQL.
# If an invalid storage setting is detected, the plugin will default to YAML files.
storage: yaml

#
# Normal Plugin Settings
#
settings:
  # Force the usage of exact names when using the /hug command. Only applies to the /hug command.
  force_exact_names: true

  # Allow players to give themselves hugs?
  allow_self_hugging: true

  # Allow self hugs to count towards player data?
  allow_self_hug_playerdata: true

  # Allow players to give hugs by shift right clicking a player?
  allow_shift_hugging: true

  # Upon receiving a hug, restore the receiver's health back to 100%?
  restore_player_health: false

  # Upon receiving a hug, restore the receiver's hunger back to 100%?
  restore_player_hunger: false

  # Hug Message Settings
  hug_messages:
    enabled: true

  # Broadcast Settings
  broadcasts:
    normal_hugs: true
    mass_hugs: true
    self_hugs: true

  # Title Settings
  titles:
    enabled: true
    # The interval settings for how titles appear. (In Seconds)
    fade-in: 1
    stay: 5
    fade-out: 1

  # The particle effect that will spawn around the receiver when they receive a hug.
  # If the particle effect is invalid, you will receive a warning in the console. It won't break the plugin.
  # This link will take you to a page with all of the available particle effects you can use: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Particle.html
  particles:
    enabled: true
    effect: HEART
    # Allow for other players to see the particles?
    # The particles will be spawned at the receiver's location and anyone nearby will be able to see them.
    global: false

  # The sound effect that will play at the receiver's location when they receive a hug.
  # If the sound effect is invalid, you will receive a warning in the console. It won't break the plugin.
  # This link will take you to a page with all of the available sound effects you can use: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html
  sounds:
    enabled: true
    sound: ENTITY_CAT_PURR
    volume: 1
    pitch: 1
    # Allow for other players to hear the sounds?
    # The sound will be played at the receiver's location and anyone nearby will be able to hear it.
    global: false

  # Cooldown Settings
  cooldowns:
    # The cooldown between hugs. (In Seconds)
    normal_hugs: 5
    # The cooldown between mass hugs. (In Seconds)
    mass_hugs: 30
    # If set to true, the time remaining will be displayed as a decimal. (E.G. 14.3 seconds remaining.)
    use_exact_time: false

  # Settings for commands that would benefit from confirmations. (E.G. /hugs admin purge )
  # If the GUI is not enabled, it will default to a text based confirmation.
  confirmations:
    enabled: true
    use_gui: true

  # Leaderboard settings.
  # If the GUI is not enabled, it will default to a text based leaderboard.
  leaderboard:
    use_gui: true

  # Players will receive one cookie when they hug the developer. :3
  developer_reward: false

#
# The different verbose settings that you can change. This is to help keep track of things.
#
verbose:
  # Settings for file logging. If enabled, all messages that would be sent to the console will be logged to a file.
  file_logging: true

  # Settings for console logging. If enabled, it will log stuff like who reloaded the config and who gave hugs.
  console:
    enabled: false
    console_name: "Console"

  # Settings for startup verbose.
  # If both settings are set to true, the plugin will default to show_all_settings.
  startup:
    enabled: false
    show_informative_settings: false
    show_all_settings: false
    show_hooks: true

  # Settings for reload verbose.
  # If both settings are set to true, the plugin will default to show_all_settings.
  reloads:
    enabled: false
    show_informative_settings: false
    show_all_settings: false

#
# The Experimental Settings
#
experimental_settings:
  # Allow the receiver to have temporary invincibility after they are hugged?
  temporary_invincibility:
    enabled: false
    effects:
      fall_damage: true
      pvp: true
    # The duration of invincibility. (In seconds)
    duration: 10

  # Deny players from harming each other?
  passive_mode:
    enabled: false
    message:
      enabled: true
      # The delay between the passive mode message being sent to the player. (In seconds)
      delay: 10

💬 消息文件 (lang_en.yml)


#
# Hugs - Developed by ShadowMasterGaming
#

#
# Available Placeholders:
#  Global: Can be used anywhere in this file. Even in places it normally shouldn't be.
#   %prefix%
#
#  Case Specific: Can only be used in certain variables. Supported placeholders are listed above the variable.
#   %sender%, %target%, %permission%, {X}, %normal_hugs_total%, %mass_hugs_total%,
#   %total_hugs_given%, %total_hugs_received%, %total_mass_hugs_given%, %total_mass_hugs_received%,
#   %header%, %footer%
#

plugin_placeholders:
  # The prefix for the plugin. Can be used globally using %prefix%.
  prefix: '&3&lHugs &8&l>>'

  # The header that is put above a message. Can be used in message lists using %header%.
  header: '&8&l<&8&m&l-------&8&l<&3+&8&l>&m&l--------&8&l<<&b&l Hugs &8&l>>&m&l--------&8&l<&3+&8&l>&m&l-------&8&l>'

  # The footer that is put below a message. Can be used in message lists using %footer%.
  footer: '&8&l<&8&m&l--------&8&l<&3+&8&l>&m&l---------&8&l<<&3+&8&l>>&m&l---------&8&l<&3+&8&l>&m&l--------&8&l>'

messages:
  # The messages that are sent upon sending and receiving hugs.
  hug_messages:
    # The message that the sender receives upon giving a hug.
    # Supported Placeholders: %target%
    message_to_sender: '%prefix% &3You gave &7&l%target% &3a hug!'
    # The message that the target receives upon receiving a hug.
    # Supported Placeholders: %sender%
    message_to_receiver: '%prefix% &3You were hugged by &7&l%sender%&3!'
    # The message that the sender receives if they hug themself.
    # Supported Placeholders: N/A
    self_hug: "%prefix% &7You gave yourself a warm hug."

  # The title and subtitle that the target receives upon receiving a hug.
  # Only supports the %sender% placeholder in the title variable.
  title_message:
    title: '&3%sender%'
    subtitle: '&7Hugged you!'

  # The messages that are broadcasted to the server.
  broadcasts:
    # The broadcast that is shown when a player hugs another player.
    # Supported Placeholders: %sender% & %target%
    normal_hugs:
      message: '%prefix% &7&l%sender% &3hugged &7&l%target%'
    # The broadcast that is shown when a player hugs everyone.
    # Supported Placeholders: %sender%
    mass_hugs:
      message: '%prefix% &7&l%sender% &3gave everyone a hug!'
    # The broadcast that is shown when a player hugs themself.
    # Supported Placeholders: %sender%
    self_hugs:
      message: "%prefix% &7&l%sender% &3hugged themself."

  # The messages for data purges.
  confirmations:
    # Supported Placeholders: N/A
    confirmation_all_message: "%prefix% &7Are you sure? Doing this will result in all player data being deleted! \nType \"yes\" to continue or type \"no\" to cancel."
    # Supported Placeholders: %player%
    confirmation_message: "%prefix% &7Are you sure? Doing this will result in %player%'s data being deleted! \nType \"yes\" to continue or type \"no\" to cancel."
    # Supported Placeholders: N/A
    canceled_purge: "%prefix% &7Canceled data purge."
    # Supported Placeholders: N/A
    data_purged: "%prefix% &7Everyone's data was &cdeleted&7!"

  # The message that the sender receives when they use the reload command.
  # Supported Placeholders: N/A
  reload_message:
    - "%header%"
    - "%prefix% &7Configuration reloaded &asuccessfully&7."
    - "%footer%"

#
# Data Messages
#
data:
  # The messages that the sender receives when they use the /hugs total command.
  # Supported Placeholders: %normal_hugs_total% & %mass_hugs_total%
  total_hugs_message:
  - "%header%"
  - "%prefix% &3%normal_hugs_total% &7hugs have been given!"
  - "%prefix% &3%mass_hugs_total% &7mass hugs have been given!"
  - "%footer%"

  # The messages that appear when a player types /hugs info .
  # Supported Placeholders: %total_hugs_given%, %total_hugs_received%, %total_mass_hugs_given%, & %total_mass_hugs_received%
  player_profile:
  - "&3&lHugs Given&7: &b%total_hugs_given%"
  - "&3&lHugs Received&7: &b%total_hugs_received%"
  - "&3&lMass Hugs Given&7: &b%total_mass_hugs_given%"
  - "&3&lMass Hugs Received&7: &b%total_mass_hugs_received%"

  # The message that the sender receives when they purge a player's data.
  # Supported Placeholders: %target%
  player_data_purged: "%prefix% &3%target%'s &7data was &cdeleted&7!"

#
# Error Messages
#
errors:
  # The message that the sender receives if the name is spelled incorrectly or if the target is offline.
  # Supported Placeholders: %target%
  player_not_found: "%prefix% &6&l%target% &7doesn't want to be hugged!"

  # The message that the sender receives if they are the only one online and try to send a mass hug.
  # Supported Placeholders: N/A
  not_enough_players: "%prefix% &c&lERROR: &7At least three players must be online in order to give a mass hug!"

  # The message that the sender receives if they try to hug themself and the "allow_self_hugging" setting is set to false.
  # Supported Placeholders: N/A
  not_allowed_self_hug: "%prefix% &c&lHmm &7well... this is awkward. It seems as if something is preventing you from hugging yourself."

  # The message that the sender receives if they type a subcommand incorrectly.
  # Supported Placeholders: N/A
  invalid_arguments: "%prefix% &7Type &b/hugs help &7for the proper usage of the commands!"

  # The message that the sender receives if they have too many arguments.
  # Supported Placeholders: N/A
  too_many_arguments: "%prefix% &c&lERROR: &7Too Many Arguments. Type &b/hugs help &7for the correct usage!"

  # The message that the sender receives if they don't have enough arguments.
  # Supported Placeholders: N/A
  too_few_arguments: "%prefix% &c&lERROR: &7Too Few Arguments. Type &b/hugs help &7for the correct usage!"

  # The message that the sender receives when they check for a player's info and the player's name is longer than 16 characters.
  # Supported Placeholders: N/A
  invalid_player: "%prefix% &c&lERROR: &7Invalid Name. Names are, at maximum, 16 characters long."

  # The message that the sender receives if they use /hugs info  and the receiver's data isn't found.
  # Supported Placeholders: %target%
  data_not_found: "%prefix% &c&lERROR: &7%target% has not given nor received any hugs. :'( \nWhat part about \"Spread the Love\" didn't you understand?"

  # The message that the sender receives if they do not have the correct permissions.
  # Supported Placeholders: %permission%
  no_permission: "%prefix% &cYou do not have the required permissions to use this command! Silly Goose. You need &e%permission% &cto use this command!"

  # The cooldown message sent to players on cooldown.
  # Supported Placeholders: {X}
  cooldown_message: "&cYou must wait &e{X} &cseconds before giving another hug!"

#
# Experimental Messages
#
experimental:
  passive_mode: "%prefix% &3Passive mode is enabled. You cannot harm other players!"

#
# The command usage messages.
#
usages:
  hug: "&3&lProper Usage &8&l>> &b/hug "
  info: "&3&lProper Usage &8&l>> &b/hugs info "
  total: "&3&lProper Usage &8&l>> &b/hugs total"
  purge: "&3&lProper Usage &8&l>> &b/hugs admin purge "

#
# The gui names.
#
gui_names:
  confirmation: "&3&lHugs &8&l>> &8Confirmation Page"
  leaderboard: "&3&lHugs &8&l>> &8Leaderboard"

guis:
  confirmation:
    name: "&3&lHugs &8&l>> &8Confirmation Page"
  leaderboard:
    name: "&3&lHugs &8&l>> &8Leaderboard"
    player_head_name: "&a%rank%. &7%player%"
    player_head_lore:
      - "&bHugs Given: &7%hugs_given%"
      - "&bHugs Received: &7%hugs_received%"
    text_format: "&7&l%rank%. &6%player% - %total%"

🗺️ 未来计划 (v2.1)

计划添加 MySQL 支持并改进排行榜。

🗓️ 更新频率

会在新的Minecraft版本发布时进行更新。功能更新时间不定,具体取决于开发进度和生活安排。

❓ 疑问与建议

如果您有任何问题、意见、疑虑或建议,请随时提出。请在讨论区而不是评论区发布它们。如果您喜欢此插件,请考虑对其进行评分并留下建议。

💖 支持作者

如果您喜欢我的插件并想看到更多类似的插件,或者想支持我未来的工作,请考虑捐赠。所有的捐款都将用于未来插件的进一步开发。

点击此处捐赠!

📜 使用条款

您在此承认我 ShadowMasterGaming 是 Hugs 插件的创建者,并拥有其所有权利。您还同意不声明它是您自己的作品或以任何方式或形式重新分发它。