
上面这个是我自己写的一个小函数,也是很久之前写的了。最近做了几个花里胡哨的教程,所以把这个也讲一讲吧(也挺花里胡哨的)
首先我们要用二分法分解计分板分数,相当于把它转换成一个二进制数字。
首先我举个例子,假设计分板分数为9,我们让他执行如下操作

我们就可以得到9的二进制表达式1001,然后我们根据二进制的位数再给它加回去就能得到10进制表达
用这个方法就能更方便的给予经验,不然你也可以做一个超长的递归,减一分加一点经验
在Level1的时候,经验只会被分成7份(7point),但是gif中却能做到把它切割成非常小的单位,这是因为MC扣除等级后,相应的point不会被刷新。我们可以把玩家的经验放大到高等级,做出我们想要的比例,然后恢复至原来的等级就能做倒了。
根据经验
的说明,我们可以计算出在等级为129时,升级到下一级需要的经验值为1003,非常接近1000,适合用来做比例,此外等级为29时,升级需要的经验值是102,也比较接近100,同样适合来做。下面我为了方便所以用29级来做示范。
的说明,我们可以计算出在等级为129时,升级到下一级需要的经验值为1003,非常接近1000,适合用来做比例,此外等级为29时,升级需要的经验值是102,也比较接近100,同样适合来做。下面我为了方便所以用29级来做示范。
- scoreboard objectives add xp dummy
- #首先将玩家的point设置为0
- xp set @s 0 points
- #我这里偷懒所以用等级29,你想做精准一点的话请用129级那个
- xp set @s 29 levels
- scoreboard players set @s xp 50
- execute if score @s xp matches 64.. run xp add @s 64 points
- execute if score @s xp matches 64.. run scoreboard players remove @s xp 64
- execute if score @s xp matches 32.. run xp add @s 32 points
- execute if score @s xp matches 32.. run scoreboard players remove @s xp 32
- execute if score @s xp matches 16.. run xp add @s 16 points
- execute if score @s xp matches 16.. run scoreboard players remove @s xp 16
- execute if score @s xp matches 8.. run xp add @s 8 points
- execute if score @s xp matches 8.. run scoreboard players remove @s xp 8
- execute if score @s xp matches 4.. run xp add @s 4 points
- execute if score @s xp matches 4.. run scoreboard players remove @s xp 4
- execute if score @s xp matches 2.. run xp add @s 2 points
- execute if score @s xp matches 2.. run scoreboard players remove @s xp 2
- execute if score @s xp matches 1.. run xp add @s 1 points
- execute if score @s xp matches 1.. run scoreboard players remove @s xp 1
- xp set @s 0 levels
。。。所以说怎么搞增长
没太清楚怎么弄
看不太明白,mc扣除等级,point不会刷新是什么意思
来加惊艳楼!!!
如果经验100+这个还能正常显示么 那如果扣除是 那么图标也是扣除吗
安齐升 发表于 2022-6-15 16:34
看不太明白,mc扣除等级,point不会刷新是什么意思
当你使用/xp指令改变等级时,此时经验值所占%不变
1 10
——————--- ——————---
相当抽象
早就想知道这个比例了。。一直不明白。看懂了!有用!
很实用的一个东西呢,可以用到倒计时
有点没太听懂...
这个技巧可以让我们了解升下一级要多少经验?
mcbbs有你更精彩
这个怎么 编辑呢
不懂就问,这是python吗
是基于什么理论
大佬就是牛 什么都能研究得透透的hhhh
理科生就是厉害
这个应该可以具体运用到服务器里感觉,例如说是用经验条来倒计时,或者显示得分。不过得分大多会另做UI。
.....没听懂eee
有点没搞懂QWQ
wow厉害啊大佬
不懂就问,这是python吗
礼貌水贴 哎嘿哎嘿的爬
666666666666666666666666666
学废了学废了
来点萌新能够看懂解释吧





这个好像很实用啊
学到了学到了