Creating Items with multiple activators with varying conditions while having only one error message
This page will help you create an item where you can set up lots of activators with multiple conditions or requirements and when used, only one sends commands and etc while having one error message
So one time, you want to create an item that would only activate if you have at least a diamond or an executable item in your inventory right? But you want to make a proper error message if you don't have the diamond or the executable item in your inventory. If so, this is the guide for you!
This guide should be of help in terms of expanding your competency in understanding how activators and variables work in a more deeper level.
Scroll down to the very bottom to copypaste the config of the item.
Steps:
1) Create an ExecutableItem
2) Create a variable
3) Save the variable and return to the main activator editor
4) Create an activator
5) Select what kind of activator do you want
In this guide, I will be using this activator.
In this method, all activators created during this method tutorial has to be the same for it to properly function.
6) Set the variable update at the first activator
Only this first activator will have the variable update in this whole method. What this does is that when you trigger the left click activator, it will set the variable to 1. This value will be used later.
The name of the variable we created is called "x" so we need to type "x" in here.
7) Create the main activators
The activators here are the ones that will run the commands and various things you want to try. Required Items, Required Money, Required ExecutableItems, Sneaking Conditions, etc. If you want to create more than one of those, start again from this step.
In this guide, I will follow the example I made. This item will search for a diamond or an executable item. But since orders matter, I will put diamonds as the priority.
Add the placeholder condition
We need to create a placeholder condition for each of the activators that will run commands and such for us. The first main activator won't need it so you can kind of skip this part but I will still write this part for the second and more activators
We need to type the placeholder of the variable so we could check for it's values to see if changes are made
The value of 1 represents that no activator before it has yet to trigger.
Add the variable update
With this set to 0, for example, activator1, activator2, and activator3 is present. activator0 will set the variable to 1 every time you do a left click and if activator1 manages to trigger, activator2 and activator3 will no longer trigger.
8) Create the activator that will return the error message
This activator will trigger if any of the previous activators that are supposed to set the variable to 0 once triggered.
Add the placeholder condition
We need to create a placeholder condition for each of the activators that will run commands and such for us. The first main activator won't need it so you can kind of skip this part but I will still write this part for the second and more activators
We need to type the placeholder of the variable so we could check for it's values to see if changes are made
The value of 1 represents that no activator before it has yet to trigger.
Add the SENDMESSAGE command for the error message
Because none of the main activators managed to run, the last activator will run instead, sending the message that you failed to meet the requirements/conditions to at least trigger one of the activators.
Save the item
Save the item then you could try it out!
Config:
name:'&eDefault name'lore:- '&b&oDefault lore'material:NETHERITE_SWORDglow:falsedisableStack:falsekeepItemOnDeath:falsecanBeUsedOnlyByTheOwner:falsestoreItemInfo:falseunbreakable:falseusage:1usageLimit:-1cancelEventIfNoPerm:falsecancelEventIfNotOwner:falsedisabledWorlds: []recognitions: []nbt:'0':key:Damagetype:INTvalue:0config_5:trueconfig_update:truedropOptions:glowDrop:falseglowDropColor:WHITEdisplayNameDrop:falsehiders:hideEnchantments:falsehideUnbreakable:falsehideAttributes:falsehidePotionEffects:falsehideUsage:truehideDye:falseenchantments: {}giveFirstJoin:giveFirstJoin:falsegiveFirstJoinAmount:1giveFirstJoinSlot:0restrictions: {}variables:var0:variableName:xtype:STRINGdefault:'0'activators:activator0:name:'&eActivator'option:PLAYER_LEFT_CLICKtypeTarget:NO_TYPE_TARGETusageModification:0cancelEvent:falsesilenceOutput:falseautoUpdateItem:falsecooldownOptions:cooldown:0isCooldownInTicks:falsecooldownMsg:'&cYou are in cooldown ! &7(&e%time_H%&6H &e%time_M%&6M &e%time_S%&6S&7)'displayCooldownMessage:truecancelEventIfInCooldown:falseglobalCooldownOptions:cooldown:0isCooldownInTicks:falsecooldownMsg:'&cYou are in cooldown ! &7(&e%time_H%&6H &e%time_M%&6M &e%time_S%&6S&7)'displayCooldownMessage:truecancelEventIfInCooldown:falseotherEICooldowns: {}requiredItems: {}requiredExecutableItems: {}detailedSlots: - -1commands: []playerConditions: {}worldConditions: {}itemConditions: {}customConditions: {}placeholdersConditions: {}variablesModification:varUpdt0:variableName:xtype:SETmodification:'1'activator1:name:'&eActivator'option:PLAYER_LEFT_CLICKtypeTarget:NO_TYPE_TARGETusageModification:0cancelEvent:falsesilenceOutput:falseautoUpdateItem:falsecooldownOptions:cooldown:0isCooldownInTicks:falsecooldownMsg:'&cYou are in cooldown ! &7(&e%time_H%&6H &e%time_M%&6M &e%time_S%&6S&7)'displayCooldownMessage:truecancelEventIfInCooldown:falseglobalCooldownOptions:cooldown:0isCooldownInTicks:falsecooldownMsg:'&cYou are in cooldown ! &7(&e%time_H%&6H &e%time_M%&6M &e%time_S%&6S&7)'displayCooldownMessage:truecancelEventIfInCooldown:falseotherEICooldowns: {}requiredItems:requiredItem0:material:DIAMONDamount:1notExecutableItem:trueerrorMessage:''requiredExecutableItems: {}detailedSlots: - -1commands: - SENDMESSAGE TEST MESSAGE 1playerConditions: {}worldConditions: {}itemConditions: {}customConditions: {}placeholdersConditions:plchCdt0:type:PLAYER_STRINGcomparator:EQUALSpart1:'%var_x%'part2:'1'cancelEventIfNotValid:falsemessageIfNotValid:''variablesModification:varUpdt0:variableName:xtype:SETmodification:'0'activator2:name:'&eActivator'option:PLAYER_LEFT_CLICKtypeTarget:NO_TYPE_TARGETusageModification:0cancelEvent:falsesilenceOutput:falseautoUpdateItem:falsecooldownOptions:cooldown:0isCooldownInTicks:falsecooldownMsg:'&cYou are in cooldown ! &7(&e%time_H%&6H &e%time_M%&6M &e%time_S%&6S&7)'displayCooldownMessage:truecancelEventIfInCooldown:falseglobalCooldownOptions:cooldown:0isCooldownInTicks:falsecooldownMsg:'&cYou are in cooldown ! &7(&e%time_H%&6H &e%time_M%&6M &e%time_S%&6S&7)'displayCooldownMessage:truecancelEventIfInCooldown:falseotherEICooldowns: {}requiredItems: {}requiredExecutableItems:requiredEI0:executableItem:buffamount:1errorMessage:''detailedSlots: - -1commands: - SENDMESSAGE TEST MESSAGE 2playerConditions: {}worldConditions: {}itemConditions: {}customConditions: {}placeholdersConditions:plchCdt0:type:PLAYER_STRINGcomparator:EQUALSpart1:'%var_x%'part2:'1'cancelEventIfNotValid:falsemessageIfNotValid:''variablesModification:varUpdt0:variableName:xtype:SETmodification:'0'activator3:name:'&eActivator'option:PLAYER_LEFT_CLICKtypeTarget:NO_TYPE_TARGETusageModification:0cancelEvent:falsesilenceOutput:falseautoUpdateItem:falsecooldownOptions:cooldown:0isCooldownInTicks:falsecooldownMsg:'&cYou are in cooldown ! &7(&e%time_H%&6H &e%time_M%&6M &e%time_S%&6S&7)'displayCooldownMessage:truecancelEventIfInCooldown:falseglobalCooldownOptions:cooldown:0isCooldownInTicks:falsecooldownMsg:'&cYou are in cooldown ! &7(&e%time_H%&6H &e%time_M%&6M &e%time_S%&6S&7)'displayCooldownMessage:truecancelEventIfInCooldown:falseotherEICooldowns: {}requiredItems: {}requiredExecutableItems: {}detailedSlots: - -1commands: - SENDMESSAGE §cYou don't have the required items.playerConditions: {}worldConditions: {}itemConditions: {}customConditions: {}placeholdersConditions:plchCdt0:type:PLAYER_STRINGcomparator:EQUALSpart1:'%var_x%'part2:'1'cancelEventIfNotValid:falsemessageIfNotValid:''variablesModification: {}attributes: {}