如题,如图
我想获取这个Damage的值 并且将这个值加入玩家的伤害
比如玩家本来的伤害为 5 我这里设置50000 经过这个计算让玩家的伤害最终为50005
附:乾坤剑1 2 3为自定义的字符串 Damge为定值
如果你问一个问题,我还可以回答
你这感情是留作业呢,直接让别人帮你写
1.读取
YamlConfiguration yaml = YamlConfiguration.loadConfiguration(File file);
dmg = yaml.getDouble("Fabao.乾坤剑.Damage");
2.触发
监听器:EntityDamageByEntityEvent event
if(attacker instanceof Player) #attacker自己从damager判断,略过不写
event.setDamage(event.getDamage + dmg);
简易代码,自行理解
你这感情是留作业呢,直接让别人帮你写
1.读取
YamlConfiguration yaml = YamlConfiguration.loadConfiguration(File file);
dmg = yaml.getDouble("Fabao.乾坤剑.Damage");
2.触发
监听器:EntityDamageByEntityEvent event
if(attacker instanceof Player) #attacker自己从damager判断,略过不写
event.setDamage(event.getDamage + dmg);
简易代码,自行理解