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!

Just import the ResidenceApi class and then set a variable to the ResidenceApi#getResidenceManager method, it returns a ResidenceInterface object.
I had that but i didn't know how i would use "addResidence" then. (i didnt expect that setting a variable to it would create anything)
code_language.skript:
set {_a} to {_t}.addResidence(player, "123test", player's location, location 10 west and 10 north of player, false)
got it now tho, thanks!
 
I had that but i didn't know how i would use "addResidence" then. (i didnt expect that setting a variable to it would create anything)
code_language.skript:
set {_a} to {_t}.addResidence(player, "123test", player's location, location 10 west and 10 north of player, false)
got it now tho, thanks!
Well, that's not what I meant but if it works, it works.

This is what I meant by the way:
code_language.skript:
on script load:
 
  import "com.bekvon.bukkit.residence.api.ResidenceApi"

#then, somewhere in your code
set {_ResidenceInterface} to {ResidenceApi}.getResidenceManager()

{_ResidenceInterface}.addResidence(player, "123test", player's location, location 20 northwest of player, false); #I'm not sure about the second location but anyways
 
Hello i have the problem :/

code_language.skript:
on script load:
    import "org.kitteh.vanish.VanishManager"
    import "org.kitteh.vanish.VanishPlugin"
    set {_test} to {VanishPlugin}.getCurrentVersion()
    broadcast "%{_test}%"
Error:
code_language.skript:
WARN [Skript] No matching method: VanishPlugin#getCurrentVersion
[doublepost=1503360043,1503014861][/doublepost]Plz help me :/
 
Hello i have the problem :/

code_language.skript:
on script load:
    import "org.kitteh.vanish.VanishManager"
    import "org.kitteh.vanish.VanishPlugin"
    set {_test} to {VanishPlugin}.getCurrentVersion()
    broadcast "%{_test}%"
Error:
code_language.skript:
WARN [Skript] No matching method: VanishPlugin#getCurrentVersion
[doublepost=1503360043,1503014861][/doublepost]Plz help me :/
It isn't a static method, therefore it needs an instance of the class, which you can get importing the VanishNoPacket class from the staticaccess package using the VanishNoPacket#getPlugin method. Then, with that instance you would be able to use the VanishPlugin#getCurrentVersion method and any other methods in that class.
 
That is what I thought
But I do not understand how to ...
I followed the doc: /
https://github.com/btk5h/skript-mirror/wiki/Calling-Java-from-Skript
Well, there is no black magic here, just following my post you would get it.

importing the VanishNoPacket class from the staticaccess package
code_language.skript:
import "org.kitteh.vanish.staticaccess.VanishNoPacket"

code_language.skript:
set {_instance} to {VanishNoPacket}.getPlugin()
Then, with that instance you would be able to use the VanishPlugin#getCurrentVersion method and any other methods in that class.
code_language.skript:
set {_version} to {_instance}.getCurrentVersion()

And the final result is:

code_language.skript:
on script load:
  import "org.kitteh.vanish.staticaccess.VanishNoPacket"
 
  set {_instance} to {VanishNoPacket}.getPlugin()
  set {_version} to {_instance}.getCurrentVersion()
 
It's so simple oO
You should add the example to the doc!
Thank you so much I learned a new thing ^^
[doublepost=1503411172,1503409955][/doublepost]And if I want to use the class VanishManager.java I do this is good?
code_language.skript:
on script load:
    import "org.kitteh.vanish.staticaccess.VanishNoPacket"

    set {_instance} to {VanishNoPacket}.getPlugin()
    set {_version} to {_instance}.getCurrentVersion()
    set {_manager} to {_instance}.getManager()
 
It's so simple oO
You should add the example to the doc!
Thank you so much I learned a new thing ^^
[doublepost=1503411172,1503409955][/doublepost]And if I want to use the class VanishManager.java I do this is good?
code_language.skript:
on script load:
    import "org.kitteh.vanish.staticaccess.VanishNoPacket"

    set {_instance} to {VanishNoPacket}.getPlugin()
    set {_version} to {_instance}.getCurrentVersion()
    set {_manager} to {_instance}.getManager()
Yes, you could also use the VanishNoPacket#getManager method if you want do it straightforward.
 
  • Like
Reactions: Spartan9802
Hello i have the error with skript-mirror

code_language.skript:
23.08 16:25:13 [Server] ERROR #!#! Stack trace:
23.08 16:25:13 [Server] ERROR #!#! java.lang.IndexOutOfBoundsException: Index: 0, Size: -1
23.08 16:25:13 [Server] ERROR #!#!     at java.util.LinkedList.checkPositionIndex(LinkedList.java:560)
23.08 16:25:13 [Server] ERROR #!#!     at java.util.LinkedList.listIterator(LinkedList.java:867)
23.08 16:25:13 [Server] ERROR #!#!     at java.util.AbstractList.listIterator(AbstractList.java:299)
23.08 16:25:13 [Server] ERROR #!#!     at java.util.AbstractSequentialList.iterator(AbstractSequentialList.java:239)
23.08 16:25:13 [Server] ERROR #!#!     at ch.njol.skript.log.HandlerList.iterator(HandlerList.java:48)
23.08 16:25:13 [Server] ERROR #!#!     at ch.njol.skript.log.SkriptLogger.log(SkriptLogger.java:174)
23.08 16:25:13 [Server] ERROR #!#!     at ch.njol.skript.log.SkriptLogger.log(SkriptLogger.java:166)
23.08 16:25:13 [Server] ERROR #!#!     at ch.njol.skript.Skript.error(Skript.java:1149)
23.08 16:25:13 [Server] ERROR #!#!     at ch.njol.skript.classes.data.BukkitClasses$18.parse(BukkitClasses.java:923)
23.08 16:25:13 [Server] ERROR #!#!     at ch.njol.skript.classes.data.BukkitClasses$18.parse(BukkitClasses.java:1)
23.08 16:25:13 [Server] ERROR #!#!     at ch.njol.skript.expressions.ExprParse.get(ExprParse.java:149)
23.08 16:25:13 [Server] ERROR #!#!     at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:105)
23.08 16:25:13 [Server] ERROR #!#!     at ch.njol.skript.effects.EffChange.execute(EffChange.java:270)
23.08 16:25:13 [Server] ERROR #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:54)
23.08 16:25:13 [Server] ERROR #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:65)
23.08 16:25:13 [Server] ERROR #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:93)
23.08 16:25:13 [Server] ERROR #!#!     at ch.njol.skript.lang.Trigger.execute(Trigger.java:53)
23.08 16:25:14 [Multicraft] Skipped 5765 lines due to rate limit (30/s)
23.08 16:25:14 [Server] ERROR #!#!     at java.util.AbstractList.listIterator(AbstractList.java:299)
23.08 16:25:14 [Server] ERROR #!#!     at java.util.AbstractSequentialList.iterator(AbstractSequentialList.java:239)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.log.HandlerList.iterator(HandlerList.java:48)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.log.SkriptLogger.log(SkriptLogger.java:174)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.log.SkriptLogger.log(SkriptLogger.java:166)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.Skript.error(Skript.java:1149)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.classes.data.BukkitClasses$18.parse(BukkitClasses.java:923)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.classes.data.BukkitClasses$18.parse(BukkitClasses.java:1)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.expressions.ExprParse.get(ExprParse.java:149)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:105)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.effects.EffChange.execute(EffChange.java:270)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:54)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:65)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:93)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.lang.Trigger.execute(Trigger.java:53)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.lang.function.ScriptFunction.execute(ScriptFunction.java:91)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.lang.function.Function.execute(Function.java:109)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.lang.function.FunctionReference.execute(FunctionReference.java:191)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.lang.function.EffFunctionCall.execute(EffFunctionCall.java:55)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:54)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:65)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:93)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.lang.Trigger.execute(Trigger.java:53)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:152)
23.08 16:25:14 [Server] ERROR #!#!     at ch.njol.skript.SkriptEventHandler$1.execute(SkriptEventHandler.java:112)
23.08 16:25:14 [Server] ERROR #!#!     at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
23.08 16:25:14 [Server] ERROR #!#!     at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:36)
23.08 16:25:14 [Server] ERROR #!#!     at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502)
23.08 16:25:14 [Server] ERROR #!#!     at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487)
23.08 16:25:14 [Server] ERROR #!#!     at com.btk5h.skriptmirror.skript.EvtByReflection.lambda$static$0(EvtByReflection.java:49)
 
Sorry I was on tel ^^
I have not posted this to the right place it's not a skript-mirror error ...

code_language.skript:
[16:30:32] [Server thread/ERROR]: #!#! Stack trace:
[16:30:32] [Server thread/ERROR]: #!#! java.lang.IndexOutOfBoundsException: Index: 0, Size: -1
[16:30:32] [Server thread/ERROR]: #!#!     at java.util.LinkedList.checkPositionIndex(LinkedList.java:560)
[16:30:32] [Server thread/ERROR]: #!#!     at java.util.LinkedList.listIterator(LinkedList.java:867)
[16:30:32] [Server thread/ERROR]: #!#!     at java.util.AbstractList.listIterator(AbstractList.java:299)
[16:30:32] [Server thread/ERROR]: #!#!     at java.util.AbstractSequentialList.iterator(AbstractSequentialList.java:239)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.log.HandlerList.iterator(HandlerList.java:48)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.log.SkriptLogger.log(SkriptLogger.java:174)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.log.SkriptLogger.log(SkriptLogger.java:166)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.Skript.error(Skript.java:1149)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.classes.data.BukkitClasses$18.parse(BukkitClasses.java:923)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.classes.data.BukkitClasses$18.parse(BukkitClasses.java:1)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.expressions.ExprParse.get(ExprParse.java:149)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:105)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.effects.EffChange.execute(EffChange.java:270)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:54)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:65)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:93)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Trigger.execute(Trigger.java:53)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.function.ScriptFunction.execute(ScriptFunction.java:91)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.function.Function.execute(Function.java:109)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.function.FunctionReference.execute(FunctionReference.java:191)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.function.EffFunctionCall.execute(EffFunctionCall.java:55)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:54)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:65)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:93)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Trigger.execute(Trigger.java:53)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:152)
[16:30:32] [Server thread/ERROR]: #!#!     at ch.njol.skript.SkriptEventHandler$1.execute(SkriptEventHandler.java:112)
[16:30:32] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[16:30:32] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:36)
[16:30:32] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502)
[16:30:32] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487)
[16:30:32] [Server thread/ERROR]: #!#!     at com.btk5h.skriptmirror.skript.EvtByReflection.lambda$static$0(EvtByReflection.java:49)
[16:30:32] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[16:30:32] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:36)
[16:30:32] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502)
[16:30:32] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487)
[16:30:32] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:270)
[16:30:32] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PacketPlayInFlying.a(SourceFile:126)
[16:30:32] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PacketPlayInFlying$PacketPlayInPosition.a(SourceFile:57)
[16:30:32] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13)
[16:30:32] [Server thread/ERROR]: #!#!     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[16:30:32] [Server thread/ERROR]: #!#!     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[16:30:32] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44)
[16:30:32] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715)
[16:30:32] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
[16:30:32] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
[16:30:32] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
[16:30:32] [Server thread/ERROR]: #!#!     at java.lang.Thread.run(Thread.java:748)
[16:30:32] [Server thread/ERROR]: #!#!
[16:30:32] [Server thread/ERROR]: #!#! Version Information:
[16:30:32] [Server thread/ERROR]: #!#!   Skript: 2.2-dev25
[16:30:32] [Server thread/ERROR]: #!#!   Bukkit: 1.8.8-R0.1-SNAPSHOT
[16:30:32] [Server thread/ERROR]: #!#!   Minecraft: 1.8.8
[16:30:32] [Server thread/ERROR]: #!#!   Java: 1.8.0_144 (Java HotSpot(TM) 64-Bit Server VM 25.144-b01)
[16:30:32] [Server thread/ERROR]: #!#!   OS: Linux amd64 3.14.32-xxxx-grs-ipv6-64
[16:30:32] [Server thread/ERROR]: #!#!
[16:30:32] [Server thread/ERROR]: #!#! Running CraftBukkit: false
[16:30:32] [Server thread/ERROR]: #!#!
[16:30:32] [Server thread/ERROR]: #!#! Current node: null
[16:30:32] [Server thread/ERROR]: #!#! Current item: set {_block}(as java.lang.Object) to "%{_block}(as java.lang.Object)%" parsed as an item stack
[16:30:32] [Server thread/ERROR]: #!#!
[16:30:32] [Server thread/ERROR]: #!#! Thread: Server thread
 
