Extra Requirements

If you want so, you can add non-item requirements to craft an item. For example; player levels, being on a certain world, gamemode, etc. For this option to work you need PlaceholderAPI since the conditions require variables.

Extra Requirements Conditions

A condition has the following format: <variable> <conditional> <value> Example: %player_level% >= 15

The previous example will check if the player is level 15 or more, if so then the item could be crafted.

extra_requirements:
  conditions:
  - "%player_level% >= 15"     
  - "%player_gamemode% == SURVIVAL" 

You can also check for 'or' conditions, meaning that a condition line will be approved if one of many conditions in the same line is accomplished. For example, here there is just one condition. The player must be level 20 or greater, OR the player must be op.

extra_requirements:
  conditions:
  - "%player_level% >= 20 or %player_is_op% == yes" 

Remember to download the PlaceholderAPI expansion of variables you are using, with the following command: /papi ecloud download <expansion>

Type of Conditionals

For Text

  • equals, ==

  • !equals, !=

  • equalsIgnoreCase

  • !equalsIgnoreCase

  • startsWith

  • !startsWith

  • contains

  • !contains

For Numbers

  • equals, ==

  • !equals, !=

  • >=

  • <=

  • <

  • >

Extra Requirements Message

It is very important to also specify an extra requirements message, which will show in the click_to_craft custom item on the inventory.yml file. This message should tell the player what additional requirements are needed, you can customize it completely.

To show whether or not the player accomplishes a condition, you must use the %status_symbol_requirement_<value>% variable. This will be replaced with the symbol specified in the extraRequirementsMessageStatusSymbolTrue and extraRequirementsMessageStatusSymbolFalse messages on the messages.yml file.

You must replace <value> with the number of the condition. In the following example, the %status_symbol_requirement_1% will be replaced with a ✔ if the player is level 15 or greater, and with a ✖ if not.

extra_requirements:
  conditions:
  - "%player_level% >= 15"     
  - "%player_gamemode% == SURVIVAL"  
  message:
  - "&8Extra Requirements:"
  - "&6You need to be level 15 to craft this."
  - "&8Status: &7%player_level%&8/&715 %status_symbol_requirement_1%"
  - ""
  - "&6You need to be on survival."
  - "&8Status: &7%player_gamemode% %status_symbol_requirement_2%"

Last updated