#help-development
1 messages · Page 628 of 1
if a language has 2439840 keywords for convenience, then a language that doesn't is at fault for not doing so?
you scaled the number way too much, although, yes its the language's fault
it's a needed feature, brother
anything i should do with this?:
@Override
@SuppressWarnings("unchecked")
public <T> void addField(@NotNull String path, @NotNull CachedConfigField<?> cachedConfigField, @NotNull Class<T> Clazz) {
Class<?> typeClass = cachedConfigField.getValueType();
SerializationType<T> serializationType = (SerializationType<T>) SerializationHandler.getSerializationType(typeClass);
configuration.set(path, serializationType.serialize((T) cachedConfigField.getValue()));
if (cachedConfigField.hasComments()) {
configuration.setComments(path, cachedConfigField.getComments());
}
}``` it looks a bit bulky, i could always split this method too
i couldve said this the moment you gave me that code snippet
but if they do the same thing, why do both exist?
but you dont see me bitching bout it
nobody's stopping you from ending the convo?
i am ending it though
have a good rest of your day
imma continue working
Average SpigotMC conversation
real
mediocre java knowledge -> blames api -> "whatever" -> ends conversation
How can I access the datafolder from an external plugin? I already added it as a library and i can do this:
Worth worth = new Worth();
But it asks for a datafolder. How do I access the datafolder of EssentialsX
How? That's what i'm trying to find, and I don't find any documentation
Thanks!
get the instanct of their main class
I've been searching and their main class isn't exposed I think, or i'm just not searching the right way
Is there an easy way to check if a block type can be bonemealed? Couldn't find anything in org.bukkit.block
declaration: package: org.bukkit.block.data, interface: Ageable
probably not fool proof
the best way is making your own list
but like
it can depend
I'm going to check if applyBoneMeal has a success/fail check
for example crimson fungus is only bonemealable when planted on crimson nylium
ah, it returns true/false if it succeeds or fails
ah yes then you should use that
Thank you for the discussion :) Looks like I should've taken a closer look at the function
if i wanna have players have different names above their head and in tablist should i create a fake version of the player for tablist and unlist the real one or is there a better way? (using update player info)
Usually you would change how the profile of the player is perceived by changing the packets other players receive.
Let me double check how i did it last time because there is also a packet to update the info of a player on the run now.
smiles back
yeah there is a packet, but isnt the name above the head the same as the tablist one?
Yes if a client receives a profile packet then the name above a players head as well as the tablist name are
read by the client from the received profile about this player
so i should just create a new fake player with the tablist name and send an UPDATE_LISTED info packet to unlist the real one?
and about the fake player, how should i handle uuid's?
does that ONLY affect the tablist name?
Do you want to change the tablist name but not the players overhead name?
yeah
Ah i didnt catch that.
In that case you are right.
- Unlist original player [Player Info Update : 3 (update listed)]
- Create fake profile
- Send fake profile to all players [Player Info Update : 0 (add player)]
UUID doesnt really matter. You need to set the skin
texture if you want to have his face in there.
UUID doesnt really matter.
does it have to be different from the real player?
Well, the uuid does matter actually. Cant be the same as the original players iud
okay thanks for the help

also if i keep sending the fake tablist player
should i store the "fake" uuid and always use that (or maybe generate it from their uuid in a deterministic way) or just use a random one and remove the other fake one
does sending ADD_PLAYER on the same gameprofile cause issues or just replace the old one
Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', messages.getString("hypebox-opening-broadcast")
.replace("%player%",ChatColor.translateAlternateColorCodes('&',player.getDisplayName())).replace("%hypebox%",ChatColor.translateAlternateColorCodes('&', matchingHypebox.getName()))));
Why not make a method that sends msgs to a CommandSender and then just parse all the stuff there. Or use PAPI?
is there any way that i can attach custom executor for failing to fulfill with permission requirement of the command
like inject some kind of consumer or function
if pemission fails
Where is support?
?support
how can i disable tab completion for the command if i want to handle permission by myself (custom permission message)?
tab complete event id guess
tab complete only handles the tab completion of the args
PlayerSendCommandEvent seems to work in this case
but what if i add permission to the player
it gets desynced
ant it wont show up on tab completion
player.updateCommands
and how can i hook this?
just a player instance
declaration: package: org.bukkit.entity, interface: Player
ik its just when i should invoke this
after changing permissions
try {
Method m = Bukkit.getServer().getClass().getDeclaredMethod("syncCommands");
m.invoke(Bukkit.getServer());
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();
}
?
xd
Does Player#setPlayerListName(String) not work?
That only updates the tab Playerlist
I have this function running every 5 ticks as a part of my main thread.
String listingString;
String playerName = player.getDisplayName();
if (mobHead != null){
String headTypeName = Util.friendlyEntityTypeName(mobHead.getEntityType());
listingString = playerName + " (" + headTypeName + ")";
}else listingString = playerName;
player.setPlayerListName(listingString);
}
It adds a cleaned up version of "(EntityType.toString())" to the end of the player's name, or if MobHead == null, sets it back to the player's name with no extra.
This doesn't affect the player's namebar over their head
Why does it give me this? I want to migrate a plugin from 1.18 to 1.19.
As I understand it, this plugin is needed for compatibility, that is, it is not required.
The plugin wiki only wrote about ProtocolLib.
it has it as a depend not softdepend
?whereami
no that's now what im asking
what im asking how can i sync this method to the rest of the server's operations
my clients are seeing changed versions on the overhead name
they are not seeing the getName()
I think the scheduler has an option to run a method in the next tick
runTask()?
oh apparently UPDATE_DISPLAY_NAME only affects tablist
edit: it seems to not be the case, but ServerPlayer.listName is a thing so thats good
edit2: after looking more into it, UPDATE_DISPLAY_NAME just takes values from the displayName field (which is only used for tablist) and when creating new packets from a serverplayer, that value gets taken from ServerPlayer.getTablistName(), so essentially my first statement was right,
thats handy
thanks for the tip
I haven't done something like this before, but you could get their PersistentDataStorage and write a key with the String value of their custom name, and/or another key with their tablist name, then grab that value when assigning either/or
i can just send an extra UPDATE_DISPLAY_NAME action in my packet and just avoid all the hassle with fake players and uuids and allthat
Awesome 👍
Anyone knows why this happens in 1.20 and maybe even in the earlier versions such as 1.19.4?
Whenever Player#setDisplayName is used and when the player tries to write a message in chat, this error occurs:
https://pastebin.com/rdUgMLXw
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Do I need to install all these plugins? Which ones are in SoftDepend?
could it be if the file is in use?
Confirmed that this happens in 1.19.4 as well
lol
Class = async thread.
You can accomplish the same thing by wrapping code in the async scheduler… (BukkitRunnable is an abstract implementation of Runnable)
CoreProtect codebase dates back to 2010/hMod days though, before Bukkit even existed.
How do I access the EssentialsX API? I added it to my project, and when I import Essentials through import com.earth2me.essentials.Essentials; , i just get the following. I'm trying to make use of Worth values.
https://github.com/EssentialsX/Essentials/blob/db47460a7949c5686222b16feb3c5f4be2a8376f/Essentials/src/com/earth2me/essentials/Worth.java
I need to get access to the plugin instance, but I don't find where to access it.
Essentials ess = (Essentials) JavaPlugin.getPlugin(Essentials.class);
if I download plugin there it works. but if I downloading zip, and build artifacts it gives me error. why?
they changed something since the release
This has been fixed today
Honestly.mate cheers for replying and letting us know. That's legit interesting to know.
How would u feel about a small plugin jam esque challenge of trying to downsize the class with the same functionality, with the PR u accept winning? 😅😁
oo sick can you link me the pr?
Could be fun to do plugin jams just in general tbh
cheers
Yeah, I'm happy because this custom generator is critical to my server idea, was so sad when it didn't work haha
Improvements are always welcome, as long as you aren't breaking anything 😆
Main thing that probably needs to happen with that Lookup class is splitting it up into several separate classes. It's handling a bunch of different functionality right now.
yea I wanted to try and mess around with worldgen too and got stuck :p
That sounds like permission 🤣
Now what should the prize be 🤔
Hey, does anybody know how to solve the following error? https://pastebin.com/8KSMAndA - It's from ACF
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
anyone knows how i can do this
https://www.spigotmc.org/attachments/upload_2019-7-1_22-45-58-png.436386/
how is this possible?:
[13:01:34 WARN]: java.lang.ClassNotFoundException: net.minecraft.server.level.ServerPlayer```
isn't it built into paper? lol
or do i need to use spigot mappings
yep
need to use spigot mappings
nvm
hola
how would i make the player an EntityPlayer?
@EventHandler
public void onBlockBreak(BlockBreakEvent e) {
Player player = e.getPlayer();
try {
Class<?> entityPlayer = Class.forName("net.minecraft.server.level.EntityPlayer");
Method tabListMethod = entityPlayer.getDeclaredMethod("J");
tabListMethod.setAccessible(true);
Object tabList = tabListMethod.invoke(entityPlayer);
Bukkit.broadcastMessage(tabList.toString());
} catch (Exception exception) {
exception.printStackTrace();
}
}```
im doing this to learn this type of stuff
Imagine that you have a region, and you want to deny/allow placing/destroying of all/specific blocks for a certain player. How would you save such data to the config?
- I can't save over 10k materials to the config for every single player to their allowed-list,
- I could represent all materials with a special string, eg. @everything BUT, what if player wants to deny 1 block and allow everything else?
Any ideas?
Eg. how does worldguard handle this
solved this with ServerSendCommands event (it seems it syncs the command completion when i add the permission or the luckperms manually syncs it up, idk)
so basically i have permission agnostic access handler
which works with permissions too, but can exclude tab completion if the permission is set or not
player casted to craft player then getHandle
yes but how would i do it at this approach
since im doing Class<?>
EntityPlayer no longer exists in current nms
wrong way around
nooo
jni is so cool
player.getClass().cast(entityPlayer);?
player has to before a craft player then you can get entity player from get handle
the different mapping results
craft player is a spigot class
not a mojank class
org.bukkit.craftbukkit.nmsver.package.class
hmm
its versioned
eg in 1.18 and .1 its org.bukkit.craftbukkit.v1_18_R1.entitiy.CraftPlayer
oh bruh
bett
one more question
for this
would i do Mojang?
ima say no
because it says that method doesn't exist
If you want to run methods with reflection you'd use the obfuscated name
Don't forget to cache things
ye
this is just testing this
i'll make it better
:>
this a good way of doing this?:
public class NMSHandler {
private static final String BUKKIT_NMSPATH;
static {
StringBuilder path = new StringBuilder("org.bukkit.craftbukkit.");
switch (Bukkit.getVersion()) {
case "1.17", "1.17.1" -> path.append("v1_17_R1.");
case "1.18", "1.18.1" -> path.append("v1_18_R1.");
case "1.18.2" -> path.append("v1_18_R2.");
case "1.19", "1.19.1", "1.19.2" -> path.append("v1_19_R1.");
case "1.19.3", "1.19.4" -> path.append("v1_19_R2.");
case "1.20", "1.20.1" -> path.append("v1_20_R1.");
}
BUKKIT_NMSPATH = path.toString();
}
}```
any thoughts why am i having this issue? (img1)
public static String prefix = "§7[§x§1§0§f§b§e§a§lꜱ§x§1§d§f§4§e§d§lᴇ§x§2§9§e§d§f§0§lᴀ§x§3§6§e§6§f§3§lꜱ§x§4§3§e§0§f§6§lʜ§x§5§0§d§9§f§9§lɪ§x§5§c§d§2§f§c§lɴ§x§6§9§c§b§f§f§lᴇ§7] ";
Note, that i already tried translating color codes etc...
Info: java 17, 1.20.1 api, Player.sendMessage() method
How it should look like (img 2)
no
what should i do then?
sec
public static final String NMS_VERSION = Bukkit.getServer().getClass().getPackage().getName().substring(23);
private static final Method DEDICATED_SERVER = getMethod("org.bukkit.craftbukkit." + NMS_VERSION + ".CraftServer", "getServer");
private static final Method SERVER_LEVEL = getMethod("org.bukkit.craftbukkit." + NMS_VERSION + ".CraftWorld", "getHandle");
private static final Method SERVER_PLAYER = getMethod("org.bukkit.craftbukkit." + NMS_VERSION + ".entity.CraftPlayer", "getHandle");```
ty
getMethod is ```java
private static Method getMethod(@NotNull String clazz, @NotNull String method) {
try {
return Class.forName(clazz).getMethod(method);
} catch (NoSuchMethodException | SecurityException | ClassNotFoundException e) {
e.printStackTrace();
}
return null;
}```
👍
@eternal oxide you are expert no? :kekw:
set UTF to 8
in build.gradle or pom.xml
not using gradle/maven rn :kekw
just pure java
where is that tho
.
artifacts says hello
F
ALREADY DID, BUT DIDNT WORK
you cant fix that without setting UTF-8
you see there are 3 projects right 💀
see
Btw
does anyone have any insight on this because im really puzzled by this
unless im missing something obvious
If we want to sell a plugin for money we can upload a link to spigot to the website where they have to buy it this is allowed right
thats how plenty of premium plugins do it yeah
Like even if Ur account is new to spigot
Can't we upload the link to another website where 5hey buy it ?
if you mean you make a regular post with a link to your premium plugin then i think it would get deleted
Oh 😐
thats essentially advertising and avoiding the system spigot set in place
just get the requirements, its not hard
then you can upload premium plugins, or you can make a resource where the plugin is purchased from an external site
both work
Oh
8 week old ACC 😦
that gives you time to get the other requirements
uploading at least a couple free resources and getting 80 likes
80 likes isn't it 80 post
i might have misremembered but i thought it was 20 posts and 80 likes
replies also count as posts though so helping people out with dev stuff or answering questions is included
no
any forum post is counted
and since plugin updates are also posts, they are also included
so 80 posts isnt hard
ah so i switched those around
Meaning 20 ppl has to rate us 5 stars?
Then?
positive ratings are like the stars or hearts or informationals people give you
these
So even if they give 3 starts it wil counted as postive?
plugin reviews are not ratings
they mean post ratings like the ones in that image
Oh
and you're also fine to ask for a rating if you've helped someone out
some people do that in their signature but anything works
yeah
What they ask u when I try to upload a premium source other than the plugin info
really the only difference is that premium resources need to be accepted before they're available, and that has some rules on its own
Oh
like premium plugins arent allowed to be too simple, you cant use any type of advertising in your plugin description either
needs to look like you put some effort into it, code quality cant be garbage
but honestly keep your expectations low
premium plugins download about 100x less than free ones
depends on the plugin of course though
and it takes a lot of time to build up some popularity, but that goes with any plugin
i prefer to have many people use my plugin than a handful and get a couple bucks out of it
but maybe thats just me
Btw what withdraw options spigot offers
im developing something that i hope will be impressive and im releasing it for free, with a premium version that has a couple extra perks, and ill see if that works
im not sure actually let me check, think it was just paypal also
Hopefully
yeah just paypal by the looks of it
paypal is pretty convenient though so i'd just make one real quick
doesnt have paypal? like its forbidden?
It's not avalible I Pakistan
In*
If I will use external link option after I reach the requirements
Ig*
only paypal, spigot doesnt ever recieve money in the transation
its between you and the seller
how do I check when a player closes the sign and gets the input
https://paste.md-5.net/amorarokax.java
I made this to open the sign\
hi , anyone know how i can make this work ?
when i try to change it , its changed to :
color: color
the color
show how you save ur config
My country doesn't have PayPal
its multiple way's of saving data , i have mysql , sqlite , and yml ,
cant sell premium on spigot then
cant you use an external website to make a plugin available
i know mcmmo does that
Not even by using an external website
and use a payment method of your own
choco said before you cant have external download links on prem resources
fixed , ik what was wrong ..
bc someone would use that for drm
DRM?
like piracy protection, or selling the plugin on spigot then selling licenses to use that plugin
What if I use external website with free resources and then they have to pay for it after reaching requirements
is there any way in minecraft that renders the map in the player's hands? can i intercept this and load another map?
I'm making a random events plugin and one event I would like is a random structure (template) event. To get all available templates, I am using NMS like sojava ((CraftWorld) player.getWorld()).getHandle().getStructureManager().listTemplates()And this gives each template as a ResourceLocation. To get this as a Structure, I'll need to convert this ResourceLocation to a NamespacedKey, however ResourceLocation stores a namespace and a path, whereas a NamespacedKey uses a namespace and a key. I assumed a path and a key must just be synonymous, but I'm guessing not becausejava StructureManager.getStructure(new NamespacedKey(resourceLocation.getNamespace(), resourceLocation.getPath()))is always null. How do I correctly convert it?
hello i need help java: cannot find symbol symbol: class var location: class de.schlumpfkopf.bungeesystem.utils.OnlineTimeManager
Well ig I can't sell it through any websites not even polymart or any other 😦
Not smth that would work in Pakistan 😦
CraftNamespacedKey.fromMinecraft accepts a resource loc
Ah, thank you! 😄
Epicebic do you a website that offers anything other than PayPal
i know of a load of sites, no idea what payment methods they have
Can u list some
built by bit, spigot, hangar (idk about paid plugins at all), modrinth
mc plugins
Alr ty
Hm I'm still getting null which is strange. No errors, just can't seem to find the structure by the given key. Though, have just thought, not sure if StructureManager works with structure templates, so that might be a different thing
Edit: nvm docs literally refer to Structure as a template so I'm guessing they're synonymous in this context
are structures keyed
hello i need help java: cannot find symbol symbol: class var location: class de.schlumpfkopf.bungeesystem.utils.OnlineTimeManager can someone help me please
Btw I can upload spigot plugins on hanger assuming it's papermc?
probably
😦
Do u know any
Yes? That would be what StructureManager.getStructure(NamespacedKey key) would be for, and NMS stores them as ResourceLocations
An example of a key I'm getting is minecraft:village/taiga/streets/straight_05
Json be like
"{\"PREFIX\":\"&7[&fF&eI&cL&7]\"}": "UTIL",
"{\"LOBBY_LEAVE\":\"%PREFIX% &aYou left the Lobby!\",\"PLAYER_NO_PERMISSION\":\"&cYou do not have the Permissions required to execute this command!\",\"CREATE_LOBBY_SUCCESS\":\"yeet\",\"LOBBY_NOT_ENOUGH\":\"%PREFIX% &cYour lobby must have at least %MIN_PLAYER% players to begin a game!\"}": "LOBBY",
"{\"PLAYER_ALREADY_INGAME\":\"%PREFIX% &cYou're already in a game!\",\"PLAYER_ALREADY_INLOBBY\":\"%PREFIX% &cYou're already in a lobby!\",\"PLAYER_REMOVE_UNKNOWN\":\"%PREFIX% %REMOVE_NAME% &cEither doesn't exist, or is offline!\",\"PLAYER_NOT_LOBBY_OWNER\":\"%PREFIX% &cYou're not the owner of this lobby!\",\"PLAYER_NO_LOBBY\":\"%PREFIX% &cYou're not in a lobby!\"}": "PLAYER",
"{\"GAME_LEAVE\":\"%PREFIX% &aYou left the Game!\"}": "GAME",
"{\"ACCEPT_SENDER_NOLOBBY\":\"%PREFIX% %SENDER_NAME% &cisn't in a lobby!\",\"ACCEPT_RECEIVER\":\"%PREFIX% &aYou accepted %SENDER_NAME%'s &aInvite to a game of &cThe floor is Lava&a!\",\"ACCEPT_UNKNOWN_PLAYER\":\"%PREFIX% %SENDER_NAME% &cEither doesn't exist, or is offline!\",\"ACCEPT_NO_ARGS\":\"%PREFIX% &cName of sender needed. Usage: &f\\/fil game accept <playername>\",\"ACCEPT_NO_INVITE\":\"%PREFIX% %SENDER_NAME% &cdidn't invite you!\",\"ACCEPT_SENDER\":\"%PREFIX% %RECEIVER_NAME% &aaccepted your invite to a game of &cThe floor is Lave&a!\"}": "ACCEPT",
"{\"INVITE_SENDER\":\"%PREFIX% &aYou have invited %RECEIVER_NAME% &ato a game of %cThe floor is Lava&a!\",\"INVITE_FAIL_INLOBBY\":\"%PREFIX% %RECEIVER_NAME% &cis already in a lobby!\",\"INVITE_RECEIVER\":\"%PREFIX% &aYou have been invited by %SENDER_NAME% &ato a game of %cThe floor is Lava&a!\",\"INVITE_UNKNOWN_PLAYER\":\"%PREFIX% %RECEIVER_NAME% &cEither doesn't exist, or is offline!\",\"INVITE_USAGE\":\"%PREFIX% &cPlease enter the name(s) of the player(s) you would like to invite. Usage: &f\\/fil invite <playername(s)>\",\"INVITE_NONE\":\"%PREFIX% &cNo player(s) were invited!\"}": "INVITE"
just checked jds and i have a feeling spigot doesnt have a way to support paths like that, been as the tiaga village is just classed as a wholehttps://hub.spigotmc.org/javadocs/spigot/org/bukkit/generator/structure/Structure.html#VILLAGE_TAIGA
declaration: package: org.bukkit.generator.structure, class: Structure
quote escaping
That's what I was meaning when I said maybe structures and templates are different (in-game structures are the combination of several templates combines as a jigsaw), but the docs refer to a Structure as a "mutable template" so idk
how do i stab
gson?
that should do it
Its doing that tho
no idea then
hello i need help ```[23:08:34] [Application-Thread/WARN]: Exception encountered when loading plugin: BungeeSystem
java.lang.NoClassDefFoundError: org/json/simple/parser/ParseException
at de.schlumpfkopf.bungeesystem.BungeeSystem.initBungeeSystem(BungeeSystem.java:325) ~[?:?]
at de.schlumpfkopf.bungeesystem.BungeeSystem.onEnable(BungeeSystem.java:59) ~[?:?]
at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:316) ~[waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
at net.md_5.bungee.BungeeCord.start(BungeeCord.java:299) ~[waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67) ~[waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15) ~[waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at de.dytanic.cloudnet.wrapper.Wrapper.lambda$startApplication$5(Wrapper.java:487) ~[wrapper.jar:3.4.5-RELEASE-0f8f0d7]
at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.ClassNotFoundException: org.json.simple.parser.ParseException
at net.md_5.bungee.api.plugin.PluginClassloader.loadClass0(PluginClassloader.java:103) ~[waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
at net.md_5.bungee.api.plugin.PluginClassloader.loadClass(PluginClassloader.java:59) ~[waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.1-SNAPSHOT:ec41547:536]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
... 12 more
Looks like you're trying to use json simple without it being present in the server
What can I do now?
Im sorry, Im using 1.8, buts its not for me.
The scoreboard doesnt show up, no errors or anything, even put a sout, to check if the event runs, and it does.
package com.marqus.junglensb.Listeners;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Score;
import org.bukkit.scoreboard.Scoreboard;
public class BareScoreboard implements Listener {
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
/*
###################################################
FANGE SCOREBOARD
###################################################
*/
Scoreboard fangeboard = Bukkit.getScoreboardManager().getNewScoreboard();
Objective fboard = fangeboard.registerNewObjective("fangescoreboard", "dummy");
fboard.setDisplaySlot(DisplaySlot.SIDEBAR);
fboard.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&2&lJunglen.net"));
Score website = fboard.getScore("teeeeeeeest");
website.setScore(1);
player.setScoreboard(fangeboard);
}
}
[23:19:41] [Server thread/WARN]: at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
[23:19:41] [Server thread/WARN]: at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
[23:19:41] [Server thread/WARN]: at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
[23:19:41] [Server thread/WARN]: at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
[23:19:41] [Server thread/WARN]: at me.mraxetv.beastcore.utils.LibsManager.<init>(LibsManager.java:47)```
anyone can help with this
that lib doesn;t support the java version by the looks
Well I am making my custom loader
for external jars
but because of java 16 reflections
got changed
so I am looking for work around
avoid reflection if you can as it's so locked up in java above 11
well it is not possible to access protected method
Anyone?
What seems like a good way to make a player sleep in bed for a longer duration?
how do I check when a player closes the sign and gets the input
https://paste.md-5.net/amorarokax.java
I made this to open the sign
im just starting learning plugin development and i wanna know, if i just put this: ```import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.*;
import org.bukkit.event.Listener;
public class Test extends JavaPlugin implements Listener {
@EventHandler
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
Damager p = event.getDamager();
p.setHealth(0);
}
public void onPlayerBedEnter(PlayerBedEnterEvent event) {
e.setCancelled(true);
}
}``` into a jar file and put it on my server... will it work?
it won't
onPlayerBedEnter have no @EventHandler annotation and you also haven't registered your event listener
I got scammed by a famous author on spigot. I trusted him because he had a big resource. Am I able to report him somewhere to get him banned?
oh ok, but forget the code, if i just put a code like that on my server will it work or do i need a whole settup for it to work?
Im sorry, Im using 1.8, buts its not for me.
The scoreboard doesnt show up, no errors or anything, even put a sout, to check if the event runs, and it does.
package com.marqus.junglensb.Listeners;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Score;
import org.bukkit.scoreboard.Scoreboard;
public class BareScoreboard implements Listener {
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
/*
###################################################
FANGE SCOREBOARD
###################################################
*/
Scoreboard fangeboard = Bukkit.getScoreboardManager().getNewScoreboard();
Objective fboard = fangeboard.registerNewObjective("fangescoreboard", "dummy");
fboard.setDisplaySlot(DisplaySlot.SIDEBAR);
fboard.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&2&lJunglen.net"));
Score website = fboard.getScore("teeeeeeeest");
website.setScore(1);
player.setScoreboard(fangeboard);
}
}
what is "whole setup" ? You need spigot server, you just put your compiled jar in plugins folder
like, when you use an ide, it creates a whole workshop, but rn im not using one, im just using a single file with that code
and i know this will sound stupid, but how do i compile it lol
With maven or gradle, included with most ides
alright thx, im using VSC rn because i was coding in skript bruh
I got scammed by a famous author on spigot. I trusted him because he had a big resource. Am I able to report him somewhere to get him banned?
?support
Granted you obviously need proof
And even then idk if spigot will act on stuff that happens outside the platform
“Clarity method for getting the placed block. Not really needed except for reasons of clarity.”
clarity method
So no difference
Correct
Thanks xD
Im sorry, Im using 1.8, buts its not for me.
The scoreboard doesnt show up, no errors or anything, even put a sout, to check if the event runs, and it does.
package com.marqus.junglensb.Listeners;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Score;
import org.bukkit.scoreboard.Scoreboard;
public class BareScoreboard implements Listener {
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
/*
###################################################
FANGE SCOREBOARD
###################################################
*/
Scoreboard fangeboard = Bukkit.getScoreboardManager().getNewScoreboard();
Objective fboard = fangeboard.registerNewObjective("fangescoreboard", "dummy");
fboard.setDisplaySlot(DisplaySlot.SIDEBAR);
fboard.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&2&lJunglen.net"));
Score website = fboard.getScore("teeeeeeeest");
website.setScore(1);
player.setScoreboard(fangeboard);
}
}
How involved would it be to add a generateStructures method in the process? What I'm doing during generateCaves is causing issues with some of the vanilla generation. When I attempt to modify the data using the onChunkPopulate method, it causes enormous lag that I just can't accept.
I just need a call after chunk generation is finished, but before it is passed off from the chunk generator
Isn’t that what block populators are for
I'm not super familiar with how everything works tbh
If there's a way I'm just not seeing, I'd use that
Generally structure generation is done by populators
please stop sending this over n over again
Yeah I'm still having horrendous lag using this method
My structure is 1,024 blocks
Is it jigsaw based?
Jigsaw?
Jigsaw blocks
public class HeightLimitCapper extends BlockPopulator {
@Override
public void populate(World world, Random random, Chunk source) {
int top = world.getMaxHeight() - 1;
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
for (int y = top; y > top - 4; y--) {
source.getBlock(x, y, z).setType(Material.BARRIER);
}
}
}
}
}
Self explanatory
I see
Thus my question about a phase after structures
Doing that in the populate event shouldn’t be causing lag
Unless it’s for some reason forcing lighting to recalculate
I get a lot of these:
[16:51:49] [Server thread/ERROR]: Too many chained neighbor updates. Skipping the rest. First skipped position: -93, 319, 176
Well, then the whole server crashed
Doesn't like the populator method
Hello! Could anyone tell me why this happens?
Sign signData = (Sign) block.getState();
signData.getPersistentDataContainer().set(gsKey, PersistentDataType.BOOLEAN, true);
System.out.println(((Sign) block.getState()).getPersistentDataContainer().has(gsKey, PersistentDataType.BOOLEAN) + " 1");
System.out.println(signData.getPersistentDataContainer().has(gsKey, PersistentDataType.BOOLEAN) + " 2");
The first print returns false, but the second one returns true
This discrepancy is happening because of how and when the Bukkit/Spigot Minecraft server handles data changes to a Block.
When you call block.getState(), you get a snapshot of the block's data at that moment. If you modify that data, such as with signData.getPersistentDataContainer().set(gsKey, PersistentDataType.BOOLEAN, true), it doesn't immediately reflect in the actual block in the world; you need to explicitly update the block state for the changes to take effect.
However, the signData object you have is a local instance, and you've directly modified it. Therefore, when you check the PersistentDataContainer of signData, it does reflect the changes because you're checking the local instance that you've modified.
But in the first print statement, you're effectively getting a new snapshot of the block with block.getState() before you've updated the actual block, so it doesn't reflect the changes.
To get both print statements to return true, you would need to call signData.update() after setting the persistent data:
Sign signData = (Sign) block.getState();
signData.getPersistentDataContainer().set(gsKey, PersistentDataType.BOOLEAN, true);
signData.update(); // Update the actual block in the world
System.out.println(((Sign) block.getState()).getPersistentDataContainer().has(gsKey, PersistentDataType.BOOLEAN) + " 1");
System.out.println(signData.getPersistentDataContainer().has(gsKey, PersistentDataType.BOOLEAN) + " 2");
With this change, both print statements should return true.
hey
Ohh I see, I thought the update() method only applies changes visually, like the sign text
Thank you so much! 😄
boolean update()
Attempts to update the block represented by this state, setting it to the new values as defined by this state.
This has the same effect as calling update(false). That is to say, this will not modify the state of a block if it is no longer the same type as it was when this state was taken. It will return false in this eventuality.
Returns:
true if the update was successful, otherwise false
Try using setType(type, false) inside your blockpopulator
so I've cancelled the PlayerMoveEvent and player without any kind of passanger, can't get into the region. But with a horse or a boat they somehow glitch through? without being on the boat?? What is this? Is there a separate event for this?
Oh! That's a good idea!
this is so funny to watch
Please help xD
remote control boat plugin when?
Isn’t there a vehicle move event
we're getting into philosophical territory
Well, it takes 52 seconds instead of 30 to generate the world, but the server didn't crash
Improvements
Well, I'm just going to accept this for what it is. I'll just pre-generate chunks.
Figured it out
How would one read a custom config file that's in a custom place based on UUID?
I tried using the get method but it keeps resetting after restart and relogging. I can see the file has the correct values but as soon as I increase the int after restart or relog it goes back to one
can i use an arraylist in an inventoryclickevent on event.getrawslot?
hey is this the right event to catch ALL explosions in the world? creeper explosion, TNT, etc..?https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/ExplosionPrimeEvent.html
declaration: package: org.bukkit.event.entity, class: ExplosionPrimeEvent
how do you set the repair cost when creating an item stack?
wdym? xp in anvil?
No. Creepers are not considered Explosive to Bukkit
You probably want https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityExplodeEvent.html instead
can i use an arraylist in an inventoryclickevent on event.getrawslot?
yeah im trying to hide the "ENchantment Cost: 1" when renaming an item in an anvil. setting the repair cost of the item to -1 will remove it but i cant figure out how to do it.
can you send me your code=
Although I'm unsure if it actually updates in the client
I think the client calculates the same value as the server and shows what it assumes to be true
if you send the code i can probably help you
@mild sage may it be that your itemstack displayname doesnt appear as well=?
nameTag.setItemMeta(nameTagMeta);
im not quite sure how to help otherweise, there isnt much more to be seen, but your itemmeta isnt set up properly if i see it correctly
Is it possible to make a item pullable like a bow using Spigot?
i think not, you probably need mods
what do you want to program?
Yes, to make it so for example you can hold a piece of paper that is a custom model and use it to "unlock" a item when the animation is finished.
maybe with a texturepack and different nbt tags from item to item (im not sure, maybe works)
I have the item system done, I'm just asking if it's possible to make it look like its pulling like a bow.
probably not then
are you creating an rpg?
It's for a project that I'm creating for a client, so genuinely I have no clue.
how do i stop these guys from spawning with banners?
Lol
I made a plugin awhile back, when randomly zombies would spawn with leather chestplates and stuff, it's kinda cool actually xD
For survival, it's perfect
Btw which event fires, when a block is blown up by tnt/fireball/creeper?
BlockBreakEvent I'm guessing it isn't because there's only a method getPlayer?
worked thanks
@EventHandler
public void tntExplosion(EntityExplodeEvent e) {
List<Block> explodedBlocks = e.blockList();
}```
ty
yeah 
Hello im trying to make an npc but i cant slove the errors on pom
kinda hard to help if you dont have anything
Are you a cria
it says Plugin net.md-5 not found smh
dm
There is primedtnt event if you need it before. There ie blockexlode event. And there is entity explode event
just send here
i mean i cant
Alpaca are you a cria
how to convert handler "java" file to "class" file?
With a compiler
And then for fireballs i dont remember if they cause blocks to get damaged but there is a blockignite event with cause of fireball
U look like one, very smol
thx
who can help? I just already deleted the program... I can throw the file in pm.
lol
guys is the time complexity of array deque is the same for push vs pushLast operation?
i believe that it should move the elements by one by using push()
but im not sure if java makes some trickery internally
by definition of what a deque is, they should be the same
im trying to create a ClientboundPlayerInfoUpdatePacket through the FriendlyByteBuf constructor, but I don't know how exactly im supposed to do it.
writing the enumset, then using writecollection and inside writing uuid and looping through all actions to use their writer to write seemed to have worked, but that generated a packet that always had as many entries as it had actions. When inspecting packets generated by the server itself and not my plugin i noticed they had 6 actions (all the distinct possible actions) but only one entry, and the packet im trying to send really only requires one entry (it essentially had a List of repeat entries), but when trying to not be redundant and either just writecollection without a for loop or using a for loop and not writecollection gets the client disconnected by an internal exception (ArrayIndexOutOfBoundsException, StringIndexOutOfBoundsException, DecoderException, depending on how I tried writing it) and I essentially get no debug info neither in console or the mc client log about the exception.
how do i make an itemstack with a skull like this that uses the textures property thing?
do you mean what to write for the functions, or what to write for the parameters?
how to make the textures property or how to use it
idk im just trying to remake what this tutorial from 5 years ago has cus it doesnt work anymore
i need to figure out how to set the texture of a player profile
whenever i try this it wants me to implement all the methods but the methods it implements gives me 3 errors
is this a screen shot?
PlayerProfile?
i figured it out: you are supposed to use write collection to iterate over a singleton list of an entry and loop over the actions and use their writers
use google to find out how people do it today
now idk what wizardry writeCollection does to make it different from iterating over actions and just using writers, or the other like 4 "equivalent looking" solutions i tried
yes its a screenshot of a video
waait you are the one i talked for like 2h about mojang and the bans and allthat
yes
idk how it all started but i still havent figured out how to do the cem or whatever thing
yeah i know but, i think it was unsupported in 1.8.9
it's not unsupported
no, the thing i was trying to do, not cem itself
well then I can't tell you what it was
kinda getting off topic but i was trying to get a dragon head model to appear while someone wore it in 1.8.9
oh that you can't do
well yeah that, ill have to do it with modding somehow
items don't store NBT of that they're worn
theres a bukkit version
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Bukkit.html#createPlayerProfile(java.util.UUID)
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/profile/PlayerProfile.html
declaration: package: org.bukkit.profile, interface: PlayerProfile
declaration: package: org.bukkit, class: Bukkit
if i drop an item in version 1.16.5, it automatically hits & calls the PlayerInteractEvent -> Action.LEFT_CLICK_AIR (Action.LEFT_CLICK_BLOCK is not getting triggered). If i cancel the itemdrop event, it wont cancel the call to PlayerInteractEvent, how i can disable the hitting
sorry for this weird question
& also its hitting while clicking custom inventory's
🫡
is there anyway to get player's skull texture link?
(http://textures.minecraft.net/texture/) this one
You can do it with API now
OfflinePlayer player = Bukkit.getOfflinePlayer(UUID.fromString("blah"));
player.getPlayerProfile().update().thenApply(PlayerProfile::getTextures).thenAccept(textures -> {
URL texturesURL = textures.getSkin();
// Do with this what you will
});```
Not really. That'd be up to you to parse out of the image
If you're doing this for skulls you can set SkullMeta#setOwningProfile()
choco go to bed
List<Location> locations = new ArrayList<>();
List<Location> finallocations = new ArrayList<>();
int V1 = 180 * (corners-2);
int V2 = V1/corners;
for (int i = 0; i < V1; i += V2) {
double x = radius * Math.cos(Math.toRadians(V2));
double y = center.getY();
double z = radius * Math.sin(Math.toRadians(V2));
// Rotate the circle around the center based on yaw and pitch
Vector rotated = new Vector(x, y, z).rotateAroundY(-yaw).rotateAroundX(pitch);
Location location = center.clone().add(rotated);
locations.add(location);
}
for (int i = 0; i < corners; i++) {
if (!(locations.get(i + 1) == null)) {
finallocations.addAll(drawLine(locations.get(i), locations.get(i + 1), 50));
}
}
return finallocations;```
```Caused by: java.lang.IndexOutOfBoundsException: Index 4 out of bounds for length 4
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[?:?]
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[?:?]
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) ~[?:?]
at java.util.Objects.checkIndex(Objects.java:361) ~[?:?]
at java.util.ArrayList.get(ArrayList.java:427) ~[?:?]
at austxnsheep.bosscore.Particles.ShapeCreator.drawPolygon(ShapeCreator.java:36) ~[austxnsheep-1.7.jar:?]
at austxnsheep.bosscore.CustomMoves.PiglinMoves.test(PiglinMoves.java:122) ~[austxnsheep-1.7.jar:?]
at austxnsheep.bosscore.Commands.Boss.onCommand(Boss.java:52) ~[austxnsheep-1.7.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]```
I'm not too sure how to fix this, anybody up to help?
OutOfBounds exception.
Oh let me add in the drawLine function
nvm I'll just explain it.
it returns a list of locations. I know it works, and I have tested it out.
?jd-s
umm can someone help me i just created a new project and its like red ;-;
do u have the right jdk and right spigot api selected
It's because you added project to git
Red means file is not committed yet
ah thanks fixed
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
if(commandSender instanceof Player){
Player player =(Player) commandSender;
ItemStack reward = player.getItemInHand();
if(reward == null){
player.sendMessage(ChatColor.RED + "You dont have anything in your Slot");
}else{
}```how can i so when they run the command the crurenc item in their slot set as the reward
so
iam basically making an killreward
plugin
when ever a player types the command it makes the current item in his slot the reward and when someone kils an palyer it drops that reward
iam stuck on how to set the reward and use it on otther class playerdeathevent
do u want to save it to the config?
okay
okay
so
in ur main class
add this:
public static <name of plugin> getPlugin() { return plugin; }```
public static <name of plugin> plugin;
add that above it
in the onenable and on disable add this: this.saveConfig();
back in ur commands
But have you
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
if(commandSender instanceof Player){
Player player = (Player) commandSender;
ItemStack reward = player.getItemInHand();
if (reward == null) {
player.sendMessage(ChatColor.RED + "You dont have anything in your Slot");
} else {
FileConfiguration config = <name of plugin>.getPlugin().getConfig();
}```
now
which line is ShapeCreator.java:36
save the reward in the config
Bouta find out
finallocations.addAll(drawLine(locations.get(i), locations.get(i + 1), 50));
this one
and from there use the death event to get the killer and target and figure it out from there it should be insanely simple
}else{
FileConfiguration config = KillReward.getPlugin().getConfig();
}
}
return true;
}
}``` ?
wdym
is that correct ?
just use the config to save the details of the reward
and make an event
and do the rest
your locations does not have the expected amount of elements
and in main class
should be super simple
public static KillReward plugin; public static KillReward getPlugin() {
return plugin; }````
Yeah but that shouldn't happen because of the if (!(locations.get(i + 1) == null))
It Should atleast, stop it once it reaches the end of the list
get the details u need from the reward item and save it to config with config.set
how to set the reward
use the playeruuid in the name
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
idk what to say
it should throw IndexOutOfBounds on this line then
Can you just print the content of the array just to be sure it has the elements you expect it to have ?
reward.setType(config);?
Good Idea, I'll try that.
also, testing it like this seems wrong
The element should never be null, if it does not exist then it throws exception as I said
So check it by size instead
I'm really not sure. It's the only thing stopping me from making circles and triangles and shi for my boss
hey, is it advisable to create a click event separately for each inventory GUI slot?
Actually I'm finna test this out tommorrow.
uhmmm no ?
yea i read this
this is why i want know
this good or bad?
in terms of optimization
I would advise against making multiple event listeners when you don't have to...
wait, if the source of the listener is 1 and there are classes that got its objects, is it still 1 listener?
I don't think I understand
in this tutorial there is 1 listener but there are several classes and they all accept its objects
does that count as 1 source?
only the GUIListener handles the events
It then distributes them as it needs to.
It is less work then to register them per gui and then having to unregister it.
You should use this method from BlockPopulator, it has better performence.
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/generator/BlockPopulator.html#populate(org.bukkit.generator.WorldInfo,java.util.Random,int,int,org.bukkit.generator.LimitedRegion)
declaration: package: org.bukkit.generator, class: BlockPopulator
ok I dont understand. BlockExplodeEvent should handle all explosions to prevent block damage right?
I can just cancel the damage to all blocks, the explosion has done, with cancelling the event
No it is called when a block (e.g. bed or respawn anchor) explodes
What event can I use for my problem
There's also EntityExplodeEvent for creepers and tnt
What if I want to enable explosions and just cancel the damage to blocks
You take both events and clear the affected blocks
just do event.blockList().clear()
of course. Clearing also modifies it
It's a mutable collection
should have worked right?
if your if statements all result in true, yes
and obviously you have to do it on both events
Pretty sure that blockList isn't concurrent and that you'd thus have an error
Use iterators instead
I've fixed it, works now :D
Nice👍
You already been told to learn java at least 25 times, and you still refuse to try and find something yourself
pass ur Config instance (or what i do, ur plugin instance) with dependency injection
new profile PIC 
i LIKE it
new username too :p
Im running Paper 1.8.8, its for my client.
No errors, the event runs cause I used sout, but the scoreboard doesnt show up
package com.marqus.junglensb.Listeners;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Score;
import org.bukkit.scoreboard.Scoreboard;
public class BareScoreboard implements Listener {
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
/*
###################################################
FANGE SCOREBOARD
###################################################
*/
Scoreboard fangeboard = Bukkit.getScoreboardManager().getNewScoreboard();
Objective fboard = fangeboard.registerNewObjective("fangescoreboard", "dummy");
fboard.setDisplaySlot(DisplaySlot.SIDEBAR);
fboard.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&2&lJunglen.net"));
Score website = fboard.getScore("teeeeeeeest");
website.setScore(1);
player.setScoreboard(fangeboard);
}
}
n set a banner lol
"hnnh444" impressive xDD
help using async runnables and CompletableFuture
Anyone who can help here.. please?
Did you register events
Yes
I've been spending so much time to try get it to work.
I'm not too sure about scoreboards, sorry
its okay
bro i cant find that in java docs as well smh
okie doki
Anyone?
Because that is basic, not java, but oop knowledge
example:
// config.yml
motd: "Hello, %PLAYER_NAME%!"
// YourPlugin.java
public class YourPlugin extends JavaPlugin {
@Override
public void onEnable() {
saveDefaultConfig();
getServer().getPluginManager().registerEvents(new PlayerJoinListener(this), this);
}
}
// PlayerJoinListener.java
public class PlayerJoinListener implements Listener {
private final YourPlugin plugin;
public PlayerJoinListener(YourPlugin plugin) {
this.plugin = plugin;
}
@EventHandler
private void onPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
player.sendMessage(plugin.getConfig().getString("motd").replace("%PLAYER_NAME%", player.getName()));
}
}``` @chilly hearth
and judging by @hazy parrot
?learnjava!
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
setting up a dev env, will try n help in a sec
disclaimer: ive never worked with scoreboards yet, so give me a bit
if i do save config of bansconfig after that code below, will it save list with removed ban entry?
No, you have to set it first
i understand @buoyant viper thiing
That is good to hear 👍
;-;
by itemstack ?
like, getServer().createBlockData(Material.GRASS_BLOCK) ?
thanks 😄
Material.GRASS_BLOCK.createBlockData
or that :P
i was gona say the same xd
👍
yes
nice, i ported my scoreboard test to 1.20.1 and now I cant see the scoreboard, dafuq?
oh, its in my tablist, what the fuck

what the heck did you do to get it to display 1 / 20
this
oh you did do a prefix ok
was vaguely trying to follow https://www.spigotmc.org/wiki/making-scoreboard-with-teams-no-flicker/ with the scoreboard code from marcus lol
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
oh i see what im doing wrong i think
oh you set the prefix of the team and you have the player in that team
ofc the player would have the prefix
im also not getting the score properly it looks like
lol
i only setPrefix, not getScore()
yeee
also woops i guess i see why they use ChatColors lol
alternatively i can use it to my advantage, woo
is formatting not retained between prefix/text/suffix
I don't think it is
i think they might be components internally so it makes sense if they dont actually
solved by just setting color and using some formatting in the prefix n suffix :P
Well everything should be components on 1.20, besides splashes.txt and something else I think
Legacy formating will be removed in the future if I remember correctly
everythings been components for a while :P
internally at least, not so much on spigot side
yeah~
Still waiting for that PR Choco <3
Maybe the end poem is still not components as well
Will be changed in the future tho for sure
Maybe. Depends if there is a need to do that
Well if they want to scrap the whole legacy § formatting, then there would be I assume
who got plugin ideas
Everyone
lmk!!!
Better question is. Who has good plugin ideas
do u?
Probably
Could always make some use of the demo components
Pretty nifty you can use those as a form of title screen for your server
I have an idea:
Veinminer but only for Efficiency V wooden pickaxes
Is it good ? probably not
why tho
u cant even mine diamonds
exactly 😈
never heard of a demo component
It has always existed in mc part of the demo game but you can use its stuff in survival
Well there is no api for it
...
But its all the little window stuff that pops up when playing demo
advice on how to make a.... solid line?
Including the demo over screen
minecraft demo?
custom font with resourcepack
maybe &m with empty chars?
the thing is theyd have no width wouldnt they
who knows
It needs a shift to the left
Its off center
yeah lol
yeah... centering text in MC is "impossible" sadly
Unless you force the players to use a resourcepack
Just use some custom fonts for it
yeah... you need a resourcepack for that lol
Can fix the spacing by making some fonts two spaced or one
the thing is: even if you center the text perfectly, some players might have a resourcepack that completely fucks the default font
So I say: don't worry about centering that much
No one cares if they use unsupported textures
i can live with this ig, wish i could get rid of the #'s
use lunar for client side fix

Welp time for me to clock out from work and head home 
woo
im making a plugin that should work from 1.8 to 1.20 how do i check the mc version
so i can disable some stuff
what is the point on this except the saturation lol
You could use this https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Server.html#getVersion()
declaration: package: org.bukkit, interface: Server
i think u can see saturation in then ews versions anyway
ty
for fun
not w/o mods
maybe but the irl time so people can know when its time to touch grass
ok it returns a string
what do the server strings look like
im guessing 1_16_5 ?
for example
I don't know for sure.. they are all in the same format
Play around with it
Or maybe winnpixie knows? xD
its just for my SMP so it doesnt particularly matter what i add 2 it
for what
what is the format of server version, in a string
declaration: package: org.bukkit, interface: Server

should be the same as /version
making it a string is kind of a stupid implementation
based on the doc
Gets the version string of this server implementation.
I think it's the only option you have
Unless if you write your own wrapper
and handle it
no you could have a ServerVersion object
and what attributes would it have
getVersion and getBukkitVersion
you can get rid of the numbers using resource pack
check if the server is higher then like 1.16 for example
dont feel like using RP so will just leave it as is probably
cuz this way you have to check more then once
ah ok
if u want server version u could substring to indexOf("MC: ") + 1 probably
i don't see why utility for version check would be inside of spigot api ¯_(ツ)_/¯
and remove the trailing )
why not
It's best if you write your own wrapper for this. you can use it in every plugin
yeah'
i mean the server doesnt need to care if its < or > tbh, it only cares about current version
but if u believe spigot needs one, submit a feature request or a PR
does java support operator overloading?
dont think so
that sucks.. :(


string concatenation?
you can't overload operators yourself
^, i was assuming spexx was asking if u could add ur own :P
Yes I was
Like in c++ 🙂
You can do a pr
prrrrrrrrr
what is up with this
?

you're not helping
idk
ye, I get that but..
Why
schnitzel shouldn't be questioned
#general message it all starts here @smoky anchor
my ide just crashed for the first time in ages
Pull request
Did you open Material.class ?
How to find out what blockface a player is looking at?
dude it keeps crashing wtf
why would i make pull request lol
read again what i said, u seem to be misunderstanding
Whats the problem here?
probably old api
its working for my other plugin, though this plugin is for 1.12
1.12 doesn't have Hex colors
so that code can just be removed
e
Guys, i have a question. What would be the best way to get all the green wool, while looking at the blue wool? I put a max size of 9
The wool is just a representation of the funcionality, it isnt what i really need
Just need the blocks
well, 3x3 if possible, but imagine if the wall is 2x3 it should only get 2x3, but if the wall is 1x9, it should select all 9
oh that's weird
Do you get what i mean?
You want like a flood-fill with a distance limit
i'm trying to make a build tool
You could chek around the block
I already have like the initial block
if there is a valid blokc at -x
or at -y
if so
then you continue
until either youve reached max
or theres no more valid blocks
yeah, but i'm not sure how to do it for when i get past the blocks next to the center. I want to prevent something like this:
yeah, but i'm not sure how to do the selection, in this image all blocks are next to eachother, but not all are closest to center. this one should be like this:
The green and blue isn't real, its just a representation of what i want to select
And the blue is the point im looking
Then you can check around the center with a radius
and not follow the single block
but id only do that until a certain size
further then the 2 distance from center id just follow one
How can I convert a org.bukkit.ChatColor object into a org.bukkit.Color one?
Need to use Firework.withColor(Color)
wouldn't that just be hardcoding the values?
the chatcolor won't be always the same
Where is the ChatColor coming from
What correlation does chatcolor have with color
Thats what im asking
I'm doing some changes to an already existing plugin that uses ChatColor to define a team's representing color
ok
I see
Idk use a switch statment
Yeah, guess i'll have to do that
Or a map
why isnt this working?? O.o
nope
you dont have to
@hallow jackal
take given color
.asBungee()
then .getColor()
will return the color tpye ur looking for
Ur not in ur main class
Cant I make it outside of the main?
You can
with instance of main right?
but then oyu need MainClassName.getInstance().getConfig()
that does return java.awt.Color not org.bukkit.Color sadly
wait