BlockEvents.rightClicked(event => {
  const { player, block, item } = event;

  if (!player.hasEffect("moderninhibited:inhibited")) return;

  const blockId = block.id;
  const itemId = item.id;

  const blockedItemsAndBlocks = [
    "minecraft:chiseled_bookshelf",
    "supplementaries:book_pile",
    "supplementaries:book_pile_horizontal",
    "minecraft:spruce_trapdoor",
    "minecraft:dark_oak_trapdoor",
    "minecraft:tnt"
  ];

  if (blockedItemsAndBlocks.includes(blockId) || blockedItemsAndBlocks.includes(itemId)) {
    event.cancel();
  }
});

ItemEvents.rightClicked(event => {
  const { player, item } = event;

  if (!player.hasEffect("moderninhibited:inhibited")) return;
  const itemId = item.id;

  const blockedItems = [
    "spelunkery:mineomite"
  ];

  if (blockedItems.includes(itemId)) {
    event.cancel();
  }
});
