promotional bannermobile promotional banner

Replaceitem X2

A more Powerful /replaceitem
it replaces items in inventorys/containers with more passion then normal /replaceitem
1. The Command Syntax
 
text
/scriptevent my:replaceitem <newItem> <slot> <target> <location> <amount|objective> [Properties]
 
2. Argument Guide
  • <newItem>: The item you want to give (e.g., minecraft:diamond).
  • <slot>: The slot index (0 is the first slot).
  • <target>: The script checks this slot first. It only replaces the item if the slot contains this target (use air if the slot must be empty).
  • <location>:
    • Use player to target your own inventory.
    • Use x,y,z (e.g., 10,64,10) to target a chest or barrel.
  • <amount|objective>:
    • A number: 64
    • A scoreboard name: money (the script will give items equal to your score).
    • none: Defaults to 1.
  • [Properties]: Optional custom data separated by pipes (|).
    • Format: Name | Lore | Keep | Lock | Place | Destroy | Enchants
 

 
3. Usage Examples
 
A. Basic Swap (Empty Slot Only)
Place a torch in slot 0 of a chest at 10, 64, 10, but only if the slot is empty:
/scriptevent my:replaceitem minecraft:torch 0 air 10,64,10 1
 
B. Upgrade System (Targeted Replace)
Turn a player's wooden_sword in slot 0 into a stone_sword:
/scriptevent my:replaceitem minecraft:stone_sword 0 minecraft:wooden_sword player 1
 
C. Scoreboard Shop (Dynamic Amount)
Give the player a number of gold ingots equal to their "gold_balance" score:
/scriptevent my:replaceitem minecraft:gold_ingot 0 air player gold_balance
 
D. Advanced Item (Using Properties)
Replace an empty slot with a named, enchanted sword. Note the pipes | used to skip empty sections:
/scriptevent my:replaceitem minecraft:iron_sword 0 air player 1 "Hero Sword" | "Legacy Blade" | true | none | none | none | sharpness:3
 

 
4. Special Logic Features
  1. Stacking: If the slot already contains the <newItem>, the script won't replace it; it will simply add the amount to the existing stack (up to 64).
  2. Coordinates: When using coordinates, don't use spaces between the numbers (use 10,64,10 not 10, 64, 10).
  3. Safety: If the <target> doesn't match what is currently in the slot, the script does nothing. This prevents accidentally deleting a player's valuable items.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

 

 

 
 

The Replaceitem X2 Team

profile avatar
  • 9
    Projects
  • 74
    Downloads

More from cript0pandaView all

  • Container Lootpool Generator project image

    Container Lootpool Generator

    • 5
    • Scripts

    generate lootpools with container & scriptevents

    • 5
    • May 5, 2026
    • Scripts
    • +1
  • Floating Text project image

    Floating Text

    • 10
    • Scripts

    Floating Text That Just Doesnt Die unless Use /remove[edu edition] or (nametager has a remove feature one of my other packs)

    • 10
    • May 5, 2026
    • Scripts
    • +1
  • Scoreboard Display Tool project image

    Scoreboard Display Tool

    • 4
    • Scripts

    /scriptevent my:db <source> <target> <range> puts people or fakeplayers on diffent scoreboards based on score

    • 4
    • May 5, 2026
    • Scripts
    • +1
  • Counter project image

    Counter

    • 7
    • Scripts

    Counts Container/or inventory Contents

    • 7
    • May 5, 2026
    • Scripts
    • +1
  • Container Lootpool Generator project image

    Container Lootpool Generator

    • 5
    • Scripts

    generate lootpools with container & scriptevents

    • 5
    • May 5, 2026
    • Scripts
    • +1
  • Floating Text project image

    Floating Text

    • 10
    • Scripts

    Floating Text That Just Doesnt Die unless Use /remove[edu edition] or (nametager has a remove feature one of my other packs)

    • 10
    • May 5, 2026
    • Scripts
    • +1
  • Scoreboard Display Tool project image

    Scoreboard Display Tool

    • 4
    • Scripts

    /scriptevent my:db <source> <target> <range> puts people or fakeplayers on diffent scoreboards based on score

    • 4
    • May 5, 2026
    • Scripts
    • +1
  • Counter project image

    Counter

    • 7
    • Scripts

    Counts Container/or inventory Contents

    • 7
    • May 5, 2026
    • Scripts
    • +1