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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Addon skript-mirror 0.19.1

Natural reflection utilities for Skript

  1. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    • Friendly Friendly x 1
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Hmm, so it's should look like that?
    Code (Text):
    1.  
    2. set {_p} to event.getfPlayer().MemoryFPlayer().getName()
    3.  
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    No, you'd use the getName method directly from the getfPlayer method.
     
    • Friendly Friendly x 1
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Great! It works, thanks :emoji_slight_smile:
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    btk5h updated skript-mirror with a new update entry:

    skript-mirror 0.7.0

    Read the rest of this update entry...
     
    • Like Like x 1
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    • Like Like x 1
  7. Spartan9802

    Spartan9802 Member

    Joined:
    Jan 26, 2017
    Messages:
    158
    Likes Received:
    8
  8. btk5h

    Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    154
    Likes Received:
    155
    The IJobDoneEvent you posted appears to use a custom event system instead of Bukkit's event system.
     
  9. Spartan9802

    Spartan9802 Member

    Joined:
    Jan 26, 2017
    Messages:
    158
    Likes Received:
    8
    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 (Skript):
    1. on script load:
    2.     import "org.bukkit.Bukkit"
    3.    
    4.     #<-- Get the location of a player, entities, block, etc.. ->
    5.     set {_loc} to location of {_player}
    6.     #<-- Get the chunk from the location -->
    7.     set {_chunk} to {_loc}.getChunk()
     
  10. Snow-Pyon

    Moderator Resource Staff

    Joined:
    Jan 25, 2017
    Messages:
    1,234
    Likes Received:
    172
    Medals:
    Why not just use vanilla Skript for it?
    Code (Skript):
    1. set {_chunk} to chunk at {_loc}
     
  11. Spartan9802

    Spartan9802 Member

    Joined:
    Jan 26, 2017
    Messages:
    158
    Likes Received:
    8
    Because it uses "getChunkAt" which doesn't return you the chunk but the block in the cunk the corners are not good...
     
  12. BaeFell

    BaeFell I'm Poppy
    Admin

    Joined:
    Nov 27, 2016
    Messages:
    498
    Likes Received:
    216
  13. Spartan9802

    Spartan9802 Member

    Joined:
    Jan 26, 2017
    Messages:
    158
    Likes Received:
    8
    After some tests it doesn't work if the chunk is not loaded ^^
    --- Double Post Merged, Sep 28, 2017, Original Post Date: Sep 25, 2017 ---
    Good evening,
    Is there any reason why he should return an internal error? :/

    Code (Skript):
    1. on script load:
    2.     import "java.util.Collections"
    3.     import "import java.util.ArrayList"
    4.    
    5. command /jetest <number>:
    6.     trigger:
    7.        
    8.         loop arg number times:
    9.             set {_list::%loop-number%} to a random number between 1 and 300
    10.        
    11.         send "%{_list::1}%"
    12.         {Collections}.reverse({_list::*});
    13.         send "%{_list::1}%"
     
  14. Pikachu

    Moderator Supporter Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    871
    Likes Received:
    126
    Medals:
    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
     
  15. Spartan9802

    Spartan9802 Member

    Joined:
    Jan 26, 2017
    Messages:
    158
    Likes Received:
    8
    Strange, I followed doc java...
    My error:
    Code (Java):
    1. 29.09 01:09:52 [Server] ERROR #!#!
    2. 29.09 01:09:52 [Server] ERROR #!#! [Skript] Severe Error:
    3. 29.09 01:09:52 [Server] ERROR #!#!
    4. 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.
    5. 29.09 01:09:52 [Server] ERROR #!#! If you're a server admin however please go to https://github.com/bensku/Skript/issues/
    6. 29.09 01:09:52 [Server] ERROR #!#! and check whether this error has already been reported.
    7. 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),
    8. 29.09 01:09:52 [Server] ERROR #!#! and describe what you did before it happened and/or what you think caused the error.
    9. 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.
    10. 29.09 01:09:52 [Server] ERROR #!#! By following this guide fixing the error should be easy and done fast.
    11. 29.09 01:09:52 [Server] ERROR #!#!
    12. 29.09 01:09:52 [Server] ERROR #!#! Stack trace:
    13. 29.09 01:09:52 [Server] ERROR #!#! java.lang.NullPointerException
    14. 29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.log.SkriptLogger.log(SkriptLogger.java:175)
    15. 29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.log.SkriptLogger.log(SkriptLogger.java:166)
    16. 29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.Skript.warning(Skript.java:1140)
    17. 29.09 01:09:52 [Server] ERROR #!#!     at com.btk5h.skriptmirror.skript.ExprJavaCall.invoke(ExprJavaCall.java:217)
    18. 29.09 01:09:52 [Server] ERROR #!#!     at com.btk5h.skriptmirror.skript.ExprJavaCall.getAll(ExprJavaCall.java:435)
    19. 29.09 01:09:52 [Server] ERROR #!#!     at com.btk5h.skriptmirror.skript.EffTerminatedLine.execute(EffTerminatedLine.java:21)
    20. 29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:54)
    21. 29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:65)
    22. 29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:93)
    23. 29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.lang.Trigger.execute(Trigger.java:53)
    24. 29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.command.ScriptCommand.execute2(ScriptCommand.java:222)
    25. 29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:184)
    26. 29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.command.Commands.handleCommand(Commands.java:270)
    27. 29.09 01:09:52 [Server] ERROR #!#!     at ch.njol.skript.command.Commands$1.onPlayerCommand(Commands.java:165)
    28. 29.09 01:09:52 [Server] ERROR #!#!     at sun.reflect.GeneratedMethodAccessor520.invoke(Unknown Source)
    29. 29.09 01:09:52 [Server] ERROR #!#!     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     
  16. btk5h

    Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    154
    Likes Received:
    155
    That shouldn't work. Skript lists are not interchangeable with Java lists.
     
  17. Pikachu

    Moderator Supporter Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    871
    Likes Received:
    126
    Medals:
    Code (Skript):
    1. function reverseList(o: objects) :: objects:
    2.   loop size of {_o::*} times:
    3.     add last element out of {_o::*} to {_r::*}
    4.     set {_i} to last element out of all indexes of {_o::*}
    5.     delete {_o::%{_i}%}
    6.   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.
     
  18. Spartan9802

    Spartan9802 Member

    Joined:
    Jan 26, 2017
    Messages:
    158
    Likes Received:
    8
  19. Pikachu

    Moderator Supporter Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    871
    Likes Received:
    126
    Medals:
    Make an array of ints from a variable (requires casting for the right type), sort it, then use ...%array% to spread the array back into a list
     
    • Like Like x 1
  20. Snow-Pyon

    Moderator Resource Staff

    Joined:
    Jan 25, 2017
    Messages:
    1,234
    Likes Received:
    172
    Medals:
Loading...