命令/gamerule

命令/gamerule

gamerule

需要的权限等级

Java版:2基岩版:1

限制条件

启用作弊(仅对于某些规则)[仅基岩版]

设置或查询游戏规则。

目录

1 语法

2 参数

3 结果

4 输出

5 示例

6 历史

7 导航

语法[编辑 | 编辑源代码]

Java版

gamerule <规则名称> []

参数在Java版中区分大小写。

基岩版

gamerule

gamerule [value: Boolean]

gamerule [value: int]

参数在基岩版中输入时不区分大小写。

参数[编辑 | 编辑源代码]

参见:游戏规则 § 游戏规则列表

JE:<规则名称>

BE:rule: BoolGameRule:enum或rule: IntGameRule:enum

指定要设置或查询的游戏规则。只有某些预设的游戏规则会影响游戏玩法(见预设游戏规则)。

JE:

BE:value: Boolean:enum或value: int:int

指定将游戏规则设置的值。只有true或false指定预设的游戏规则会真正影响游戏玩法,但是对于maxCommandChainLength、playersSleepingPercentage、randomTickSpeed、spawnRadius、maxEntityCramming[仅Java版]和functionCommandLimit[仅基岩版],任何整数(-2147483648~2147483647)都会影响游戏玩法(见预设游戏规则)。

结果[编辑 | 编辑源代码]

命令触发条件Java版基岩版

任意参数未正确指定 无法解析 无法解析

不符合以上所有条件执行成功

输出[编辑 | 编辑源代码]

命令版本条件成功次数/execute store success .../execute store result ...

任意Java版执行成功11该游戏规则在命令执行后的数值(true为1,false为0)

基岩版执行失败0N/AN/A

执行成功1N/AN/A

示例[编辑 | 编辑源代码]

停止昼夜更替:gamerule doDaylightCycle false

停止自然恢复生命值:gamerule naturalRegeneration false

禁止破坏性生物行为(如苦力怕、恶魂等生物改变方块):gamerule mobGriefing false

在玩家死亡时保留物品栏:gamerule keepInventory true

禁止TNT爆炸:gamerule tntExplodes false

屏蔽命令方块执行成功后在控制台显示的文本内容:gamerule commandBlockOutput false

设置玩家重生半径为25格:gamerule spawnRadius 25

在Java版中,设置一格内最大实体堆叠数量为100:gamerule maxEntityCramming 100

在基岩版中和自Java版1.21.9起,禁止玩家互相攻击:gamerule pvp false

禁用聊天框命令反馈:gamerule sendCommandFeedback false

历史[编辑 | 编辑源代码]

Java版1.4.212w32a加入了/gamerule。1.814w29a加入了创建虚拟规则的能力。1.1317w45a不再接受未知值(自定义游戏规则)。现在会对值进行类型检查。携带版1.0.51.0.5.0加入了/gamerule。基岩版1.81.8.0.13现在只有拥有管理员权限的玩家能够使用该命令。?不再接受未知值(自定义游戏规则)。

导航[编辑 | 编辑源代码]

编命令

当前可用

clear

clone

damage

deop

difficulty

effect

enchant

execute

experience

xp

fill

function

gamemode

gamerule

give

help

kick

kill

list

locate

loot

me

op

particle

place

playsound

recipe

reload

ride

say

schedule

scoreboard

setblock

setworldspawn

spawnpoint

spreadplayers

stop

stopsound

summon

tag

msg

tell

w

tellraw

time

title

teleport

tp

transfer

weather

whitelist

仅Java版

advancement

attribute

ban

ban-ip

banlist

bossbar

chase[新增:JE 1.21.9]

data

datapack

debug

defaultgamemode

dialog

fetchprofile[新增:JE 1.21.9]

fillbiome

forceload

item

jfr

pardon

pardon-ip

perf

publish

random

return

rotate

save-all

save-off

save-on

seed

setidletimeout

spectate

team

teammsg

tm

test

tick

trigger

version

warden_spawn_tracker

waypoint

worldborder

仅基岩版

allowlist

changesetting

clearrealmevents

gametips

project

reloadconfig

reloadpacketlimitconfig

save

sendshowstoreoffer

仅教育版

classroommode

code

getchunkdata

getchunks

geteduclientinfo

geteduserverinfo

getspawnpoint

globalpause

resourceuri

takepicture

基岩版和教育版

?

ability

agent

aimassist

camera

camerashake

clearspawnpoint

closewebsocket

codebuilder_actorinfo

controlscheme

daylock

alwaysday

dedicatedwsserver

dialogue

enableencryption

event

fog

gametest

gettopsolidblock

hud

immutableworld

inputpermission

listd

mobevent

music

permission

ops

playanimation

querytarget

replaceitem

script

scriptevent

setmaxplayers

structure

testforblocks

testforblock

testfor

tickingarea

titleraw

toggledownfall

worldbuilder

wsserver

connect

已移除

placefeature

仅Java版

?

achievement

banip

blockdata

broadcast

entitydata

home

iron

locatebiome

replaceitem

setspawn

solid

stats

toggledownfall

testfor

testforblock

testforblocks

unban

wood

仅基岩版

clearfixedinv

mixer

resupply

set_movement_authority

setfixedinvslot

setfixedinvslots

simulationtype

volumearea

仅教育版

collect

dropall

move

position

tpagent

transfer

turn

基岩版和教育版

attack

createagent

destroy

detect

detectredstone

drop

executeasother

executeasself

getitemcount

getitemdetail

getitemspace

inspectdata

inspect

place

till

transferserver

相关推荐

混沌昆仑
365速发官网

混沌昆仑

📅 09-12 👀 5133
我的起源孵化场在哪 我的起源孵化场孵化系统攻略
365账号限制投注怎么办

我的起源孵化场在哪 我的起源孵化场孵化系统攻略

📅 07-21 👀 8732
1986年世界杯,央视首次转播全部52场比赛……
365bet提前结束投注

1986年世界杯,央视首次转播全部52场比赛……

📅 07-12 👀 7778