Canceling flower pot interaction

  • 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.

Tilomi

New Member
Mar 7, 2017
7
1
3
23
Hi!
I have been trying to prevent a player from taking flowers out of flower pots but hadn't had any success doing so. on right click on flower pot is triggered only when putting something into the pot or clicking empty one. When something is in the pot, the event is not triggered. Is that intended? Which event (or any) should be triggered there?

Any ideas for workarounds to cancel taking flowers out of pots?


Thanks!
[doublepost=1552400394,1552125957][/doublepost]So... has anyone ideas? I have been thinking and trying all kinds of workarounds, but hadn't had any of them working. I have also tried using packets to cancel this but neither did it work. Anyone to guide me to right track with packets?
 
How far did you get with the packets? What's your code for the packets?
 
I didn't get really anywhere. The packet for modifying the contents is play_server_block_change. I got the location and new state of the block but wasn't able to figure out the previous state (which I need since I don't want to cancel this for every pot variant, only one) nor cancel or modify the packet.

Code:
packet event play_server_block_change:
    set {_packet} to event-packet
    if blockdata pinfo 0 of event-packet is flower pot:
        broadcast "the new state is a empty flower pot"
    broadcast "%location pinfo 0 of {_packet}%"
    broadcast "%blockdata pinfo 0 of {_packet}%"
 
Can you do something with this code:
Code:
packet event play_client_use_item:
    targeted block is flower pot
    set {_b} to targeted block
    broadcast "click on %{_b}% from %player%"
 
Yeah, that looks really promising! I only need to cancel the packet but at least cancel event doesn't work. Tips on that?
 
Weird. Do you have skript-mirror? If so, try event.setCancelled(true).
When you say it doesn't work, do you mean you get parsing/console errors or it doesn't show any errors but just doesn't do what it's supposed to do?
 
No parsing or console errors. The event just isn't canceled. I can't try skript-mirror because it spams my console full of "1 log handler was not stopped properly!" errors.

EDIT: I tested the skript-mirror on other server and sadly it didn't work either.
 
Last edited:
Status
Not open for further replies.