setLayer form and make easyPlace rules require paper named "easyPlace"

This commit is contained in:
ForestOfLight
2025-04-12 20:56:24 -07:00
Unverified
parent 8da6474b38
commit 6ced22b57b
8 changed files with 48 additions and 34 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ import { Raycaster } from '../classes/Raycaster';
let runner = void 0;
const easyPlace = new Rule({
identifier: 'fastEasyPlace',
description: { text: 'Looking at structure blocks with paper in your hand will place them.' },
description: { text: "Looking at structure blocks with paper named 'easyPlace' in your hand will place them." },
onEnableCallback: () => { runner = system.runInterval(onTick, 2); },
onDisableCallback: () => { system.clearRun(runner); }
})
@@ -35,7 +35,7 @@ function isHoldingActionItem(player) {
const mainhandItemStack = player.getComponent(EntityComponentTypes.Equippable).getEquipment(EquipmentSlot.Mainhand);
if (!mainhandItemStack)
return false;
return mainhandItemStack.typeId === 'minecraft:paper';
return mainhandItemStack.typeId === 'minecraft:paper' && mainhandItemStack.nameTag === 'easyPlace';
}
function tryPlaceBlock(player, worldBlock, structureBlock) {