热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

minecraft_死后如何保存Minecraft物品(和其他聪明技巧)

minecraftIthappenstoeventhemostcautiousexplorer:you’refarfromhome,youdie,andallyourpreciou
minecraft

minecraft

It happens to even the most cautious explorer: you’re far from home, you die, and all your precious loot is left sitting in a pile far, far away. Tired of losing your loot? No problem. Read on as we show you how to make your Minecraft inventory persist after death (along with some other handy game-changing tricks).

即使是最谨慎的探险家也都会遇到这种情况:您不在家,就死了,所有珍贵的战利品都坐在一堆又一堆的地方。 厌倦了失去战利品? 没问题。 请继续阅读,我们会向您展示如何使Minecraft的存货在死亡后仍然存在(以及其他一些方便改变游戏规则的技巧)。

Note: This tutorial is focused on the PC edition of Minecraft as, presently, neither Minecraft Pocket Edition or Minecraft Console Edition support the editing of the in-game variables required for enabling persistent inventory or the like. Should this change, we will update the tutorial with instructions for the other editions. 

注意:本教程的重点是PC版的Minecraft,因为目前,Minecraft Pocket Edition或Minecraft Console Edition均不支持启用永久清单等所需的游戏内变量的编辑。 如果进行了此更改,我们将使用其他版本的说明来更新教程。

我为什么要这样做? (Why Do I Want To Do This?)

We’re huge proponents of playing a game the way you want to play it and in the case of a game like Minecraft, the game is outright designed to encourage players to do just that: to build, create, manipulate, and outright edit the world to create the game universe and play experience they want.

我们大力支持按照想玩的方式玩游戏,对于像Minecraft这样的游戏,游戏的设计完全是为了鼓励玩家这样做:建立,创建,操纵和彻底编辑游戏。创造游戏世界并享受他们想要的体验的世界。

One particular aspect of the default play scheme that many players find quite frustrating is the way player inventory is dropped upon death. By default, when you die in Minecraft you lose experience (and some of that experience is dropped as experience orbs at the point of death) and you lose your entire personal inventory at that location too: all your armor, weapons, tools, and all the loot you’re carrying drop into a scattered pile (as seen in the screenshot below).

许多玩家感到非常沮丧的默认游戏方案的一个特定方面是玩家死亡时掉落库存的方式。 默认情况下,当您在Minecraft中死亡时,您会失去经验(并且某些经验会在死亡时掉落为经验球),并且您也会在该位置失去全部个人物品:所有盔甲,武器,工具和所有物品您携带的战利品掉落成一堆(如下面的屏幕截图所示)。

While some people enjoy the challenge of such an arrangement, there are plenty of times when it’s just downright annoying. If you die very far from home while exploring, for example, and you have no idea where you were when you died then your diamond armor and other hard earned loot is as good as gone.

尽管有些人喜欢这种安排带来的挑战,但很多时候,这种安排令人生厌。 例如,如果您在探索时离家很远,而死时却不知道自己在哪里,那么您的钻石盔甲和其他来之不易的战利品就好了。

Fortunately, it’s pretty easy to edit the in-game flag that specifies whether or not you keep your inventory upon death as well as several other very handy flags that change other game behaviors. Let’s take a look at how to keep our inventory and perform other useful edits now.

幸运的是,编辑游戏中标记非常容易,它可以指定是否在死亡时保留库存以及其他会改变其他游戏行为的方便标记。 让我们看一下如何保持库存并立即执行其他有用的编辑。

更改Minecraft游戏规则 (Changing Minecraft Game Rules)

There are many commands you can execute in Minecraft via the in-game command console, but only around a dozen of them are persist changes to game variables. You can, for example, give yourself things in creative mode (or survival mode with the cheats turned on) using the /give command but doing so doesn’t alter the state of the game.

