跳到主要内容

Kether 动作

Assiah 注册了 Kether 脚本动作,可在 TabooLib Kether 脚本中直接操作邮件系统。

动作一览

动作返回值说明
mail-send {target} {title} {body}Boolean向目标玩家发送邮件
mail-unread [player]Long获取玩家未读邮件数量
mail-has-unread [player]Boolean检查玩家是否有未读邮件

mail-send

向目标玩家发送一封邮件。发送者为当前脚本上下文中的玩家。

mail-send {target} {title} {body}
参数类型说明
targetString目标玩家名称
titleString邮件标题
bodyString邮件正文

返回 Booleantrue 表示发送成功。

示例

# 向指定玩家发送邮件
mail-send "Steve" "欢迎回来" "好久不见,欢迎回到服务器!"

# 配合变量使用
mail-send &target &title &body

# 在条件中使用
if mail-send "Steve" "通知" "你的物品已到期" then {
tell sender *&"邮件发送成功"
} else {
tell sender *&"邮件发送失败"
}

mail-unread

获取玩家的未读邮件数量。不指定玩家时,默认为当前脚本上下文中的玩家。

mail-unread [player]
参数类型说明
playerString?玩家名称(可选,默认为当前玩家)

返回 Long,未读邮件数量。

示例

# 获取当前玩家未读数
set unread to mail-unread
tell sender *&"你有 {{&unread}} 封未读邮件"

# 获取指定玩家未读数
set count to mail-unread "Steve"

mail-has-unread

检查玩家是否有未读邮件。不指定玩家时,默认为当前脚本上下文中的玩家。

mail-has-unread [player]
参数类型说明
playerString?玩家名称(可选,默认为当前玩家)

返回 Boolean

示例

# 玩家进入服务器时检查未读邮件
if mail-has-unread then {
tell sender *&"你有未读邮件,请查收!"
}

# 检查指定玩家
if mail-has-unread "Steve" then {
print "Steve 有未读邮件"
}

在 TrMenu 等插件中使用

这些 Kether 动作可以在任何支持 Kether 脚本的插件中使用:

# TrMenu 菜单示例 - 邮件图标显示未读数
Icons:
mail:
display:
material: PAPER
name: '&e邮箱'
lore:
- '&7未读邮件: &f{{mail-unread}}'
actions:
all:
- 'command: assiah open'