MCPcopy
hub / github.com/PrismarineJS/mineflayer / getRandomStackableItem

Function getRandomStackableItem

test/externalTests/useChests.js:136–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134 }
135
136 function getRandomStackableItem () {
137 if (Math.random() < 0.75) {
138 return itemsWithStackSize[64][~~(Math.random() * itemsWithStackSize[64].length)]
139 } else {
140 if (Math.random() < 0.5) {
141 return itemsWithStackSize[16][~~(Math.random() * itemsWithStackSize[16].length)]
142 } else {
143 return itemsWithStackSize[1][~~(Math.random() * itemsWithStackSize[1].length)]
144 }
145 }
146 }
147
148 async function createRandomLayout (window, slotPopulationFactor) {
149 await bot.test.becomeCreative()

Callers 1

createRandomLayoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…