Skript - Mirror Event Help

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

    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.

MeHow

Active Member
Feb 6, 2017
140
13
18
Lithuania
Hello guys I just started to work with skript-mirror and I cant understand it well so I can't make this skript:
code_language.skript:
on script load:
    import "org.bukkit.event.player.AsyncPlayerChatEvent"
    import "org.bukkit.entity.Player"
    import "org.bukkit.ChatColor"

       
on "org.bukkit.event.player.AsyncPlayerChatEvent":  
    if {m_.partner.%event.getPlayer()%} is not set:          
        set {_replace} to ChatColor.translateAlternateColorCodes("&", "&4&l&f")
    else:
        set {_replace} to ChatColor.translateAlternateColorCodes("&", "&4&l❤&f")
    set {_fromat} to event.getFormat().replace("{marry}", {_replace})
    event.setFormat({_fromat})

What I am doing wrong? I am trying to use Skript variable and use it with java
 
You don't have to import the event class to use the event, and you are using the java call expression wrong. I don't really see why you are doing this though, vanilla skript has both on chat and chat format
 
Status
Not open for further replies.