Template:Translation:未知参数。
随机发生器是会产生随机信号的红石电路。它们能被应用在很多地方,从操纵一场灯光表演,到建造一个赌场。特别指出,随机发生器像大多数红石电路一样,只能在已加载出的区块里工作。如果是用于一个探险地图或一些玩家会走得很远的地图,可以将随机发生器建造在出生点区块
实体随机发生器
投掷器随机发生器
这个随机发生器利用了这样一个事实,投掷器以随机顺序发射物品。每当提供一个信号时,它会输出一个强度为1或3的信号。 要建造它,按照图中的方式放置一个投掷器,漏斗,和红石比较器。 然后把有不同堆叠上限的物品放入投掷器中,如一把剑和一块泥土。当你激活投掷器,它会把一个物品放入漏斗,从而激活比较器。 由于物品占用的空间不同,因此信号强度也会有所不同。看起来好像将物品数堆叠至16时会输出强度为2的信号,但不幸的是除非漏斗事先装了物品,否则将物品数堆叠至16只能得到强度为1的信号。
潜影盒随机发生器
潜影盒能被发射器放置,被活塞破坏,并保留其中的物品。当一个潜影盒被发射器随机放置时,比较器可以产生15种不同的红石信号。
生物随机发生器
生物随机发生器是利用生物随机移动的特性触发红石的随机发生器。当需要多个输出时,这种随机发生器是最好的。信号何时发生或持续多久都无关紧要。 猪随机发生器通常用压力板或绊线钩制作。用绊线钩是最简单的方法,但是需要更多铁。
随机发生器中使用的生物类型可以创造出一些重要的变种。一些常见的选择包括:
唱片机随机发生器
这种随机发生器使用唱片机和漏斗产生强度为1-12的随机红石信号。此机器的独特之处在于大多数其他的随机发生器不会产生具有如此多可能性的模拟信号。这种随机发生器的两个缺点是,它只能在每个音乐唱片播放完毕并取走后才会改变信号,并且这可能造价高昂。
模拟输出随机发生器
Analog 2-RNG
- 1×3×2(体积为6方块)、1方块宽、单片、无声
- 电路延迟:3刻(上升沿)和1刻(下降沿)
开启时输出信号强度为1或3,关闭时输出信号强度0。
当输入打开时,投掷器将随机选择可堆叠或不可堆叠的物品放进漏斗,导致比较器输出1或3信号强度。因为充能的投掷器是一个实心/不透明方块,它也会锁住漏斗,防止它将物品送回投掷器,直到输入关闭。
- 输出信号强度可以按原样使用(例如,在减法模式下从比较器中减去1或3),但更常用的是,把输出连接到一行两个的红石粉,以使输出为0或非0(随机为中继器充能,激活机器组件等)。
变种:如果投掷器是间接激活的(例如,通过准连接性或相邻的充能方块),则不会锁住漏斗,并且漏斗会立即将物品推回投掷器中。这将使电路变成一个单稳态上升沿探测器,输出脉冲为3.5刻(仍具有1或3的随机信号强度)。
在投掷器中只有两个物品的情况下,两个信号强度的输出概率相等。输出信号强度的概率可以通过向投掷器添加额外的可堆叠和不可堆叠物品来改变(这些物品必须彼此不同,以便它们不会堆叠)。例如,对于两个不同的可堆叠物品和三个不同的不可堆叠物品,随机发生器将在40%的时间内输出1信号强度,在60%的时间内输出3信号强度。
已知最早发布日期:2013年3月14日[1]
Analog 3-RNG
→
|
→
| |||
- 1×3×3(体积为9方块)、1方块宽、无声
- 电路延迟:3刻(上升沿)和1刻(下降沿)
- 开启时输出信号强度为1、2或4,关闭时输出信号强度(但请参阅下面的变种)。
- 在建立此电路时,等待漏斗被充能的红石粉锁住,然后将五个堆叠上限为16的物品放入其最右侧的槽位中。然后将一个堆叠上限为64的物品,一个堆叠上限为16的物品,和一个不可堆叠物品放入投掷器。
- 输入开启之前,漏斗的5个堆叠上限为16的物品足以使其比较器产生1级信号强度(即使是单个堆叠上限为64的物品也可以)。这五个物品应永远无法回到投掷器,所以比较器的输出将永远不会低于1。
- 当输入开启时,投掷器将一个物品送入漏斗,将其放置在漏斗的左槽中。需要23个堆叠上限为64的物品(或5个堆叠上限为16的物品和3个堆叠上限为64的物品,或6个堆叠上限为16的物品)才能产生2级信号强度,因此,如果堆叠上限为64的物品被送入,则不足以增加输出信号强度,但如果堆叠上限为16的物品被送入,则输出信号强度将增加到2级。如果不可堆叠的物品被送入,输出信号强度将增加到4。
- 当电路关闭时,漏斗由充能的红石粉锁住,当电路开启时,由充能的投掷器锁住。但是,当输入关闭时,投掷器刚关闭的瞬间会有一个短暂的1刻间隙,但是放置其上的火把没有再次点亮。这允许漏斗激活一刻,将一个物品送回投掷器。漏斗总是先从左边的槽中送出物品,因此漏斗会将投掷器送入的物品送回,而不是最右边槽中的堆叠上限为16的物品中的任何一个,这样电路就可以自行复位。
- 变种:玩家可以从投掷器中移除其中一个物品来创建一个2-RNG,其输出信号强度不同于常规的2-RNG:移除堆叠上限为64的物品对应输出信号强度为2或4,移除堆叠上限为16的物品输出信号强度为1或4,移除不可堆叠物品输出信号强度为1或2。
- You can add additional redstone dust leading from the hopper to a block next to it, and then down to the side of the comparator. This 2-wide variation will keep the comparator's output off while the input is off.
- With only three items in the dropper, all three output power levels will be chosen with equal probability. The probability of the output levels can be changed by adding additional 64-stackable, 16-stackable, and non-stackable items to the dropper (which must all be different from each other so they won't stack). For example, with one 64-stackable item, one 16-stackable item, and two different non-stackable items, the RNG will output power level 1 25% of the time, power level 2 25% of the time, and power level 4 50% of the time.
- Additional items can be added to the hopper to increase all of the output power levels.
- Earliest Known Publication: 16 April 2013[2]
Analog 16-RNG
- 5×8×4 (160 block volume)
- circuit delay: 8.5 ticks
- Outputs power levels 0 to 15 while on, power level 0 while off.
- Uses four 2-RNGs to subtract 1, 2, 4, and/or 8 from 15.
- Reducing the number of 2-RNGs reduces the possible outputs: three 2-RNGs produces an 8-RNG, and two 2-RNGs produces a 4-RNG (the exact power levels depend on the power level provided to the subtraction comparators).
- Earliest Known Publication: June 10, 2013[3]
Schematic: Analog 16-RNG
参见:Mechanics/Redstone/Miscellaneous circuits/analog 16-rng [编辑]
命令随机发生器
基于随机刻
This randomizer uses a repeating command block adding 1 point to a score per tick, then another repeating command block truncating the value to its maximum. When a random value is needed, repeating command blocks testing for certain values are used. This setup is not completely random as it is based on the time is is activated, but is random enough for most purposes.
In this example, the minimum value is 10 and the maximum is 20.
To start, a dummy scoreboard objective must be created to store the values: /scoreboard objectives add randomizer dummy. Next, two repeating command blocks are needed, both set to "always active". The first one adds 1 point to the score every tick: /scoreboard players add ticks randomizer 1. The second one truncates the value to the aforementioned minimum and maximum: /execute if score ticks randomizer matches 21.. run scoreboard players set ticks randomizer 10 (where "21" is the maximum exclusive value and "10" is the minumum value). Finally, a set of command blocks testing each value are needed, all attached to the single input; for example, /execute if score ticks randomizer matches 2 run say hi will run /say hi (placing [@] hi in chat) if the random value between 10 and 20 is 2. The following schematic shows an example setup where the command blocks testing each value are attached to an input:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- ↑ "HiFolksImAdam" (14 March 2013). "Minecraft 1.5 Tutorial: Simple Random Number Generator!" (Video) – YouTube.
- ↑ "Kwin van der Veen" (April 16, 2013). "Video response: Sharing is Caring #010: 1 Bit Randomizer & Silent BUD " (Video). YouTube.
- ↑ "Entity" (June 10, 2013). "Calling All Redstone Geniuses, I need Help. - advanced randomizer." – Minecraft Forum