Ssomar Plugins
🛒 Purchase📢 Discord❤️ Donate
  • Tools for all Plugins [Score]
    • 📚Custom Commands
      • Player & Target Commands
      • Mixed Commands (Player & Entity)
      • Entity Commands
      • Block Commands
      • Item Commands
      • Utility Commands
    • 📚Custom Conditions
      • Player & Target Conditions
      • Entity Conditions
      • Block Conditions
      • World Conditions
      • Item Conditions
      • Placeholder Conditions
      • Custom EI Conditions
    • 🏹Custom Projectiles
    • 📚Placeholders
    • ✨ Score particles
    • 🧮 Score Variables
    • ✔️Compatible Plugins
    • 🤖General Questions | Guides
      • Technical-Level Info
      • SCore
      • Math Formulas
      • Utilities
        • Code Bin/Stock
    • 📰 Score
      • General config
      • Commands
    • 🔘 Custom triggers
  • ExecutableItems
    • 📌Information EI
    • 📃Configurations
      • General Configuration
      • Item Configuration
        • Item Features
        • Item Restrictions/Resistances
      • Activator Configuration
        • List of the Activators
        • Activators features
    • ⌨️Commands & Permissions
    • 🤖Questions | Guides
      • Frequently Asked Questions
        • Free vs Premium
        • Install/update/errors
          • How to install correctly
          • How to update correctly
          • Installation errors [logs]
          • Plugin doesn't work 😡😡
          • command /ei doesn't work
          • Just installed the plugin and have errors on my logs
        • Players can't use the items
        • Basic tutorials
        • Item disappears | Limit
        • EI COMMANDS doesn't work
        • How to use vanilla commands
        • Server chat spamming
        • Custom crafting
        • Folders on /ei show
        • Item as player head
        • Armor trims
        • Attributes not working
        • How to duplicate an EI Item
        • How to change particle vanilla command color
        • Edit plugin messages
        • Item Textures
        • I want to give an item on join
        • Issue with written book
        • How to add custom NBTTag
        • HEX COLORS doesn't work
        • HUGE delay | cooldown | command time
        • Trident duplication
        • Custom name feature is not working
        • Score database large
        • PROJECTILE_HIT_... activators not working
        • Not so frequentlly asked questions
      • Items explanations
        • Item ideas - How to create...?
        • Hight-Powered Grappling Hook
        • Morph Tools
        • Delayed Teleport Towards Saved Location
        • Box of ender pearls
        • Swap position
        • Magnet
        • Item frame visibility toggler
        • Hermes boots
        • EI |WorldEdit -> SET COMMAND
        • Bag of items
        • Infinite rockets
        • Trident that works when not raining
        • [Complex] Moving Particle Projectile
      • Methods | Template
        • Multiple projectiles on one item
        • Custom drops
        • Deal % of entity HP
        • Variable conditions
        • Armor Set Bonus
        • Custom durability
          • Custom durability bar
        • Action Counter
        • On / Off Switch
        • Custom food
        • Raycast
        • Random activators selector
        • Break blocks not depending on item
        • Infinite | finite blocks
        • Damage | Hit features
        • Backstab
        • Item date on lore
        • Entity health condition
        • Dashes | Commands & usage
        • Guns
        • RNG Chance activator
        • Only usable on mainhand
        • Transform Vanilla Items into ExecutableItems
        • Insta pickup
        • Epic particles
        • Custom totems
        • One Time Loop
        • OneTime action
        • MINEINCUBE command whitelist or blacklist blocks
        • Cancel a delayed command
        • Worldedit schematic
        • Condition 1 between 5 different armor pieces
        • Creating Items with multiple activators with varying conditions while having only one error message
        • [Free version] Mana Requirement
        • Setting Up a System that runs the auto update feature once per update
        • [Outdated] Global Cooldown
      • Custom projectiles implementation
        • Projectile ideas - How to create...?
        • Creating a basic projectile
        • Launch Arrows in cone
        • Launch Diamond Axe
        • Custom Actions / Damages per projectiles
      • Custom textures
        • Custom textures [1.21 --]
          • General items
          • Per states texture
          • Custom armor (using armor trims)
          • Animated textures
          • 3D Models
          • Uploading texture pack
          • Fixing Invalid PNG Files
        • Custom texture [1.21+]
      • Custom sounds
      • Informal Guides
      • Plugin performances optimization
    • 🔦MC Versions Compatibility
    • ⚙️Developer API
  • ExecutableBlocks
    • 📌Information EB
    • 📃Configurations
      • General Configuration
      • Block Configuration
        • Block Features
        • Blocks Examples
      • Activator Configuration
        • List of the Activators
        • Activators features
        • Activator Examples
    • ⌨️Commands & Permissions
    • 🤖Question | Guides
      • Frequently Asked Questions
        • Free vs Premium
        • Install/update/errors
          • How to install correctly
          • How to update correctly
          • Installation errors [logs]
          • Plugin doesn't work 😡😡
        • Players can't use the blocks
        • Block disappears | Limit
        • How to use vanilla commands
        • Server chat spamming
        • Custom crafting
        • Block as player head
        • Tutorial
        • Block states
        • Block Textures
        • My condition is checking the owner
        • SETEXECUTABLEBLOCK does not work
        • Holograms won't vanish
      • Tutorials
        • Boss summoner
        • Item generator
        • Custom crops
        • Custom TNT
        • Block that generate a structure
      • Methods
        • Timed actions
        • Worldedit schematic
    • ⚙️Developer API
  • ExecutableEvents
    • 📌Information EE
    • 📃Configurations
      • General Configuration
      • Activator Configuration
        • List of the Activators
        • Activators features
    • 🤖Question | Guides
      • Informal Guides
      • Frequently Asked Questions
        • Install/update/errors
          • How to install correctly
          • How to update correctly
          • Installation errors [logs]
          • Plugin doesn't work 😡😡
        • How to use vanilla commands
        • Server chat spamming
      • Tutorials
        • Toggle System/Command with Godmode
        • Custom enchants by lore
        • Give new/old players an item once
        • Run commands after killing x amount of mobs
        • Detect player entry/leave from a worldguard region
    • ⌨️Commands & Permissions
  • MyFurniture
    • 📌Information MF
    • 📃Configurations
      • General Configuration
      • Furniture Configuration
        • Furniture Features
        • Furntiture Examples
      • Activator Configuration
        • List of the Activators
        • Activators features
    • 🤖Question | Guides
      • Frequently Asked Questions
        • Install/update/errors
          • How to install correctly
          • How to update correctly
          • Installation errors [logs]
          • Plugin doesn't work 😡😡
        • Import your own Furniture
        • How to use vanilla commands
        • Server chat spamming
        • Free vs Premium
    • ⌨️Commands & Permissions
  • ExecutableCrafting
    • 📌Information EC
    • 📃Configurations
      • General Configuration
      • Recipe Configuration
        • Recipe Features
        • Crafting Recipe Examples
      • Recipe groups
      • Recipe Book
    • 🤖Questions | Guides
      • Free vs Premium
      • Install/update/errors
        • How to install correctly
        • How to update correctly
    • ⌨️Commands & Permissions
  • AI Chat Moderation
    • 📌Information ACM
    • 📃Configurations
    • ⌨️Commands & Permissions
  • CustomPiglinsTrades
    • 📌Information CPT
    • ⌨️Commands & Permissions
    • ✔️Compatible Plugins
  • ScreenShop
    • 📌Information ScreenShop
  • TEAM AND DONATIONS
    • 🎆Contact / Support us ?
