simple block event to inset renamed item on grindstone

  • 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 comminuty!

    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.

comonier

New Member
Jun 24, 2019
8
0
0
45
```
on rightclick holding diamond axe:
if name of tool of player is "&cred_colored" or "&ablue_color" or "&aiamgreener":
if targeted block is log or plank:
cancel event
send "&cyou cant do that"
stop
```
Hi everyone, I found this script on google to prevent a player from using an edited diamond axe to shell out a tree log or planks, because if he did, there would be a bug that would dupe that axe. (So that script works very well!)
I'd like to know if anyone could and would do a free script similarly to prevent someone from putting a renamed enchanted_book (just like that axe on the example) into a grindstone (new minecraft container to remove book enchants). It is possible but I do not know the code in skript for this. Would someone help me please?

but I can not prevent the player from holding the book for example, because the book belongs to a plugin that when right-clicking the book holds the player opens a menu of options, a gui interface. I just wanted to prevent the player from getting this book into Grindstone because it would turn the book into an ordinary book, and this being a book that it takes through a plugin command it would have an endless farm of books.

I'm sorry but I'm completely lazy in javascript I have no idea how to do this. I would need the complete script from start to finish.
 
Last edited:
First point : skript is not javascript!

(need skellet)
try this :

Code:
on inventory click:
    if player's current inventory's type is grindstone inventory:
        if clicked item is an enchanted book:
            cancel event
 
Code:
on inventory click:
    if player's current inventory's type is grindstone inventory:
        if event-item is an enchanted book:
            if name of item of player is "&arenamed book" or "&aedited book" or "&atagged book":
                cancel event
                send "&cyou cant do that"
                stop

Script compiled perfectly, no error, but it did not work, I dont get blocked when put the enchanted book renamed inside the grindstone. I do not want to prevent the player from putting any enchanting book on grindstone, only 1 specific enchanted book that has an edited name. Like this script below:

Code:
on rightclick holding diamond axe:
    if name of tool of player is "&6Lumber Axe" or "&aSeismic Axe" or "&cSoulbound Axe":
        if targeted block is log or plank:
            cancel event
            send "&cInteragir com este bloco usando este item estรก desabilitado para evitar bugs"
            stop

This script prevent the player to use a diamond_axe if this axe is renamed to be right clicked on a log or plank, and it works, players can use all kind of axes to do that, only receive block if use specific named axes.
 
Code:
on inventory click:
    if player's current inventory's type is grindstone inventory:
        if event-item is an enchanted book:
            if name of item of player is "&arenamed book" or "&aedited book" or "&atagged book":
                cancel event
                send "&cyou cant do that"
                stop

script compiled perfectly, no error, but it did not work, I dont get blocked when put the enchanted book renamed inside the grindstone

It is because the 'event-item' return <none>.. the unique method is the 'clicked item' (i think)
(Tested on 1.12.2)
 
It is because the 'event-item' return <none>.. the unique method is the 'clicked item' (i think)
(Tested on 1.12.2)

how can we ask to update skellet for 1.14.2 ? =/
[doublepost=1561609560,1561470041][/doublepost]

Code:
on inventory click:
    if player's current inventory's type is grindstone inventory:
        if cursor slot of player is an enchanted book:
            if name of cursor slot of player is "&arenamed book" or "&aedited book" or "&atagged book":
                cancel event
                send "&cyou cant do that"
                stop

stop here waiting for some help.


I did some testing, if the player clicked to pick up the book and try to put it with the grindstone inventory open it is blocked by the script, nor put back in the inventory itself does he succeed, however if he simply hold the keuboard shift button, and click with the left mouse button - it succeeds. Do you have any code in the script to block this? (this mechanics to put iten from a inventory to other inventory)
 
Use inventory action.

you can use all this types as a condition :

nothing, pickup all, pickup some, pickup half, pickup one item, place all, place some, place one, swap with cursor, drop all from cursor, drop one from cursor, drop all from slot, drop one from slot, instant move, hotbar move and readd, swap with hotbar, clone stack, collect to cursor, unknown
 
inventory action


Code:
on inventory action:
    if player's current inventory's type is grindstone inventory:
        if cursor slot of player is an enchanted book:
            if name of cursor slot of player is "&arename book" or "&aedited book" or "&atagged book":
                cancel event
                send "&cyou cant do that"
                stop

skript can't understand this event: "inventory action" - didnt compile
 
Code:
on inventory action:
    if player's current inventory's type is grindstone inventory:
        if cursor slot of player is an enchanted book:
            if name of cursor slot of player is "&arename book" or "&aedited book" or "&atagged book":
                cancel event
                send "&cyou cant do that"
                stop

skript can't understand this event: "inventory action" - didnt compile

Inventory action is not an event!
 
Inventory action is not an event!

sorry were i should to put Inventoty action on code ?
were ? can you re-write de code with your suggest please ?

Code:
on inventory click:
    if player's current inventory's type is grindstone inventory:
        if cursor slot of player is an enchanted book:
            if name of cursor slot of player is "&arenamed book" or "&aedited book" or "&atagged book":
                if event-inventory isn't player's inventory:
                    cancel event
                    send "&cYou cant do that."
                    stop
 
Last edited:
Status
Not open for further replies.