#if player interacts with X block with Y item, Z block state is set

5 messages · Page 1 of 1 (latest)

paper shuttle
#

Looking for an example script for this if its possible to do with KubeJS as I cant find anything on the wiki. for example

            if(event.item.id == 'firmalife:jar/honey') {
            event.item.count--
            event.block.set('cobblemon:saccharine_log')```

Need the `event.block.set` to set the block to one of the pictured blockstates if possible :3 or all of them depending on the face of the block the player clicks
slow barnBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

paper shuttle
river whale
#
BlockEvents.rightClicked("cobblemon:saccharine_log", (event) => {
  const {
    item,
    block,
    block: { properties },
    facing,
  } = event;
  
  if (item.id == "firmalife:jar/honey") {
    item.count--;

    properties.put("facing", facing.toString());

    block.set("cobblemon:saccharine_log", properties);
  }
});

try this

paper shuttle