detect chunk issue?

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

FallingCatus

Member
Jun 29, 2017
38
0
6
33
Hey all,
I'm having a issue, no errors showing but with this skript it doesn't seem to set only the event blocks chunk as true but instead sets others around it? but the event chunk doesn't seem to be set, its weird. i have sent full code so you guys can test and hopefully help me out here.
what i am going for...
When player enters chunk and chunk has the block in it, player gets effects removed and when they leave that chunk (enter another) effects are then given back depending on world.
probs worth saying that by default players all have jump and slow falling be default and this block removes those effects when in chunk the block is in.

Thanks


Code:
options:
    block: light gray glazed terracotta
    name: "&b&lGravity Generator"
    lore: "&7This item restores &2Earth &7like gravity."
    giveperm: cosmic.owner

on block place of {@block}:
    if the 1st line of the tool's lore is {@lore}:
        set {block.cosmicgravity::%event-block's location%} to true
        set {chunk.cosmicgravity::%event-block's chunk%} to true
        send "&dCosmic &8» &b&lGravity Generator &7has been placed." to player
        stop

on block break of {@block}:
    if {block.cosmicgravity::%event-block's location%} is true:
        if {chunk.cosmicgravity::%event-block's chunk%} is true:
            drop {@block} named {@name} with lore {@lore} at location of event-block
            send "&dCosmic &8» &b&lGravity Generator &7has been removed." to player
            set event-block to air
            cancel event
            set {block.cosmicgravity::%event-block's location%} to false
            set {chunk.cosmicgravity::%event-block's chunk%} to false
            stop

on chunk enter:
    if {chunk.cosmicgravity::%event-player's chunk%} is true:
        send "&a&lBlock in the is chunk." to player
        remove slow falling from player
        remove jump boost from player
        stop
    if {chunk.cosmicgravity::%event-player's chunk%} is false:
        player is in "Moon":
            send "no block" to player
            apply potion of slow falling of tier 4 without any particles to the player for 1 day
            apply potion of jump boost of tier 4 without any particles to the player for 1 day
            stop
        player is in "world":
            send "&c&lBlock not in this chunk." to player
            apply potion of slow falling of tier 1 without any particles to the player for 1 day
            apply potion of jump boost of tier 2 without any particles to the player for 1 day
            stop
        player is in "world_nether":
            send "no block" to player
            apply potion of slow falling of tier 1 without any particles to the player for 1 day
            apply potion of jump boost of tier 2 without any particles to the player for 1 day
            stop
        player is in "k2":
            send "no block" to player
            apply potion of slow falling of tier 2 without any particles to the player for 1 day
            apply potion of jump boost of tier 3 without any particles to the player for 1 day
            stop

command /giveitem [<player>]:
    trigger:
        if player has permission "{@giveperm}":
            if arg 1 is not set:
                give player 1 {@block} named {@name} with lore {@lore}
                send "&dCosmic &8» &7You have been given a &b&lGravity Generator&7." to player
                stop
            if arg 1 is set:
                give arg 1 {@block} named {@name} with lore {@lore}
                send "&dCosmic &8» &7You have been given a &b&lGravity Generator&7." to arg
                stop
 
Status
Not open for further replies.