Files
Construct-CN/Construct [BP]/scripts/options/materialGrabber.js
T
2025-04-20 02:06:55 -07:00

19 lines
815 B
JavaScript

import { BuilderOption } from '../classes/Builder/BuilderOption';
import { world } from '@minecraft/server';
const builderOption = new BuilderOption({
identifier: 'materialGrabber',
displayName: 'Material Grabber',
description: 'Pulls structure items from inventories.',
howToUse: "Interact with inventories using a paper named 'Material Grabber' to pull structure items from them.",
});
world.beforeEvents.playerInteractWithBlock.subscribe(onPlayerInteract);
world.beforeEvents.playerInteractWithEntity.subscribe(onPlayerInteract);
function onPlayerInteract(event) {
// get inventory
// analyze active structure items if not analyzed -- there needs to be a way to refresh this that is efficient
// find items in inventory that match items in structure
// transfer to player
}