Solved Weird endeavor of the "on portal" event. Pls help.

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

Allan Noyd

Member
Apr 29, 2021
48
0
6
23
I'm trying to do it so specific players are not allowed in to the end dimension (they cannot go through the enderportal). As skript on my server has been protesting ever since the 1.18 update, I was going on it slowly. First code looked like this:
Code:
on player portal:
    broadcast "hi"
And it worked. After going through a netherportal, it spit out "hi" in the chat.
However then came the next step of adding conditions:
Code:
on player portal:
    player's display name is "AlienoidTv"
    broadcast "hi"
Nothing ever happened. No error. No chat message as coded. My user name is AlienoidTv just as in the code. Can anyone say what is going on? Thanks.
 
You forgot a colon

Code:
on player portal:
    player's display name is "AlienoidTv":
        broadcast "hi"
 
You forgot a colon

Code:
on player portal:
    player's display name is "AlienoidTv":
        broadcast "hi"
Is this new? I never used colons after "simple" conditions (a.k.a. conditions without "if" statement) before and it used to work.

Edit: Also, it does not work for me either. :/
 
Last edited:
If you want a command to make players not be able to go to the end.

Code:
command /disableendaccess [<offline player>]:
    permission: skript.disableend
    trigger:
        if arg-1 is set:
            add arg-1 to {noendaccess::*}

on player portal:
    if {noendaccess::*} contains player:
        cancel event

Note: This means they also can't enter the nether if you don't want that you can do this


Code:
command /disableendaccess [<offline player>]:
    permission: skript.disableend
    trigger:
        if arg-1 is set:
            add arg-1 to {noendaccess::*}

on player portal:
    if {noendaccess::*} contains player:
        if event-teleportcause is not nether portal:
            cancel event
 
If you want a command to make players not be able to go to the end.

Code:
command /disableendaccess [<offline player>]:
    permission: skript.disableend
    trigger:
        if arg-1 is set:
            add arg-1 to {noendaccess::*}

on player portal:
    if {noendaccess::*} contains player:
        cancel event

Note: This means they also can't enter the nether if you don't want that you can do this


Code:
command /disableendaccess [<offline player>]:
    permission: skript.disableend
    trigger:
        if arg-1 is set:
            add arg-1 to {noendaccess::*}

on player portal:
    if {noendaccess::*} contains player:
        if event-teleportcause is not nether portal:
            cancel event
Hi. First of all, thank you for the help. My skript-testing server does not like the code for some reason, but imma write that off as Minehut being Minehut. Online parser says it cannot compare event-teleportcause with an item type, but who knows.

Are you sure enderpearling won't get canceled too? It is a teleport cause (at least in my eyes and skript docs as far as I know) and it is not caused by nether portal.

Second of all, what about the custom permission? Do I need a separate plugin for that? How do I get the permission in-game?

Thanks once again for the help. A command was actually what I was going for, I just couldn't get it work so I was testing and nothing seemed to work.
 
You could maybe do
Code:
If event-teleportcause is not “nether portal” parsed as teleport cause:

About the ender pearl, even though it is a teleport cause, it doesn’t trigger the player portal event (as far as I know). That event only gets triggered by nether/end portal.
 
You could maybe do
Code:
If event-teleportcause is not “nether portal” parsed as teleport cause:

About the ender pearl, even though it is a teleport cause, it doesn’t trigger the player portal event (as far as I know). That event only gets triggered by nether/end portal.
I see. Thank you.
 
Status
Not open for further replies.