streng,我的世界中如何使用命令方块?

谢谢邀请

streng,我的世界中如何使用命令方块?

文章插图
文章插图
给予命令方块指令:
1.8版本以上
/give 玩家名称 command_block
1.7版本以下
/give 玩家名称 137
命令方块分为脉冲(外观默认) , 重复 , 保持开启(外观紫色) , 连锁(外观绿色)可以在控制台调模式streng 。
基础的指令有:
/summon
召唤一个实体
/tp (X) (y) (Z)
瞬间传送(需填写坐标)
/give xxxxxxxxxxxxxx xxxx
给予 玩家名称 物品名称 数量
/weather xxx
设置天气 天气
/time set数字
控制时间(数字越大 , 调成了时间就会越晚)
/gamemode 单词或数字
更改模式
PS:那些是指令的冰山一角 , 用上红石配合指令更佳java版1.13后更改模式的数字被换成了单词
这段VB代码是什么意思?Private Function CChinese(ByVal StrEng As String) As String
If Not IsNumeric(StrEng) Or StrEng Like “* 。*” Or StrEng Like “*-*” Then
‘如果变量StrEng不是数字或者形如* 。
*(如1 。2)或者形如*-*(如1-2)
If Trim(StrEng)“” Then MsgBox(“无效的数字”)
‘如果变量StrEng去除两端空格后不为空 , 则弹出对话框说明是无效的数字
CChinese = “” : Exit Function
‘函数返回空字串并结束函数
End If
Dim intLen As Integer, intCounter As Integer
Dim strCh As String, strTempCh As String
Dim strSeqCh1 As String, strSeqCh2 As String
Dim strEng2Ch As String
‘以上四行申明变量 , 不详细解释了
strEng2Ch = “零壹贰叁肆伍陆柒捌玖”
strSeqCh1 = ” 拾佰仟 拾佰仟 拾佰仟 拾佰仟”
strSeqCh2 = ” 万亿兆”
‘以上三行初始化变量 , 不详细解释了
StrEng = CStr(CDec(StrEng))
‘将变量StrEng转化为Decimal类型, 然后再转化为字符串类型(Decimal 值类型适用于要求使用大量有效的整数及小数位数并且没有舍入错误的财务计算)
intLen = Len(StrEng)
‘获得变量StrEng字符串的长度,并储存在intLen中
For intCounter = 1 To intLen
‘计数器, 从1到intLen循环,不详细解释
strTempCh = Mid(strEng2Ch, Val(Mid(StrEng, intCounter, 1)) + 1, 1)
‘Val(Mid(StrEng, intCounter, 1))返回变量StrEng中的和计数器对应的当前字符,并将该字符转化为数字类型;
‘将如自变量StrEng为123,则第一轮循环则返回1,第二轮循环返回2,第三轮循环返回3,注释中我们暂计为x
‘然后Mid(strEng2Ch, Val(Mid(StrEng, intCounter, 1)) + 1, 1)返回”零壹贰叁肆伍陆柒捌玖”中第x+1个,实际效果是将数字转化为大写形式
‘如第一轮循环,则将1转化为壹,第二轮循环将2转化为贰
‘***********************************************************************************************************************
‘函数解释:Mid(str,a,b),其中str为字符串类型,a,b为整型;则该函数返回str中,从第a个字符开始的b个字符 。
如Mid(“abcdef”,3,2),则返回cd
‘***********************************************************************************************************************
If strTempCh = “零” And intLen1 Then
‘入过strTempCh为”零”并且变量长度不等于1
If Mid(StrEng, intCounter + 1, 1) = “0” Or (intLen – intCounter + 1) Mod 4 = 1 Then
‘如果变量StrEng的下一个字符为零 或者 (剩余字符串长度+1)除4余1,也就是剩余字符串长度恰为4的倍数
strTempCh = “”
‘strTempCh置为空
End If
Else
‘否则
strTempCh = strTempCh & Trim(Mid(strSeqCh1, intLen – intCounter + 1, 1))
‘将strTempCh与” 拾佰仟 拾佰仟 拾佰仟 拾佰仟”中的相应字符连接
【streng,我的世界中如何使用命令方块?】‘还用123来打比方,第一轮循环到此处时strTempCh为”壹”;intLen – intCounter + 1 = 3,则Trim(Mid(strSeqCh1, intLen – intCounter + 1, 1))为”佰”
End If
If (intLen – intCounter + 1) Mod 4 = 1 Then
‘如果(剩余字符串长度+1)除4余1,也就是剩余字符串长度恰为4的倍数
strTempCh = strTempCh & Mid(strSeqCh2, (intLen – intCounter + 1) \ 4 + 1, 1)
‘将strTempCh与” 万亿兆”中的相应字符连接
‘用12345来打比方, 第一轮循环到此处时strTempCh为”壹”,intLen – intCounter + 1 = 5,5\4+1 = 2,则Mid(strSeqCh2, (intLen – intCounter + 1) \ 4 + 1, 1)为”万”
If intCounter > 3 Then
‘如果计数器大于三
If Mid(StrEng, intCounter – 3, 4) = “0000” Then strTempCh = Left(strTempCh, Len(strTempCh) – 1)
‘如果变量StrEng中连续四个为0,则去掉strTempCh的最后一个字符
End If
End If
strCh = strCh & Trim(strTempCh)
‘将strTempCh储存到strCh中
Next
CChinese = strCh
‘返回strCh
End Function 。
把你觉得有疑问的标出来 , 不然太多 , 有些简单就没有必要说得 。

    推荐阅读