Jump to content

auto rename item on pickup


jacobisgodatmc

Recommended Posts

  • 1 year later...
1 hour ago, Clappy said:

on pickup:

   if event-item is diamond

set name of event-item to "HI"

 

Doesn't seem to work for me.

You could do something like this if the only way for players to get diamonds is by mining ore blocks, though it wouldn't update any diamonds already in a player's inventory, or crafted into diamond blocks and then reverted.

on break of diamond ore:
  #world is [name] (replace [name] with whatever world you want this to happen in, optional!
  cancel event
  set block to air
  chance of 100%:
    drop 1 diamond named "&eGold Ingot" at location of event-block

You can also do the following, so that any diamonds in a player's inventory get renamed when they close their inventory:

on inventory close:
  #world is [name] (replace [name] with whatever world you want this to happen in, optional!
  loop all items in the inventory of player:
    if loop-item is diamond:
      name of loop-item is not "&eGold Ingot":
        set name of loop-item to "&eGold Ingot"

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...