您可以通过游戏中的命令控制台在Minecraft中执行许多命令,但是只有十几个命令是对游戏变量的持久更改。 例如,您可以使用/ give命令以创意模式(或在启用了作弊功能的生存模式)下为自己提供东西,但这样做不会改变游戏状态。

如何使用命令 (How To Use Commands)

For truly game altering modifications we need to change the “game rules” variables with the /gamerules command. All game commands, including the /gamerules command are entered into Minecraft via the chat box (which functions as a command console when input is preceded by the “/” character).

为了真正改变游戏规则,我们需要使用/ gamerules命令更改“游戏规则”变量。 所有游戏命令,包括/ gamerules命令,都通过聊天框(在输入之前带有“ /”字符时充当命令控制台)输入Minecraft。

Before we proceed it’s important to note that the /gamerule command and other powerful command options only work on servers if you are the administrator or one of the operators, and they only work on single player/open-to-LAN multiplayer games if you have enabled cheats either in the game creation menu when you first created your world or temporarily when via the open-to-LAN trick.

在继续之前,必须注意/ gamerule命令和其他功能强大的命令选项仅在您是管理员或运营商之一的情况下才能在服务器上运行,并且如果您具有以下条件,则它们仅在单人/局域网开放多人游戏上运行在您首次创建世界时在游戏创建菜单中启用了作弊功能,或者在通过开放局域网的技巧临时启用了作弊功能。

Open the chat box by pressing T (alternatively you can use the “/” key as a shortcut which will open the chat box and preseed it with the “/” character).  The format for the /gamerules command is as follows.

通过按T打开聊天框(或者,您可以使用“ /”键作为快捷方式,这将打开聊天框并在其前面加上“ /”字符)。 / gamerules命令的格式如下。

/gamerules [value]

/gamerules [value]

The is always single variable (no spaces in between multi-word rule names) and is always case sensitive. The [value] is always Boolean value of “true” or “false” to toggle the game rule on except in the case of a single game rule; the game rule “randomTickSpeed” which allows you to increase or decrease the number of random game clock ticks that cause plant growth and other changes by integer based adjustment (0 disables the random tick, any positive integer will increase it by X amount).

始终是单个变量(多字规则名称之间没有空格),并且始终区分大小写。 [value]始终是布尔值“ true”或“ false”,以打开游戏规则, 除非是单个游戏规则; 游戏规则“ randomTickSpeed”,它允许您通过基于整数的调整来增加或减少导致植物生长和其他变化的随机游戏时钟滴答声的数量(0禁用随机滴答声,任何正整数将其增加X数量)。

启用keepInventory (Enabling keepInventory)

One of the most useful game rule tweaks you can make, by far, is to toggle the “keepInventory” rule. As we mentioned above (and as you’re well aware if you’ve taken the time to seek out this tutorial) when you die you drop all your items and loot around you, like so.

到目前为止,您可以进行的最有用的游戏规则调整之一就是切换“ keepInventory”规则。 正如我们上面提到的(并且您很清楚是否花了时间查找本教程),当您死时,您会放下所有物品并在周围掠夺,就像这样。

In the above screenshot you can see clearly that our quick access inventory bar is empty and all our loot is laying on the ground around us. That’s unfortunate (and if you die in a lava pit you’ll never get that loot back).

在上面的屏幕截图中,您可以清楚地看到我们的快速访问清单栏为空,并且所有赃物都躺在我们周围的地面上。 不幸的是(如果您死在熔岩坑中,您将永远无法获得战利品)。

Let’s fix that now by editing the “keepInventory.” Pull up the chat window in your game and enter the following command (remembering that it is case sensitive).

现在,通过编辑“ keepInventory”来解决此问题。 拉起游戏中的聊天窗口,然后输入以下命令(请记住,该命令区分大小写)。

/gamerule keepInventory true

/gamerule keepInventory true

Now look what happens when we die with the keepInventory flag set.

现在看看设置了keepInventory标志而死的情况。

