BlockEvents.rightClicked('minecraft:end_portal_frame', event => {
  if (event.item && event.item.id === 'minecraft:ender_eye') {
    event.cancel(); // stops the insertion; Eye isn't consumed
    // (Optional) tell the player
    if (event.player && !event.player.isCreative()) {
      event.player.tell(Text.of('The End portal disabled. Find another way!').blue());
    }
  }
});