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!
I'm a skript noob, i only know how to register basic eventsCan somebody make this?
Greets
package me.mindgamesnl.openaudiomc.publicApi;
import org.bukkit.event.Event;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
public class SoundEndEvent extends Event {
Player p;
String id;
public SoundEndEvent(Player player, String id) {
this.p = player;
this.id = id;
}
public Player getPlayer() {
return p;
}
public String getId() {
return id;
}
private static final HandlerList handlers = new HandlerList();
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
@Override
public void onEnable() {
Skript.registerAddon(this);
Skript.registerEvent("OpenAudio sound end", SimpleEvent.class, me.mindgamesnl.openaudiomc.publicApi.SoundEndEvent.class, "audio sound end", "audio sound end");
EventValues.registerEventValue(me.mindgamesnl.openaudiomc.publicApi.SoundEndEvent.class, String.class, new Getter < String, SoundEndEvent > () {
@Override
public String get(SoundEndEvent e) {
return e.getId();
}
}, 0);
EventValues.registerEventValue(me.mindgamesnl.openaudiomc.publicApi.SoundEndEvent.class, Player.class, new Getter < Player, SoundEndEvent > () {
@Override
public Player get(SoundEndEvent e) {
return e.getPlayer();
}
}, 0);
}
on audio sound end:
broadcast "the sound %event-string% ended for %event-player%"
You are just doing it wrong. Shouldn't you learn Java and Bukkit development first and take a look at Njol's JavaDocs?I'm a skript noob, i only know how to register basic events
....