You died! But you kept your loot! Game rules are magical.
你死了! 但是你保持了战利品! 游戏规则是不可思议的。

Look at that! We’re dead but we’re still holding our sword, the armor indicator above our toolbar indicates we’re still wearing our armor, and the toolbar itself is still loaded with our supplies. As an added bonus, above and beyond keeping our precious loot, you’ll also notice that there are no experience orbs floating around. When the keepInventory flag is on you don’t drop experience orbs either. (We wouldn’t mind a way to tweak this so you lost experience but not your loot, but as of now there isn’t a game rule for that).

看那个! 我们已经死了,但我们仍然握着剑,工具栏上方的装甲指示器指示我们仍在穿盔甲,工具栏本身仍装有用品。 作为额外的奖励,除了保持我们的珍贵战利品外,您还会注意到没有经验球在周围漂浮。 当keepInventory标志打开时,您也不会掉落经验球。 (我们不介意一种方法来进行调整,因此您失去了经验,但没有失去战利品,但是到目前为止,还没有游戏规则)。

其他有用的游戏规则 (Other Useful Game Rules)

In addition to the very handy keepInventory game rule, there are fourteen other game rules you can easily edit in game. While some of the game rules are very specific to server administration (like the “commandBlockOutput” flag that specifies whether or not game administrators should be notified when command blocks perform game commands), many of them are very useful in local single player and simple local multiplayer games too.

除了非常方便的keepInventory游戏规则外,您还可以在游戏中轻松编辑其他十四种游戏规则。 尽管某些游戏规则非常特定于服务器管理(例如,“ commandBlockOutput”标志指定在命令块执行游戏命令时是否应通知游戏管理员),但其中许多规则在本地单人游戏和简单本地游戏中非常有用多人游戏。

You can read the full list of game rule commands in the Minecraft wiki, and you can also type /gamerules and hit the Tab key to list off all the available game rules as seen in the screenshot above. While we’re not going to list and explain all of them, here are our favorite useful-in-single-player commands.

您可以在Minecraft Wiki中阅读游戏规则命令的完整列表,也可以键入/ gamerules并按Tab键列出所有可用的游戏规则,如上面的屏幕快照所示。 虽然我们将不列出和解释所有这些内容,但是这里是我们最喜欢的有用的单人游戏命令。

止火蔓延 (Halt Fire Spread)

We’ve all been there. You build your first house. You set up a working fireplace with lava or netherrack. You pat yourself on the back at a house well built and then the next thing you know, the roof is on fire. Unless carefully and properly contained fire in Minecraft will spread. Lava, netherrack, and lightning strikes can all start and spread fires, so if you don’t want to come back from your mine to find that your entire house has burned down this is a very handy command.

我们都去过那里。 您建造了第一所房子。 您用熔岩或野火架设了一个工作壁炉。 您在一栋建造良好的房屋上拍打自己的后背,然后知道的第二件事是屋顶着火了。 除非经过仔细和适当的控制,否则Minecraft中的火会蔓延。 熔岩,地雷架和雷击都可以起火并蔓延,因此,如果您不想从矿井回来,发现整个房子都被烧毁,这是非常方便的命令。

If Minecraft had regulatory agencies, this would definitely be against building code.
如果我的世界有监管机构,那肯定是违反建筑法规的。

Disable the spread of fire with the following.

通过以下方法禁用火势蔓延。

/gamerule doFireTick false

/gamerule doFireTick false

In addition to keeping lightning strikes and other natural fire sources from damaging things, it’s also very handy if you want to incorporate fire and lava into your designs without worrying about nearby flammable structures going up in smoke. With the fire spread disabled you can do improbable things like build a checkerboard made from wool and lava blocks as seen above.

除了防止雷击和其他自然火源损坏事物之外,如果您希望将火和熔岩纳入设计中,而不必担心附近的易燃结构冒烟,这也非常方便。 禁用火势蔓延后,您可以执行不可能的事情,例如,用羊毛和熔岩块制成棋盘,如上所示。

