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.

Can I use this in a java Plugin

Discussion in 'Java' started by Vyrrex, Apr 14, 2020.

  1. Vyrrex

    Vyrrex Member

    Joined:
    Apr 14, 2020
    Messages:
    3
    Likes Received:
    0
    Is it possible to use this in a java addon so I can create particles with that plugin?
    If not is there a possibilitie to create a method (dont know how this is called in a skript) and call this via my plugin?
     
  2. Moderocky

    Moderocky Master Magician
    Moderator Resource Staff Supporter Addon Developer Dev Programme

    Joined:
    Mar 12, 2017
    Messages:
    22
    Likes Received:
    23
    ...What?
     
    Runakai likes this.
  3. JAYJAYTEE

    Supporter

    Joined:
    Apr 10, 2020
    Messages:
    2
    Likes Received:
    0
  4. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    664
    Likes Received:
    45
    My guess he wants to make a class in the skript language and call the methods of it trough java. Now i am not gonna say no i am pretty shure its a no, but have seen allot of crazy stuff beeing created with skript lately.
     
  5. Vyrrex

    Vyrrex Member

    Joined:
    Apr 14, 2020
    Messages:
    3
    Likes Received:
    0
    Uhm sry I thought that this is only a page for the skdragon minecraft addon and I wanted to ask if I can create a "method" in a skript and call it via a java class. Sorry for confusing you.
     
  6. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    244
    Likes Received:
    22
    Pretty sure you can execute Skript functions through java. I've seen someone do it before, but I don't remember how.

    Check out the `ch.njol.skript.lang.function.Functions` class in the Skript source code.

    I believe Pikachu was the original maker of this, but here is code of executing functions in scripts. You can probably convert it to java for your needs.
    Code (Skript):
    1. import:
    2.     ch.njol.skript.lang.function.Functions
    3.     ch.njol.skript.lang.ExpressionList
    4.     ch.njol.skript.lang.function.FunctionEvent
    5.  
    6. effect call function[s] %strings% [with argument[s] %-objects%]:
    7.   trigger:
    8.     loop (...(raw expr-2).getExpressions()) if raw expr-2 is an instance of ExpressionList otherwise raw expr-2:
    9.       add loop-value.getArray(event) to {_params::*}
    10.     loop expressions 1:
    11.       set {_function} to Functions.getFunction(loop-value)
    12.       try {_function}.execute(new FunctionEvent(null), [{_params::*}] if {_params::*} is set otherwise null)
     
    #6 AsuDev, Apr 15, 2020
    Last edited: Apr 15, 2020
  7. Vyrrex

    Vyrrex Member

    Joined:
    Apr 14, 2020
    Messages:
    3
    Likes Received:
    0
    Thank you!
     

Share This Page

Loading...