在主类中声明了一下
public static PlayerPoints playerPoints
然后就playerpoints.getAPI().look(player.getName())进行调用了
结果发现这行是Null的
用了player.getuuid也是一样
去官网看了点击API发现网页没了。。。。
是不是还应该加点什么?
public static PlayerPoints playerPoints
然后就playerpoints.getAPI().look(player.getName())进行调用了
结果发现这行是Null的
用了player.getuuid也是一样
去官网看了点击API发现网页没了。。。。
是不是还应该加点什么?
本帖最后由 V逍遥 于 2021-5-1 22:07 编辑
从playerName 更换为 UUID
复制代码
并确保UUID不是Null
从playerName 更换为 UUID
- public int look(UUID playerId)
并确保UUID不是Null
V逍遥 发表于 2021-5-1 22:05
从playerName 更换为 UUID
并确保UUID不是Null
- if(player.getUniqueId() != null){
- player.sendMessage("玩家UUID为" + player.getUniqueId() + "进行获取玩家点券");
- int look = Main.playerPoints.getAPI().look(player.getUniqueId());
- player.sendMessage("玩家点券" + look);
- } else {
- player.sendMessage("UUID为null");
- }
凉凉丶 发表于 2021-5-1 22:18
进行了上述测试,Main.playerPoints.getAPI().look(player.getUniqueId());这行依旧是null的报错
...
playerPoint实例化了吗?
PercyDan 发表于 2021-5-1 22:44
playerPoint实例化了吗?
在主类中 public static PlayerPoints playerpoints了
调用就是 Main.playerpoints.getAPI.get方法的