Resource icon
  • 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!

Pikachu

Supporter
Addon Developer
Jan 25, 2017
870
144
43
USA
Pikachu submitted a new resource:

Ersatz - Make your own PlaceholderAPI placeholders with Skript

Ersatz allows you to use and create PlaceholderAPI placeholders within Skript

Example usage:

Making custom placeholders:
Code:
on placeholder request with prefix "custom":
  if the identifier is "hey": # %custom_hey%
    set the result to "hi there %player%!"
  else if the identifier is "bye": # %custom_bye%
    set the result to "bye bye %player%"

Getting the value of a placeholder:
Code:
on join:
  set {_ping} to placeholder "player_ping" # placeholder...

Read more about this resource...
 
Placeholders created with this addon can be used in other plugins that have placeholderapi implemented? or only can be used in scripts?
 
Placeholders created with this addon can be used in other plugins that have placeholderapi implemented? or only can be used in scripts?
They can be used in any PlaceholderAPI compatible plugin
 
  • Like
Reactions: ELROX
is %player% in the placeholder request the viewer or the relational person its parsed for? if its the viewer, can you add support for this but also for the relational person if it is called with a relational person? (like player views message from tablist and wants to see the color of that persons name, not the player's color)

edit for reference: it is already relational
 
Last edited:
is %player% in the placeholder request the viewer or the relational person its parsed for? if its the viewer, can you add support for this but also for the relational person if it is called with a relational person? (like player views message from tablist and wants to see the color of that persons name, not the player's color)

edit for reference: it is already relational
The player is whatever PlaceholderAPI provides me as the player. Usually, this is the person viewing the placeholder, however, I do not have control over what this value is.
 
> [13:45:34 INFO]: [Ersatz] Enabling Ersatz v1.0
> [13:45:34 ERROR]: Error occurred while enabling Ersatz v1.0 (Is it up to date?)
ch.njol.skript.SkriptAPIException: Registering is disabled after initialisation!
at ch.njol.skript.Skript.checkAcceptRegistrations(Skript.java:908) ~[?:?]
at ch.njol.skript.Skript.registerAddon(Skript.java:930) ~[?:?]
at com.pikachu.papiaddon.Main.getAddonInstance(Main.java:41) ~[?:?]
at com.pikachu.papiaddon.Main.onEnable(Main.java:26) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[server.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [server.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:407) [server.jar:git-PaperSpigot-"4c7641d"]
at com.rylinaux.plugman.util.PluginUtil.load(PluginUtil.java:366) [PlugMan.jar:?]
at com.rylinaux.plugman.command.LoadCommand.execute(LoadCommand.java:114) [PlugMan.jar:?]
at com.rylinaux.plugman.PlugManCommandHandler.onCommand(PlugManCommandHandler.java:95) [PlugMan.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) [server.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:146) [server.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:666) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1189) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1001) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [server.jar:git-PaperSpigot-"4c7641d"]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_212]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_212]
at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:774) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [server.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [server.jar:git-PaperSpigot-"4c7641d"]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
> [13:45:34 INFO]: [Ersatz] Disabling Ersatz v1.0


not working
 
Hey. I try to add placeholders to a embed with Vixio, but my placeholders need a player. I also try using loop all players, but that doesn't seems to work. Can i do it on another way without looping all players or set the variables, when a player joins or something like that? It may not be Vixio, because when i try to use placeholders in a event like every x minutes, the placeholders need a player.
 
According to the devs of PlaceholderAPI (hereafter known as PAPI), the plugin needs updating. I am not using the latest version of PAPI, as I have not had the time to update it (though PAPI is not latest, it still gives this error). Here's the error it gives me:
Code:
 Ersatz is currently using a deprecated method to hook into PlaceholderAPI. Placeholders for that plugin no longer work. Please consult [Pikachu] and urge them to update it ASAP.
I can confirm that is the case.

Side note: this is the only error that pops up concerning PAPI and Ersatz.
[doublepost=1575422251,1575390196][/doublepost]
Hey. I try to add placeholders to a embed with Vixio, but my placeholders need a player. I also try using loop all players, but that doesn't seems to work. Can i do it on another way without looping all players or set the variables, when a player joins or something like that? It may not be Vixio, because when i try to use placeholders in a event like every x minutes, the placeholders need a player.
If it's a Discord command you are creating, it can't use player placeholders from a server, as the command (or event) is not being run from the server but the Discord. What you might be able to do is create a method that will save the player's name (preferably, their UUID) to a variable, and then call the variable. Here's an example:
Code:
on join:
        set {name.%player%} to player
        if {%player's uuid%::*} doesn't contain {name.%player%}:
                add {name.%player%} to {%player's uuid%::*}
This will not only set their playername to a variable, but also add their playername to a list variable, so you can see a list of the player's previous names. I hope this helped, as your statement was a bit confusing. An example of your code would've been helpful.
 
Last edited:
  • Like
Reactions: HippieSavage
According to the devs of PlaceholderAPI (hereafter known as PAPI), the plugin needs updating. I am not using the latest version of PAPI, as I have not had the time to update it (though PAPI is not latest, it still gives this error). Here's the error it gives me:
Code:
 Ersatz is currently using a deprecated method to hook into PlaceholderAPI. Placeholders for that plugin no longer work. Please consult [Pikachu] and urge them to update it ASAP.
I can confirm that is the case.

Side note: this is the only error that pops up concerning PAPI and Ersatz.
[doublepost=1575422251,1575390196][/doublepost]
If it's a Discord command you are creating, it can't use player placeholders from a server, as the command (or event) is not being run from the server but the Discord. What you might be able to do is create a method that will save the player's name (preferably, their UUID) to a variable, and then call the variable. Here's an example:
Code:
on join:
        set {name.%player%} to player
        if {%player's uuid%::*} doesn't contain {name.%player%}:
                add {name.%player%} to {%player's uuid%::*}
This will not only set their playername to a variable, but also add their playername to a list variable, so you can see a list of the player's previous names. I hope this helped, as your statement was a bit confusing. An example of your code would've been helpful.

I have this problem too. Plugin needs to change hooking method.
 
According to the devs of PlaceholderAPI (hereafter known as PAPI), the plugin needs updating. I am not using the latest version of PAPI, as I have not had the time to update it (though PAPI is not latest, it still gives this error). Here's the error it gives me:
Code:
 Ersatz is currently using a deprecated method to hook into PlaceholderAPI. Placeholders for that plugin no longer work. Please consult [Pikachu] and urge them to update it ASAP.
I can confirm that is the case.

Side note: this is the only error that pops up concerning PAPI and Ersatz.
[doublepost=1575422251,1575390196][/doublepost]
If it's a Discord command you are creating, it can't use player placeholders from a server, as the command (or event) is not being run from the server but the Discord. What you might be able to do is create a method that will save the player's name (preferably, their UUID) to a variable, and then call the variable. Here's an example:
Code:
on join:
        set {name.%player%} to player
        if {%player's uuid%::*} doesn't contain {name.%player%}:
                add {name.%player%} to {%player's uuid%::*}
This will not only set their playername to a variable, but also add their playername to a list variable, so you can see a list of the player's previous names. I hope this helped, as your statement was a bit confusing. An example of your code would've been helpful.
I have this problem too. Plugin needs to change hooking method.
Use this fork of Ersatz : https://forums.skunity.com/resources/skript-placeholders.909/