Rename engine to cubi
This commit is contained in:
@@ -172,12 +172,12 @@ have a `push` too, see [Players](players.md#pushing).
|
||||
Minecraft's `getEntitiesOfClass`, only the ones of `type` when it's given. Players aren't among them, they're in
|
||||
`ctx.players`.
|
||||
|
||||
Items lying around are entities of type `bworld:item`. A machine that works on them, like a press, finds them, changes
|
||||
Items lying around are entities of type `cubi:item`. A machine that works on them, like a press, finds them, changes
|
||||
them with `set_item`, and adds what it made with `ctx.world.spawn_item`, which lays an item down still where it's put,
|
||||
unlike `drop_item`, which pops it out of a block:
|
||||
|
||||
```ts
|
||||
const [item] = ctx.world.entities_in({ x, y: y - 1, z }, { x: x + 1, y, z: z + 1 }, "bworld:item");
|
||||
const [item] = ctx.world.entities_in({ x, y: y - 1, z }, { x: x + 1, y, z: z + 1 }, "cubi:item");
|
||||
const stack = item?.get_item();
|
||||
if (stack?.id === "bworld:iron_ingot") {
|
||||
item.set_item(stack.count > 1 ? { ...stack, count: stack.count - 1 } : undefined);
|
||||
|
||||
Reference in New Issue
Block a user