怎么检测玩家输入的是中文 和 字数限制
'改名':
update: 20
refresh: 1
display:
material: iron_ingot
name: '&a改名卡'
lore:
- '&a改名字用的'
actions:
left:
left:
- close
- catcher:
num:
type: SIGN
before: 'actionbar: &0&l请输入你的名字'
cancel: 'tell: &7已取消操作'
end:
- condition: 'check papi *%checkitem_amount_namecontains:§f改名卡,material:iron_ingot% >= *1'
execute:
- 'tell: &f[&c系统&f] &a操作成功!'
- 'console: nick {meta:input} %player_name%'
- 'take-item: material:iron_ingot,name:§f改名卡,amount:1'
deny:
- 'retype'
- 'tell: 请输入 正确的名字 | 输入 cancel 取消'
'改名':
update: 20
refresh: 1
display:
material: iron_ingot
name: '&a改名卡'
lore:
- '&a改名字用的'
actions:
left:
left:
- close
- catcher:
num:
type: SIGN
before: 'actionbar: &0&l请输入你的名字'
cancel: 'tell: &7已取消操作'
end:
- condition: 'check papi *%checkitem_amount_namecontains:§f改名卡,material:iron_ingot% >= *1'
execute:
- 'tell: &f[&c系统&f] &a操作成功!'
- 'console: nick {meta:input} %player_name%'
- 'take-item: material:iron_ingot,name:§f改名卡,amount:1'
deny:
- 'retype'
- 'tell: 请输入 正确的名字 | 输入 cancel 取消'
是全部中文还是只有一个字就可以
hans0000 发表于 2022-11-9 20:46
是全部中文还是只有一个字就可以
2-6个中文
领军人物 发表于 2022-11-9 21:43
2-6个中文
- condition: 'js: /^[\u4e00-\u9fa5]{2,6}$/.test(vars("{meta:input}"))'