item name change

  • Thread starter Deleted member 9590
  • Start date
  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
D

Deleted member 9590

How would I check on item name change?

I tried this, but it doesn't work
Code:
on item name change:
 
if you want to know when an item was renamed using an Anvil
you can install Tuske, it has "anvil rename" event
 
if you want to know when an item was renamed using an Anvil
you can install Tuske, it has "anvil rename" event

But I also want to check if it is renamed using a crafting table.
Like putting to swords together, clears all lores ect.
[doublepost=1586939150,1586888712][/doublepost]bump
[doublepost=1587467222][/doublepost]can someone please reply??
 
But I also want to check if it is renamed using a crafting table.
Like putting to swords together, clears all lores ect.
[doublepost=1586939150,1586888712][/doublepost]bump
[doublepost=1587467222][/doublepost]can someone please reply??
I don't think if it is possible to get the items used while crafting an item through skript, but lets give this a try
skript has a "craft" event which includes 7 event values:
Code:
event-slot, event-world, event-player, event-item, event-inventoryaction, event-clicktype and event-inventory
the most important for us is the event-inventory, it's the inventory used by the player to craft an item in the "craft" event.
so basicly we will check for every item in that inventory and see if the item doesn't match the conditions to be renamed using a crafting table
here is how it looks like in code

Code:
on craft:
    type of event-inventory is workbench inventory
    loop all items of event-inventory:
        if loop-item's name is "hello":
            cancel event
I hope this was clear and helpful to you.
 
I don't think if it is possible to get the items used while crafting an item through skript, but lets give this a try
skript has a "craft" event which includes 7 event values:
Code:
event-slot, event-world, event-player, event-item, event-inventoryaction, event-clicktype and event-inventory
the most important for us is the event-inventory, it's the inventory used by the player to craft an item in the "craft" event.
so basicly we will check for every item in that inventory and see if the item doesn't match the conditions to be renamed using a crafting table
here is how it looks like in code

Code:
on craft:
    type of event-inventory is workbench inventory
    loop all items of event-inventory:
        if loop-item's name is "hello":
            cancel event
I hope this was clear and helpful to you.

Thanks, but how would I then do the same for crafting using the ingame 4by4 crafting table, that is in every player's inventory?
I tried
Code:
on craft:
    type of event-inventory is player inventory
    loop all items of event-inventory:
        if loop-item's name contains "vagt":
            cancel event

Code:
on craft:
    type of event-inventory is inventory
    loop all items of event-inventory:
        if loop-item's name contains "vagt":
            cancel event

but that didn't work (no erros, it just didn't detect it)
 
Thanks, but how would I then do the same for crafting using the ingame 4by4 crafting table, that is in every player's inventory?
I tried
Code:
on craft:
    type of event-inventory is player inventory
    loop all items of event-inventory:
        if loop-item's name contains "vagt":
            cancel event

Code:
on craft:
    type of event-inventory is inventory
    loop all items of event-inventory:
        if loop-item's name contains "vagt":
            cancel event

but that didn't work (no erros, it just didn't detect it)
You could just remove this line since you want to detect item name change in any crafting inventory
Code:
type of event-inventory is workbench inventory
 
Status
Not open for further replies.