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

    Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    154
    Likes Received:
    155
  2. ammar

    ammar Member

    Joined:
    May 15, 2017
    Messages:
    11
    Likes Received:
    1
    is custom event {call/create} will be added or not ?
     
  3. neexipl

    neexipl Member

    Joined:
    Jan 27, 2017
    Messages:
    4
    Likes Received:
    0
    How to use api GlowAPI in On item spawn: ? :/
     
  4. ammar

    ammar Member

    Joined:
    May 15, 2017
    Messages:
    11
    Likes Received:
    1
    Code (Skript):
    1.  
    2. import:
    3.    org.bukkit.event.player.PlayerItemBreakEvent
    4. on PlayerItemBreakEvent:
    5.    broadcast "test"
    6.  
    7.  
    8.  
    9. > [23:49:40 ERROR]: #!#! Stack trace:
    10. > [23:49:40 ERROR]: #!#! java.lang.NullPointerException
    11. > [23:49:40 ERROR]: #!#! at org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack.addUnsafeEnchantment(CraftItemStack.java:189)
    12. > [23:49:40 ERROR]: #!#! at ch.njol.skript.effects.EffEnchant.execute(EffEnchant.java:83)
    13. > [23:49:40 ERROR]: #!#! at ch.njol.skript.lang.Effect.run(Effect.java:52)
    14. > [23:49:40 ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
    15. > [23:49:40 ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
    16. > [23:49:40 ERROR]: #!#! at ch.njol.skript.lang.Trigger.execute(Trigger.java:55)
    17. > [23:49:40 ERROR]: #!#! at ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.ja
    18.  
     
  5. Spartan9802

    Spartan9802 Member

    Joined:
    Jan 26, 2017
    Messages:
    158
    Likes Received:
    8
    Hi @btk5h ,
    I have a strange error with the new API version of the GPS plugin, here is my code it returns me an "internal error" there is also an error in the console
    Code (Java):
    1. import:
    2.     com.live.bemmamin.gps.api.GPSAPI
    3.     ch.njol.skript.Skript
    4.    
    5. on load:
    6.     set {GPSAPI} to new GPSAPI(Skript.getInstance())
    7.    
    8. command /test:
    9.     trigger:
    10.         send "%{GPSAPI}.getClass()%"
    11.  
    My Console Error:
    https://pastebin.com/TZvuegZB
     
  6. Uzumaki

    Uzumaki Well-Known Member

    Joined:
    Feb 20, 2017
    Messages:
    290
    Likes Received:
    8
    can you make so we can suppress errors from imports
    Code (Skript):
    1. import:
    2.     try com.wasteofplastic.askyblock.ASkyBlockAPI
    thanks
     
    • Like Like x 1
  7. xbxy

    xbxy Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    170
    Likes Received:
    8
    I want to do both.
    But I don't know Java syntax and can only use skript
    Can you help me?
    @Uzumaki @Pikachu
    Code (Text):
    1.  
    2. import com.intellectualcrafters.configuration.file.YamlConfiguration;
    3. import com.intellectualcrafters.plot.PS;
    4. import com.intellectualcrafters.plot.commands.SubCommand;
    5. import com.intellectualcrafters.plot.config.C;
    6. import com.intellectualcrafters.plot.flag.Flag;
    7. import com.intellectualcrafters.plot.flag.FlagManager;
    8. import com.intellectualcrafters.plot.flag.Flags;
    9. import com.intellectualcrafters.plot.object.Plot;
    10. import com.intellectualcrafters.plot.object.PlotArea;
    11. import com.intellectualcrafters.plot.object.PlotId;
    12. import com.intellectualcrafters.plot.object.PlotManager;
    13. import com.intellectualcrafters.plot.object.PlotPlayer;
    14. import com.intellectualcrafters.plot.util.ChunkManager;
    15. import com.intellectualcrafters.plot.util.MainUtil;
    16. import com.intellectualcrafters.plot.util.Permissions;
    17. import com.intellectualcrafters.plot.util.SchematicHandler;
    18. import com.intellectualcrafters.plot.util.UUIDHandler;
    19. import com.intellectualcrafters.plot.util.block.GlobalBlockQueue;
    20. import com.intellectualcrafters.plot.uuid.UUIDWrapper;
    21. import com.plotsquared.bukkit.util.BukkitUtil;
    22. import org.bukkit.Location;
    23. import org.bukkit.OfflinePlayer;
    24. import org.bukkit.World;
    25. import org.bukkit.entity.Player;
    26. import org.bukkit.plugin.java.JavaPlugin;
    27. import java.util.ArrayList;
    28. import java.util.Collection;
    29. import java.util.Collections;
    30. import java.util.HashSet;
    31. import java.util.Set;
    32. import java.util.UUID;
    33.  
    34. /**
    35. * Get all plots for the player.
    36. *
    37. * @param world The world to retrieve plots from
    38. * @param player The player to search for
    39. * @param justOwner should we just search for owner? Or with rights?
    40. * @return An array of plots for the player
    41. */
    42. @Deprecated
    43. public Plot[] getPlots(World world, Player player, boolean justOwner) {
    44. ArrayList<Plot> pPlots = new ArrayList<>();
    45. UUID uuid = BukkitUtil.getPlayer(player).getUUID();
    46. for (Plot plot : PS.get().getPlots(world.getName())) {
    47. if (justOwner) {
    48. if (plot.hasOwner() && plot.isOwner(uuid)) {
    49. pPlots.add(plot);
    50. }
    51. } else if (plot.isAdded(uuid)) {
    52. pPlots.add(plot);
    53. }
    54. }
    55. return pPlots.toArray(new Plot[0]);
    56. }
    57.  
    58. /**
    59. * Get home location.
    60. *
    61. * @param plot Plot that you want to get the location for
    62. *
    63. * @return plot bottom location
    64. *
    65. * @see Plot
    66. */
    67. public Location getHomeLocation(Plot plot) {
    68. return BukkitUtil.getLocation(plot.getHome());
    69. }
    70. [code/]
    --- Double Post Merged, Jun 16, 2019, Original Post Date: May 25, 2019 ---
    0.16.1 update to 0.19.1 error


    Code (Text):
    1.  
    2. on "lk.vexview.event.KeyBoardPressEvent" with priority high:
    3.     set {_ki} to event.getKey()
    4.  
    5. [16:16:20 INFO]: [Skript] Reloading 1.sk...
    6. [16:16:21 ERROR]: can't understand this event: 'on "lk.vexview.event.KeyBoardPressEvent" with priority high' (1.sk, line 99: on "lk.vexview.event.KeyBoardPressEvent" with priority high:')
    7. [16:16:21 INFO]: [Skript] Encountered 1 error while reloading 1.sk!
    8.  
    9.  
     
  8. CormanYT

    CormanYT Well-Known Member

    Joined:
    Jan 6, 2018
    Messages:
    122
    Likes Received:
    4
    Why does it spam me with 'log handler' errors?
     
  9. TPGamesNL

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    1,310
    Likes Received:
    73
    Medals:
    Take a look at https://skript-mirror.gitbook.io/docs/basics/handling-events
     
  10. xbxy

    xbxy Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    170
    Likes Received:
    8
  11. CormanYT

    CormanYT Well-Known Member

    Joined:
    Jan 6, 2018
    Messages:
    122
    Likes Received:
    4
    Yes, you have to use methods from the event expression.
     
  12. xbxy

    xbxy Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    170
    Likes Received:
    8
    Ok, I will try. Thank you
     
  13. mel_instagibson

    Joined:
    Feb 4, 2017
    Messages:
    71
    Likes Received:
    4
    Hey so i tried to switch to skript-mirror 2.0.0 due to the log handler issue but it breaks so many of my skripts and i cant find any documentation about it

    Code (Skript):
    1.  
    2. on load:
    3.         set {mcoin} to new ItemStack(Material.EMERALD!)
    4.         set {_meta} to {mcoin}.getItemMeta()
    5.         set {_lore} to new ArrayList()
    6.         {_lore}.add("&a&oMelville Currency")
    7.         {_meta}.setLore({_lore})
    8.         {_meta}.setDisplayName("&e✪ MCoin ✪")
    9.         {_meta}.setUnbreakable(true)
    10.         {_meta}.addEnchant(Enchantment.LUCK!, 10, true)
    11.         {_meta}.addItemFlags([ItemFlag.HIDE_ENCHANTS!, ItemFlag.HIDE_UNBREAKABLE!])
    12.         {mcoin}.setItemMeta({_meta})
    13.  
    14. on EntityTargetLivingEntityEvent:
    15.         event.getEntityType() is EntityType.PHANTOM!
    16.         set {_p} to event.getTarget()
    17.         {_p} is instance of Player
    18.         {_p}.hasPotionEffect(PotionEffectType.NIGHT_VISION!) is true
    19.         {_p}.getStatistic(Statistic.TIME_SINCE_REST!) < 72000
    20.         cancel event
    21.  
    22. on PlayerInteractEntityEvent:
    23.         set {_p} to event.getPlayer()
    24.         event.getHand() is EquipmentSlot.HAND!
    25.         "%lore of {_p}'s tool%" contains "adult":
    26.                 event.setCancelled(true)
    27.                 if {_p} can build at location at {_p}:
    28.                         set {_e} to event.getRightClicked()
    29.                         if {_e} is instance of Ageable:
    30.                                 set {_s} to {_p}.getWorld().spawnEntity({_e}.getLocation(), {_e}.getType())
    31.                                 {_s}.setBaby()
    32.                                 set {_t} to {_p}'s tool
    33.                                 remove 1 of {_t} from {_p}
    34.  
    35.  
    36. [16:24:33 ERROR]: The function 'ItemStack' does not exist. (vote.sk, line 13: set {mcoin} to new ItemStack(Material.EMERALD!)')
    37. [16:24:33 ERROR]: LUCK!, 10, true is not a valid descriptor. (vote.sk, line 20: {_meta}.addEnchant(Enchantment.LUCK!, 10, true)#Enchantments have Fields and thus require the "!"')
    38. [16:24:33 ERROR]: Can't understand this condition/effect: {_meta}.addItemFlags([ItemFlag.HIDE_ENCHANTS!, ItemFlag.HIDE_UNBREAKABLE!]) (vote.sk, line 21: {_meta}.addItemFlags([ItemFlag.HIDE_ENCHANTS!, ItemFlag.HIDE_UNBREAKABLE!])#an array is simply made by [%value% and %value2% etc]')
    39. [16:24:33 ERROR]: The function 'ItemStack' does not exist. (vote.sk, line 27: set {mgrand} to new ItemStack(Material.EMERALD_BLOCK!)')
    40. [16:24:33 ERROR]: LUCK!, 10, true is not a valid descriptor. (vote.sk, line 34: {_meta}.addEnchant(Enchantment.LUCK!, 10, true)#Enchantments have Fields and thus require the "!"')
    41. [16:24:33 ERROR]: Can't understand this condition/effect: {_meta}.addItemFlags([ItemFlag.HIDE_ENCHANTS!, ItemFlag.HIDE_UNBREAKABLE!]) (vote.sk, line 35: {_meta}.addItemFlags([ItemFlag.HIDE_ENCHANTS!, ItemFlag.HIDE_UNBREAKABLE!])#an array is simply made by [%value% and %value2% etc]')
    42. [16:24:42 ERROR]: Can't understand this condition/effect: event.getEntityType() is EntityType.PHANTOM! (shopitems.sk, line 33: event.getEntityType() is EntityType.PHANTOM!')
    43. [16:24:42 ERROR]: Can't understand this condition/effect: {_p}.hasPotionEffect(PotionEffectType.NIGHT_VISION!) is true (shopitems.sk, line 36: {_p}.hasPotionEffect(PotionEffectType.NIGHT_VISION!) is true')
    44. [16:24:42 ERROR]: Can't compare '{_p}.getStatistic(Statistic.TIME_SINCE_REST!)' with an integer (shopitems.sk, line 37: {_p}.getStatistic(Statistic.TIME_SINCE_REST!) < 72000')
    45. [16:24:42 ERROR]: Can't understand this condition/effect: event.getHand() is EquipmentSlot.HAND! (shopitems.sk, line 43: event.getHand() is EquipmentSlot.HAND!')
    46. [16:24:42 WARN]: List is missing 'and' or 'or', defaulting to 'and': {_e}.getLocation(), {_e}.getType() (shopitems.sk, line 49: set {_s} to {_p}.getWorld().spawnEntity({_e}.getLocation(), {_e}.getType())')
    47. [16:24:42 ERROR]: TIME_SINCE_REST!, 0 is not a valid descriptor. (shopitems.sk, line 63: {_p}.setStatistic(Statistic.TIME_SINCE_REST!, 0)')
    48. [16:24:42 WARN]: List is missing 'and' or 'or', defaulting to 'and': {_m}.getType(), 1 (shopitems.sk, line 82: event.setResult(new ItemStack({_m}.getType(), 1))')
    49. [16:24:42 ERROR]: Can't understand this condition/effect: arg-1.hasPotionEffect(PotionEffectType.NIGHT_VISION!) is true (shopitems.sk, line 93: arg-1.hasPotionEffect(PotionEffectType.NIGHT_VISION!) is true')
    50. [16:24:42 ERROR]: Can't understand this expression: arg-1.getStatistic(Statistic.TIME_SINCE_REST!) (shopitems.sk, line 99: send  "%arg-1.getStatistic(Statistic.TIME_SINCE_REST!)%"')
    should i just go back to the "stable" version here or is there any documentation available?
     
    #193 mel_instagibson, Jul 18, 2019
    Last edited: Jul 18, 2019
  14. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,093
    Likes Received:
    146
    You need to remove the !
    ex:
    Code (Text):
    1. {_meta}.addItemFlags([ItemFlag.HIDE_ENCHANTS!, ItemFlag.HIDE_UNBREAKABLE!])
    should be
    Code (Skript):
    1. {_meta}.addItemFlags([ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_UNBREAKABLE])
     
    • Friendly Friendly x 1
Loading...