Hey, is this an error or do i just not get it?
I cant do anything after the set the view distance line....is that normal or am i missing something?

code_language.skript:
on script load:
        import "org.bukkit.entity.Player"

command /viewdistance <int>:
        permission: yt
        trigger:
                set {_s} to player.getViewDistance()
                send "%{_s}%"
                player.setViewDistance(arg-1)
                wait 1 tick
                send "&b[&dINFO&b] &eView distance set to %{_s}% Blocks" to player  #this line wont happen, aswell as anything else i tried after setviewdistance

Sorry if its something obvious, i never really worked with java itself
 
Hey, is this an error or do i just not get it?
I cant do anything after the set the view distance line....is that normal or am i missing something?

code_language.skript:
on script load:
        import "org.bukkit.entity.Player"

command /viewdistance <int>:
        permission: yt
        trigger:
                set {_s} to player.getViewDistance()
                send "%{_s}%"
                player.setViewDistance(arg-1)
                wait 1 tick
                send "&b[&dINFO&b] &eView distance set to %{_s}% Blocks" to player  #this line wont happen, aswell as anything else i tried after setviewdistance

Sorry if its something obvious, i never really worked with java itself
Where did you even find these methods? I don't see them
 
Hey, is this an error or do i just not get it?
I cant do anything after the set the view distance line....is that normal or am i missing something?

code_language.skript:
on script load:
        import "org.bukkit.entity.Player"

command /viewdistance <int>:
        permission: yt
        trigger:
                set {_s} to player.getViewDistance()
                send "%{_s}%"
                player.setViewDistance(arg-1)
                wait 1 tick
                send "&b[&dINFO&b] &eView distance set to %{_s}% Blocks" to player  #this line wont happen, aswell as anything else i tried after setviewdistance

Sorry if its something obvious, i never really worked with java itself
Are there any console warnings?
 
The event extends FactionPlayerEvent which has the FactionPlayerEvent#getfPlayer method. So, you can use event.getfPlayer() for get the FPlayer object.

Also, I would switch to LegacyFactions if I were you, it has a way more clean API and has more features than FactionsUUID.


i see but how get nickname of FPlayer object? event.getfPlayer() returns 'com.massivecraft.factions.zcore.persist.json.JSONFPlayer@383f4750'