Powered by GitBook
On this page
  • Let's create the item + method
  • Long explanation
  • Create the variable
  • First Activator
  • Second activator
  • Drop activator
  • Testing the item
Edit on GitHub
  1. ExecutableItems
  2. Questions | Guides
  3. Methods | Template

One Time Loop

There are many things that can be done using this, if you are on need of it, this is the correct place to know how it works.

In this case we are going to make an item that will add a value on scoreboard if in hand and will remove it when deselect it

A first idea would be working with SELECT_THE_EI and DESELECT_THE_EI but it has problems related to what we want to do, because the player can move the item instead of deselecting it.

Let's create the item + method

  • First let's create the item with /ei create <id>

  • Set the material, name, and everything

  • Now, let's take a look at the method, it will consist on 2 loop activators, one in mainhand and the another one in all slots except mainhand, and, variables, that will disable the loop once it works one time + a PLAYER_DROP_THE_EI to also reduce the scoreboard value when the player drops the item, so it would look like this:

First, we will create a variable
Variable -> "scoreboard" - String

#First loop that will add the value to the player
Activator 1: LOOP 
Slot: MAINHAND
Commands: scoreboard players add %player% <scoreboardname> <value>
#Now the placeholder condition that will make this loop to work ONLY 1 time
Condition: PlaceholderCondition "%var_scoreboard" EQUALS "no"
variable update: "scoreboard" SET "yes"

#second loop that will remove the value to the player
Activator 2: LOOP
Slot: EVERYSLOT EXCEPT MAINHAND
Commands: scoreboard players remove %player% <scoreboardname> <value>
#Now the placeholder condition that will make this loop to work ONLY 1 time
Condition: 
- PlaceholderCondition "%var_scoreboard" EQUALS "yes"
- IfNotHasExecutableItem -> the EI itself + mainhand
variable update: "scoreboard" SET "no"

#activator that will remove the value to the player if he drops it
Activator 3: PLAYER_DROP_THE_EI
Commands: scoreboard players remove %player% <scoreboardname> <value>
#Now the placeholder condition that will make this loop to work ONLY 1 time
Condition: PlaceholderCondition "%var_scoreboard" EQUALS "yes"
variable update: "scoreboard" SET "no"

With this explanation should be enough, anyways, if you don't understand, we will make everything step by step

Long explanation

Create the variable

  • Variable name: scoreboard

  • Type: STRING

  • String value: "no"

  • Then save and let's go to the next step

First Activator

  • detailedSlots only mainhand

  • Variable update

  • And this will only work if the variable is "no", so let's create a placeholder condition

  • And the last thing the command to add a scoreboard value to the player, in this case I will only add a command "say ADDED" as a debug command.

Second activator

Its the same idea, so this will be faster than the previous one.

  • Working on every slot except mainhand

  • Variable update

  • Placeholder condition:

  • The second placeholder, that is a playerCondition (and the condition is on the 2nd page)

  • In this case the name of my item is asd

  • Then save and delete the error message, it is annoying

  • And the command

Drop activator

  • Add another activator

  • Placeholder condition to make it only work if the value is already added

  • The command

  • And the variable update

And that's it, save everything and test

Testing the item

PreviousCustom totemsNextOneTime action

Last updated 2 years ago

🤖