停止暴民的悲伤 (Stop Mob Griefing)

“Mob griefing” in Minecraft is the ability of game mobs to interact with in-game objects. Every time a zombie picks up an item and carries it, an enderman pulls a block from the surrounding landscape and zips off with it, or other any other mob interacts with an item or block, that’s a form of mob griefing.

Minecraft中的“生物悲伤”是游戏生物与游戏中物体互动的能力。 每次僵尸捡起一件物品并随身携带时,enderman都会从周围的景观中拉出一块积木并拉开拉链,或者其他暴民与该物品或积木互动,这就是暴民的一种形式。

Not even the enderman knows why he’s holding a cactus.
连投币人都不知道为什么他拿着仙人掌。

If you would prefer that zombies can’t run off with your loot or enderman will never be able to pluck a block out a structure you carefully crafted in survival mode, you can turn off mob griefing with the following command.

如果您希望僵尸不能随您的战利品一起逃跑,或者幻影侠永远无法将您精心制作的结构从生存模式中拔出,请使用以下命令关闭暴民的哀悼。

/gamerule mobGriefing false

/gamerule mobGriefing false

Be forewarned that turning off mob griefing disables all mob-on-block interactions including those that are benign or beneficial. For example, sheep will no longer destroy grass blocks while grazing (a relatively benign activity) and the villagers’ ability to replant crops (a beneficial activity) will vanish.

请注意,关闭暴徒悲伤会禁用所有的暴徒互动,包括良性或有益的互动。 例如,放牧绵羊(不再是良性活动)将不再破坏草丛,而村民补种庄稼的能力(一项有益活动)将消失。

享受永久日光 (Enjoy Permanent Daylight)

When you’re playing a survival game, the day/night cycle adds interest and challenge to the game. When you’re build, however, the constant cycling of day and night (and the difficulty of working in semi-darkness) can get real old. Thankfully, you can easily toggle the daylight cycle.

当您玩生存游戏时,昼/夜循环会增加游戏的趣味性和挑战性。 但是,在构建时,昼夜不停的循环(以及半黑暗中的工作难度)会变得很老。 幸运的是,您可以轻松切换日光周期。

/gamerule doDaylightCycle false

/gamerule doDaylightCycle false

It’s important to note that the above command doesn’t permanently set the game to daytime, it permanently sets the game to the time it is when you issue the command.

需要特别注意的是,上述命令不会将游戏永久设置为白天,而是将游戏永久设置为您发出命令的时间。

The moon never sets on the zombie island.
月亮从未落在僵尸岛上。

As such it’s useful not just for setting the game to be permanently fixed at bright noonday sun, but also to fix the game in permanent darkness if applied in the middle of the night. If you want a sort of six month Siberian darkness to fight off horde after horde of zombies you can lock the game at midnight until you tire of the adventure.

因此,不仅可以将游戏设置为永久固定在正午的阳光下,而且还可以在深夜应用时将游戏固定在永久黑暗中。 如果您想让六个月的西伯利亚黑暗与僵尸接战,您可以在午夜锁定游戏,直到您厌倦了冒险。



Craving more Minecraft articles? Check out our extensive collection of Minecraft tips, tricks, and guides. Have a Minecraft question or tutorial you’d like to see us write? Shoot us an email at ask@howtogeek.com and we’ll do our best to help.

想了解更多《我的世界》文章吗? 查看我们广泛的Minecraft提示,技巧和指南 。 有您想让我们写的Minecraft问题或教程吗? 向我们发送电子邮件至ask@howtogeek.com,我们将竭尽所能。

翻译自: https://www.howtogeek.com/208270/how-to-keep-your-minecraft-items-when-you-die-and-other-clever-tricks/

minecraft



推荐阅读
author-avatar
两斤
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有