本帖最后由 曾·不再 于 2018-6-15 21:27 编辑
问题主已自己攻破难题,请删帖,谢谢
%player_health%这个变量嘛???
你首先得安装最新版的papi然后把原来papi的配置文件删除生成新的配置文件然后安装新的变量才可以像我一样优秀
请问怎么安装新的变量,是JavaScript么,这个变量安装后无法显示,在hook检查没有这个变量,我的插件是最新版的2.9.1
[size=14.6667px]
[size=14.6667px]单击下面的链接查看占位符
[size=14.6667px]
单击下面的链接查看与PlaceholderAPI挂钩的插件
你有使用计分板或者BOSS血条来显示玩家血量吗?或者给玩家设置高血量发现不是一位小数的
我测试一下哦
使用过程与变量都没有错,毋庸置疑,但是我的插件无法显示出%javascript_health_rounded%的存在,而这是血量取整数的必须要求,这一点出了问题,无法检测出%javascript_health_rounded%

BossBar也是完全可以的
我没有安装java那个东东依然可以你把旧的papi插件和配置文件一起删了装新的吧
我是增加血量后才有一串数字的,默认的血量和你一样,能请你用一些插件设置为高血量再看看么?
那行可是我没装那种插件我嗑药行不

一切正常!
这个测试端的papi我只装了player
我刚才也试了一下,我使用了药水,也是整数,但是,使用血量增加的插件,就会导致血量变低

不行不行还是要安装javascript的血量回到一半就成一大串了emmmmm啪啪打脸
安装了也无济于事,无法进行识别代码,想这个问题非常久了,这个问题需要解决
你能够帮助我找到一些其他类似问题的链接或解决问题的方案吗?如果能够解决问题我这里251金粒就给你,谢谢
[size=14.6667px]javascript_placeholders.yml?
[size=14.6667px] .SpoilerTarget" style="margin-top: 5px; margin-bottom: 5px; padding-right: 10px; padding-left: 10px; font-family: "Droid Sans", Arial, sans-serif; font-size: 12px; font-weight: 600; line-height: 36px; color: rgb(83, 83, 83); background-color: rgb(217, 217, 217); border-width: 0px; border-top-color: rgb(255, 255, 255); border-radius: 3px; outline: none; cursor: pointer; box-shadow: rgba(0, 0, 0, 0.1) 0px -2px 0px inset; -webkit-appearance: none; height: 36px; max-width: 99%;">[tr]Spoiler: javascript_placeholders.yml
If you have the javascript expansion enabled, the plugin will generate a javascript_placeholders.yml file where you can create your own placeholders.
[size=14.6667px][tr]There are 2 ways you can create these javascript based placeholders. Either specify the javascript directly in the expression: section for each placeholder, or specify a file that the javascript will be loaded from by setting the expression to the following format -
[tr]'" newtip="表达式:‘file:’">expression: 'file: '
When an expression starts with the "file: " keyword, a file will be created in the /plugins/PlaceholderAPI/javascripts folder with the name and file format specified if it does not exist.
These placeholders are reloaded on /placeholderapi reload so no need to restart your server to make changes.?
[tr]Code (YAML):
# javascript_placeholders.yml
# You can create custom placeholders which utilize javascript to determine the result of the custom placeholder you create.
# You can specify if the result is based on a boolean or the actual javascript.
#
# If you do not specify a type: the placeholder will default to a boolean type
# A boolean type must contain a true_result: and false_result:
#
# A string type only requires the expression: entry
#
# Javascript placeholders can contain normal placeholders in the expression, true_result, or false_result
# These placeholders will be parsed to the correct values before the expression is evaluated.
#
[tr]%" newtip="#您的javascript占位符将由:%javascript_%标识"># Your javascript placeholders will be identified by: %javascript_%
#
# Javascript placeholder format:
#
# BOOLEAN TYPE
[tr]:" newtip="#:"># :
# expression:
# type: 'boolean'
# true_result:
# false_result:
#
# STRING TYPE
[tr]:" newtip="#:"># :
# expression:
# type: 'string'
#
#
# ==== ADVANCED VARIABLES ====
# DO NOT USE THESE VARIABLES UNLESS YOU KNOW WHAT YOU ARE DOING!
#
# You can access a few Bukkit API classes and methods using certain keywords:
#
# Using "BukkitServer" in your javascript will return Bukkit.getServer()
# You can use any methods inside of the Server class:
#
# Example: BukkitServer.getBannedPlayers().size().toFixed()
# Will return how many players are banned
#
# This variable is handy if you want to iterate through all online players.'
#
# Using "BukkitPlayer" in your javascript will return the Player object you are setting placeholders for.
# You can use any methods inside of the Player class:
#
# Example: BukkitPlayer.hasPermission("some.permission")
# Will return if the player has a specific permission
# This variable is handy if you want to check a players permission node, or access other methods inside of
# the player class for the specified player.
#
# More advanced variables are coming soon! Only use these variables if you know what you are doing!
#
# ==================
#
#
# Javascript placeholder examples:
#
# millionaire:
# expression: '%vaulteco_balance% >= 1000000'
# type: 'boolean'
# true_result: '&aMillionaire'
# false_result: '&cbroke'
# is_staff:
# expression: '"%vault_group%" == "Moderator" || "%vault_group%" == "Admin" || "%vault_group%" == "Owner"'
# type: 'boolean'
# true_result: '&bStaff'
# false_result: '&ePlayer'
# health_rounded:
# expression: 'Math.round(%player_health%)'
# type: 'string'
# staff_online:
# expression: 'var i = 0; for (var p in BukkitServer.getOnlinePlayers()) { if (BukkitServer.getOnlinePlayers()[p].hasPermission("staff.online")) {i = i+1;};} i.toFixed();'
# type: 'string'
#
#
# You can optionally specify a file that the javascript expression will be loaded from if your expression
# is bigger than 1 line. To specify javascript be loaded from a file, follow this format:
#
# is_op:
# expression: 'file: is_op.js'
# type: 'string'
#
# The following placeholder will attempt to load javascript from the /plugins/PlaceholderAPI/javascripts/is_op.js file
# if the folder/file exists. If the folder/file does not exist it will be created.
# You must specify the file extension with the file name. Any file extension is accepted.
[tr]millionaire:
[tr]expression: '%vaulteco_balance% >= 1000000'
[tr]type: [tr]boolean
[tr]true_result: [tr]'&aMillionaire'
[tr]false_result: [tr]'&cbroke'
[tr]is_staff:
[tr]expression: '"%vault_group%" == "Moderator" || "%vault_group%" == "Admin" || "%vault_group%"
== "Owner"'
[tr]type: [tr]boolean
[tr]true_result: [tr]'&bStaff'
[tr]false_result: [tr]'&ePlayer'
[tr]staff_online:
[tr]type: [tr]string
|