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
  • Variables
  • Activators
  • ACTIVATOR RIGHT CLICK
  • ACTIVATOR LEFT CLICK
  • ACTIVATOR RIGHT CLICK
  • ACTIVATOR RIGHT CLICK
  • Final words
Edit on GitHub
  1. ExecutableItems
  2. Questions | Guides
  3. Items explanations

EI |WorldEdit -> SET COMMAND

PreviousHermes bootsNextBag of items

Last updated 2 years ago

This is not an easy item, so you may require a little of knowledge how the plugin works to achieve this. This is a guide, "where to search this" "what this means" won't be answered here, BUT we'll leave everything for you to understand or to go to read what "x" means.

REQUIRES

PLACEHOLDERAPI

CHECKITEM EXPANSION

STRING EXPANSION

MATH EXPANSION

PLAYER EXPANSION PREVIOUS KNOWLEDGE ABOUT EI.

Variables

Well, let's start, first, world edit works marking 2 blocks, we have to do the same from EI, to do this we will store the coordinate of the blocks in variables.

  • x1

  • y1

  • z1

  • x2

  • y2

  • z2

And, since the idea is to use this item as survival, the SET command will only work if the player has enough of "material" to achieve the SET command. This means, we need to take how many blocks there are on the selection and how many blocks the player has, to achieve this you can avoid using variables, but I will use them. You can change the method if you want, there are many ways to achieve the same.

  • amountofsetcommand

  • amountofmaterial

Activators

We have 8 variables, let's create the activators

ACTIVATOR RIGHT CLICK

detailedClick -> ONLY_BLOCK
cancelEvent: true

This will set the variables (1) to the block selected

  • x1 -> %block_x_int%

  • y1 ->%block_y_int%

  • z1 -> %block_z_int%

Now we are storing one block, let's do the same for the another one but with another activator

ACTIVATOR LEFT CLICK

detailedClick -> ONLY_BLOCK
cancelEvent: true

This will set the variables (2) to the block selected doing the same as before but with x2,y2 and z2.

Well ! We have the blocks saved, now the "complex" part, because what we have done is very simple.

How to get the amount of blocks needed to run the set command and the amount of material the player has

    • %checkitem_amount_mat:MMMMMMMMMMMH%

      • %checkitem_amount_mat:{player_item_in_hand}%

  • Well, one ready, now let's get the amount of materials the player needs to run the SET command. Let's think the player selects a cube, for better understanding I will draw (not the best, just to understand it better)

  • As you can see, the selections are

    • FIRST: 0,0,0

    • SECOND: 1,2,2

  • To take the amount of blocks would be decreasing each position by the another one, it would look like this

    • 1-0 = 1

    • 2-0 = 2

    • 2-0 = 2

  • This will mean the shape has 1*2*2 blocks = 4, but it doesn't have 4, it has 18, what happened here ?

    • Well, as we can see in the first substraction, 1-0 = 1, but it doesn't have 1 of x, the shape has 2 on x, this means there is one "+1" missing, let's check the anothers. 2-0 = 2, but on y we have 3, so another +1 is missing, and the same for z, so we have to add +1 to each substraction, something like

      • (1-0)+1

      • (2-0)+1

      • (2-0)+1

    • This will give us that the shape has 2,3,3 , that would mean 2*3*3 = 18, perfect ! it now returns the correct amount of blocks, BUT, we have a problem, what if the player doesn't select as FIRST 0,0,0 but 1,2,2 , we would have

      • FIRST 1,2,2

      • SECOND 0,0,0

    • This means, when taking the value of blocks needed:

      • (0-1)+1

      • (0-2)+1

      • (0-2)+1

    • This return us 0,-1,-1 that doesn't make sense, a shape can't have negative values as size, so, to make BOTH ways to return the same, we need the absolute value of the substraction, it would look like

      • ABS(0-1)+1

      • ABS(0-2)+1

      • ABS(0-2)+1

%math_0_((ABS(%var_x1%-%var_x2%)+1)*(ABS(%var_y1%-%var_y2%)+1)*(ABS(%var_z1%-%var_z2%)+1))%

Now we have the 2 values needed, we have to add them into a variablemodification, so let's create an activator, this will be the one of HOW THE PLAYER WILL TRIGGER THE SET, in this case, RIGHT CLICK+SHIFT

ACTIVATOR RIGHT CLICK

condition ifShifting -> true

Here add all variable modifications to amountofmaterial and amountofsetcommand

Now, let's build what we want, the SET command

As a summarize, the 2 first activators are for storing the coordinates of the block, the 3rd to get the values of howmanyblocksdowehave and howmanyblocksdoweneedtorunthesetcommand

ACTIVATOR RIGHT CLICK

condition ifShifting -> true

This activator must be same as the 3rd

  • Now, here we will have the commands, we will use the vanilla fill command

    • execute at %player% run fill x1 y1 z1 x2 y2 z2 material

      • x1 y2 z1 will be replace with %var_x1% %var_y1% and %var_z1% and the same idea with x2,y2 and z2

      • and material, we will get the material on the hand of the player -> %player_item_in_hand%

  • And let's clear the material of the player

    • execute run clear %player% %string_lowercase_{player_item_in_hand}% %var_amountofsetcommand_int% <-the amount to clear

  • We are ready, BUT, this command can be run always, we have to make the condition that

    • MATERIALWEHAVE > MATERIALWENEED

      • Just use the variables we have already stored, called as "amountofmaterial" and "amountofsetcommand" to do this comparison on a placeholderCondition, PLAYER_NUMBER.

And we are ready !!!

Final words

  • To make the activator only work with certain materials, set the 4th activator a condition of ifPlayerHasItem -> detailedSlots: mainhand -> and select all your materials, this will work as a WHITELIST

  • If want to restrict the player to don't create shapes that have blocks more than "x" just add a placeholderCondition on the 4th activator

  • If you are experienced enough, this item is 4/10 level, this means, you can replicate //walls , //replace , //replacenear and more commands from WorldEdit to be used as players on survival.

Hope you understood everything, if have any question feel free to ask, BUT, be careful, again, if you have 0 experience, this may be confusing and we will lead you to a basic tutorial, step by step young padawan

First, the easy one, to get the amount of material we can use . From there we can take the amount of material the player has in their hand

MMMMMMMMMMMH is the material, to get the material on the HAND we will use .

Having as result (1+1),(2+1),(2+1) => 2,3,3 => 2*3*3 = 18, nice ! we got this, now instead of using the coordinates as 0,0,0 and 1,2,2 we will use the variable coordinates we stored before, and multiply them using

BUT, WE HAVE A PROBLEM that placeholder returns the material in UPPERCASES, so we need it to cast on lowercase using -> %string_lowercase_{player_item_in_hand}%

🤖
checkitem expansion
player expansion
Math expansion
String expansion