skript-mirror

Addon skript-mirror 0.19.1

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

  • Like
Reactions: Decalers
Hello,
Can you help me, I would like to do this with skript-mirror
Java:
World world = Bukkit.getWorld("Survie");
                Chunk chunk = world.getChunkAt(arg0);

I can't manage to use this too...
https://github.com/SBPrime/AsyncWor.../asyncworldedit/api/events/IJobDoneEvent.java
code_language.skript:
on "org.primesoft.asyncworldedit.api.events.IJobDoneEvent" with priority 5:
    broadcast "debug"
The IJobDoneEvent you posted appears to use a custom event system instead of Bukkit's event system.
 
I figured out how to get the chunk back if it can help others :emoji_stuck_out_tongue:

Arff damage no event for WE ^^

code_language.skript:
on script load:
    import "org.bukkit.Bukkit"
   
    #<-- Get the location of a player, entities, block, etc.. ->
    set {_loc} to location of {_player}
    #<-- Get the chunk from the location -->
    set {_chunk} to {_loc}.getChunk()
 
I figured out how to get the chunk back if it can help others :emoji_stuck_out_tongue:

Arff damage no event for WE ^^

code_language.skript:
on script load:
    import "org.bukkit.Bukkit"
  
    #<-- Get the location of a player, entities, block, etc.. ->
    set {_loc} to location of {_player}
    #<-- Get the chunk from the location -->
    set {_chunk} to {_loc}.getChunk()
Why not just use vanilla Skript for it?
code_language.skript:
set {_chunk} to chunk at {_loc}
 
Because it uses "getChunkAt" which doesn't return you the chunk but the block in the cunk the corners are not good...
 
After some tests it doesn't work if the chunk is not loaded ^^
[doublepost=1506634729,1506364703][/doublepost]Good evening,
Is there any reason why he should return an internal error? :/

code_language.skript:
on script load:
    import "java.util.Collections"
    import "import java.util.ArrayList"
    
command /jetest <number>:
    trigger:
        
        loop arg number times:
            set {_list::%loop-number%} to a random number between 1 and 300
        
        send "%{_list::1}%"
        {Collections}.reverse({_list::*});
        send "%{_list::1}%"
 
After some tests it doesn't work if the chunk is not loaded ^^
[doublepost=1506634729,1506364703][/doublepost]Good evening,
Is there any reason why he should return an internal error? :/

code_language.skript:
on script load:
    import "java.util.Collections"
    import "import java.util.ArrayList"
   
command /jetest <number>:
    trigger:
       
        loop arg number times:
            set {_list::%loop-number%} to a random number between 1 and 300
       
        send "%{_list::1}%"
        {Collections}.reverse({_list::*});
        send "%{_list::1}%"
What's the error? and yes I think this should return an error. Even if it didn't it wouldn't do what you wanted
 
Strange, I followed doc java...
My error:
Java:
29.09 01:09:52 [Server] ERROR #!#!
29.09 01:09:52 [Server] ERROR #!#! [Skript] Severe Error:
29.09 01:09:52 [Server] ERROR #!#!
29.09 01:09:52 [Server] ERROR #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
29.09 01:09:52 [Server] ERROR #!#! If you're a server admin however please go to https://github.com/bensku/Skript/issues/
29.09 01:09:52 [Server] ERROR #!#! and check whether this error has already been reported.
29.09 01:09:52 [Server] ERROR #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it (or use paste service),
29.09 01:09:52 [Server] ERROR #!#! and describe what you did before it happened and/or what you think caused the error.
29.09 01:09:52 [Server] ERROR #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
29.09 01:09:52 [Server] ERROR #!#! By following this guide fixing the error should be easy and done fast.
29.09 01:09:52 [Server] ERROR #!#!
29.09 01:09:52 [Server] ERROR #!#! Stack trace:
29.09 01:09:52 [Server] ERROR #!#! java.lang.NullPointerException
29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.log.SkriptLogger.log(SkriptLogger.java:175)
29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.log.SkriptLogger.log(SkriptLogger.java:166)
29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.Skript.warning(Skript.java:1140)
29.09 01:09:52 [Server] ERROR #!#!     at com.btk5h.skriptmirror.skript.ExprJavaCall.invoke(ExprJavaCall.java:217)
29.09 01:09:52 [Server] ERROR #!#!     at com.btk5h.skriptmirror.skript.ExprJavaCall.getAll(ExprJavaCall.java:435)
29.09 01:09:52 [Server] ERROR #!#!     at com.btk5h.skriptmirror.skript.EffTerminatedLine.execute(EffTerminatedLine.java:21)
29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:54)
29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:65)
29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:93)
29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.lang.Trigger.execute(Trigger.java:53)
29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.command.ScriptCommand.execute2(ScriptCommand.java:222)
29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:184)
29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.command.Commands.handleCommand(Commands.java:270)
29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.command.Commands$1.onPlayerCommand(Commands.java:165)
29.09 01:09:52 [Server] ERROR #!#!     at sun.reflect.GeneratedMethodAccessor520.invoke(Unknown Source)
29.09 01:09:52 [Server] ERROR #!#!     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 
After some tests it doesn't work if the chunk is not loaded ^^
[doublepost=1506634729,1506364703][/doublepost]Good evening,
Is there any reason why he should return an internal error? :/

code_language.skript:
on script load:
    import "java.util.Collections"
    import "import java.util.ArrayList"
   
command /jetest <number>:
    trigger:
       
        loop arg number times:
            set {_list::%loop-number%} to a random number between 1 and 300
       
        send "%{_list::1}%"
        {Collections}.reverse({_list::*});
        send "%{_list::1}%"
That shouldn't work. Skript lists are not interchangeable with Java lists.
 
code_language.skript:
function reverseList(o: objects) :: objects:
  loop size of {_o::*} times:
    add last element out of {_o::*} to {_r::*}
    set {_i} to last element out of all indexes of {_o::*}
    delete {_o::%{_i}%}
  return {_r::*}

While skript-mirror can probably be used for that, vanilla skript is gonna be easier here. That might work, it's not tested.