Maxlego08 / zMenu

A plugin that will allow the creation of menu for minecraft, has a complete API for developers
GNU General Public License v3.0
60 stars 10 forks source link

Open menu with item #29

Closed EnzoShoes closed 10 months ago

EnzoShoes commented 10 months ago

Add possibility to open menu with item #28.

1464005696 commented 10 months ago

Thanks for update it!

lijinhong11 commented 10 months ago

this is pretty cool

Maxlego08 commented 10 months ago

Thank you for your PR, I have two changes:

  1. In your class OpenWithItem dont use an ItemStack but instead use a MenuItemStack
  2. You should create a verification enum, if use whant to check only the material, name, lore, model id or use the method isSimilar from ItemStack

If you have time to do it would be great, otherwise I could make myself

EnzoShoes commented 10 months ago

Can I try to finish using what you made or are you working on it ?

Maxlego08 commented 10 months ago

you can continue

EnzoShoes commented 10 months ago

Is this what you had in mind for the enum ?

Maxlego08 commented 10 months ago

I’ll take care of the rest, thank you !

Maxlego08 commented 10 months ago

Here is the final rendering of the configuration

# Open this menu by clicking a specific item
#
openWithItem:
  # Define the item that will be clicked
  item:
    material: clock
  # Look at https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/block/Action.html
  actions:
    - LEFT_CLICK_BLOCK
    - LEFT_CLICK_AIR
  # Définissez ensuite le type de vérification.
  # Depending on your configuration and need you will define a certain type of verification. Here are all the types that exist:
  # - full -> Allows to check the itemStack in full, will use the ItemStack#isSimilar method.
  # - material -> Allows to check only the material
  # - name -> Allows to check only the display name
  # - lore -> Allows to check only the lore
  # - modelid -> Allows to check only the Custom Model Id
  type: material