#What is a ''hybrid parent''?

6 messages · Page 1 of 1 (latest)

sharp root
#

I think it is an action that you can click on but also opens like a parent. I however do not know how to create

hushed sinew
#

You can achieve this by defining a menu entry with both a click() event and a children: [] list

sharp root
#

Hmmm, doesn't seem to be working for me

#

I don't know if I did it correctly

#

My code looks like this:

  name: "Hybrid Parent",
  icon: "person",
  click: () => {
    Blockbench.showQuickMessage("You clicked on a hybrid parent!");
  },
  children: [
    new Action("hybrid_parent_child_test", {
      name: "thing inside",
      icon: "directions_walk",
      click: () => {
        Blockbench.showQuickMessage("Item inside a hybrid parent");
      },
    }),
  ],
});```
hushed sinew
#

Yeah this is for menu items, not for actions.
However since 4.4 you can also achieve a similar result using side menus. Example from the plugin store action:

    new Action('plugins_window', {
        icon: 'extension',
        category: 'blockbench',
        side_menu: new Menu('plugins_window', [
            'load_plugin',
            'load_plugin_from_url'
        ]),
        click(e) {
            Plugins.dialog.show();
        }
    })