#help-development
1 messages · Page 1729 of 1
why am I always typing them instead of then lol
What ip address of the server?
which server?
so you want spigotmc mc server idk if that exist
yes
lol why are you asking that in developtment channel here we are helping with code
are you creating a plugin?
Nope
yes
is it possible to make the structure block outline in the spigot api?
i think i found it, i think it's called BoundingBox
I think you have to tell the client there's a structure block somewhere, and have that block's data be the bounding box you want.
https://www.spigotmc.org/threads/show-structure-block-bounding-box-in-survival-with-plugins.200056/
the white line outline is called a bounding box, right?
yeah but the org.bukkit.util is different
There was a recent structure block API added just a couple days ago
Though whether or not that actually displays any bounding box is beyond me. I'd guess not
Hello! I've been trying to run buildtools 1.12.1 but when I start cloning it stops with the error 'You are using Java 16, use Java 8 or 9 to build this version' (Just lazy to copy paste) anyways, I have Java 16 and Java 8 Both installed is there anyway to select the Java 8 so it can use it to build or not?
I can just delete Java 16 build it then install it back but I've been wondering if there is a way to let it build on Java 8 instead of Java 16
Guess I'll just delete Java 16..
change ur path to point at the java 8 install
Too late xD
Thank you anyways.
Hi! I'm quite new to spigot and i can't figure out how to create a list of strings and then use it in this case:
It would be a list of words to block
You would have to check each word
Easiest way is to just loop through a list of strings checking if the message contains any of them
Most efficient way is to use a prefix tree
Beware of uppercase letters
Hey! i'm trying to create a folder that contains files but the folder doesn't create, could anyone help me?
here's the code:
https://paste.md-5.net/ewoqotatoh.java
what?
how can i make a cosmetic explosion
but in another class, it worked
isnât there a method under world?
hmm i think there was a boolean that turned it off
there are only 2 booleans on createExplosion
oh yeah fire and block break
maybe set the power to 2?
hmm
cool
Loop nearby players and damage them
no annotation on the event
but in other class, it created a carpet
well, the name wasn't the UUID
not annotated
wdym?
Eventhandler
annotate @Eventhandler
wdym with annotate
your event is not annotated with @Eventhander
He doesnât know what an annotation is
I guess
Show him a pic
^^
nope, he's done it before
I would but on phone xD
and I'm eating
but, i don't understand what are you saying
You should learn Java first @acoustic pendant
No, only for things of computational significance, file and database access
correct
use Futures
it will not wait. but you can define what happens when it gets the result
CompletableFuture.supplyAsync(() -> {};)?
no?
You know what annotations are adri
no?
you have done other listeners
all event listener methods have an annotation of @EventHandler
so, what's the problem with @EventHandler?
You tell me whats wrong with it https://paste.md-5.net/ewoqotatoh.java
Can event listener methods be static?
no?
Then why is yours static 
well, but still doesn't create nothing
have you added the annotation yet?
I have told you multiple times what an annotation is. I've told you all event listener methods require one, and I've linked you to a tutorial for beginners on using the Listener.
I still don't know what are you talking about.
is it not enough with @EventHandler?
YOU DON'T HAVE IT!
I literally have it
not in the code you posted https://paste.md-5.net/ewoqotatoh.java
get rid of ALL the static
add a constructor and pass an instance from yrou plugins main class.
you are already instancing this class in your onEnable, so pass it
I added a simple queue system for SQL commands to be executed on an async thread. The goal of it is to limit the amount of total sql calls per tick on a single async thread instead of tens of thousands of separate async threads. I simply need to add a string to the "queueSQLCommands" ArrayList for it to pick it up and send it to the SQL.
Is there a better way to do this? Or is what I'm doing fine?
public void beginSQLQueue() {
new BukkitRunnable() {
final ArrayList<String> queue = queueSQLCommands;
int total = 0;
final int limitPerTick = 10;
@Override
public void run() {
if (!serverRunning) {
cancel();
} else {
for (int i = 0; i < limitPerTick; i++) {
if (queue.size() == 0) {
break;
} else {
try {
YuCraft.MAIN_CLASS.SQL.getConnection().prepareStatement(queue.get(0)).executeUpdate();
} catch (SQLException e) {
Bukkit.getLogger().info("Error executing: " + queue.get(0));
e.printStackTrace();
}
queue.remove(0);
total++;
if (total % 25 == 0) {
Bukkit.getLogger().info("Queue executed " + total + " times.");
}
}
}
}
}
}.runTaskTimerAsynchronously(this, 0, 1);
}
Hey, I would like to know how could I basically know if a block should be affected from an explosion (especially the "native liquid protection" thing) but I can"t think of a way of doing it đ
(One way of doing it would be to be able to make obi appears in the inital blocklist from the ExplodeEvent, but I couldn't find anything that would allow it in spigot config)
I am 99% I fixed the problem but still same error
Hey
Can some1 help me code a plugin by any chance
Can you add me and I can show u
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Create a thread in case the help channel you are using is already in use!
it means enchantment is null
Main.java, line 77
huh?
are you it is the line 77
probably it is like item.addUnsafeEnchantment()
send the whole code please
?paste
you can't get a "Enchantment is null" exception when making an arraylist
glow is null
glow is null
you're calling addUnsafeEnchantment(glow) before calling new Glow()
Also using suppresswarnings for your bad code isn't a good solution
Neither is making everything static
Naming your class Main doesn't tell anything, as there are 200 other Mains
And using reflections to access public methods on a specific class is just dumb
you're sacrificing performance by not using OOP
And potentially crashing servers due to memory leaks
You're also repeating code... a lot
and making everything in 1 class
read
you are calling
registerEnchantment(glow)
``` the name of the parameter in your function is `enchantment`
change line 64 to
```java
registerEnchantment(enchantment)
or you can replace line 29 (registerEnchantment(glow = new Glow());)
with
glow = new Glow();
registerEnchantment(glow)
``` but if you do that having the `enchantment` parameter in your method is pointless
Quick question, How do i add color codes to my configuration messages?
you need to either add them using the ChatColor enum, like so;
player.sendMessage(ChatColor.RED + "hello"); // this will send "hello" in red
or use ChatColor.translateAlternateColorCodes(char, String) like this:
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&chello"); // this will also send hello
you cant use the bukkit api asynchronously
you will have to make like a task queue which runs whatever task you want
you can use it for sql access though
np
@glossy ventureThe thing is, all messages are configurable through the configuration file.
Does that mean i have to alternate every message?
yes
just call that translate method on every message
from your configuration file
np
u can do something like this
public static String t(String s) {
return ChatColor.translateAlternateColorCodes('&', s);
}
to make it faster
just call t(<message>) on everything
instead of that long function call
@maiden mountain
@glossy ventureYeah that makes it way cleaner, thanks bro
np
re send code plz
you are trying to add a null enchantment to an item
so im assuming that you forgot to instantiate the glow field
use this in your onEnable:
glow = new Glow();
registerEnchantment(glow);
i think this might be the problem
you are calling loadRecipe before glow is created
put it after
Hell yeah, got it working
nice
Appreciate the help brother
no problem
quick ez question
send the code in your Glow class Glow.java
yes?
what do the parameters in
location.getWorld().spawnParticle(Particle.REDSTONE,location,1,1,1,1,1,1 );
mean
?jd-s
depends on the particle
Pretty sure it does tell ya
the parameter names will help
but it depends on the particle
what some of the values do
if i did redstone
so i recommend getting help from a minecraft wiki or something
how would i make it a variable LMFAOO
like blah particle = location.getWorld().spawnParticle(Particle.REDSTONE,location,1,1,1,1,1,1 );
new Particle.DustOptions(...,...)
ah ic
call
spawnParticle(
/* type */ Particle.REDSTONE,
/* location */ location,
/* count */ 1,
/* offsets */ 1, 1, 1,
/* "extra" */ 1,
/* data */ new Particle.DustOptions() // contains size and stuff
)
that contains the color and size
the DustOptions class
in the case of redstone
Send ur code from the class Glow, I think it means that
yeah
you have a Glow.java file
that has the class Glow in it
send the code of that class
because you have an invalid plugin instance reference
no the file
at com/hitman/recipe/Glow.java
just like you sent the code in Main.java
yes the glow one
copy and paste it into the hastebin
you forgot to set main to this in onEnable
main = this;
``` add this line to the start of `onEnable`
location.getWorld().spawnParticle(Particle.REDSTONE,location,1,1,.125,.125,.125,new Particle.DustOptions(Color.fromRGB(255, 255, 0), 5) );
does that look good
yeah
kk ty
looks good to me
Hey could some1 help code or find a plugin by any Chance
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Create a thread in case the help channel you are using is already in use!
what type of plugin
i dont think i can code one for you but there are probably many plugins that do what u want
Can you add me and I can explain?
Why not explain here
it works ty
We need a plugin That measures staff bans kicks and mutes etc for the week
I can't send a ss
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
so like ban analytics or whatever?
where would it measure it to? a website, a text file on the server machine in a log folder somewhere, or some in-server thing?
yeah i think thats what they want
he showed a screenshot where it prints it in chat
he said it was from a server with 3500 players
probably custom coded
ohh so like the Watchdog announcement on Hypixel?
no when a command is run by the admins i think
oh I see
they can monitor their staff
but it was from a big server so probably custom coded
I could probably make a plugin like that in not too long of a time but I'm kinda working on some other stuff rn lol
I also have limited experience with Spigot's API so I need to study it a bit more
yeah
you would most importantly need to interface with the punishment plugin itself
which is the hard part
gui?
nah chat message when a command is run by an admin
eh, depends on the plugin's API
I mean if you code everything in a proper you'll have good boundaries between business rules and possible io devices and such so then it shouldn't be too hard nor too messy
thats the screenshot he sent me
I'd make a system where it logs each moderative action in an entry in a chest GUI, which can be hovered over to see its information.
yeah
but we dont know which plugins they use
ah
this is the image they sent
oh neat
is it cross-server-restart?
the plugin they want
I dunno why I'm asking I'm just really curious
i got to go soon
its 22:06 for me
ya
exact same actually
live in sweden
netherlands
not too far away :p
nice
true
ah so its like 16:00 for you piotr?
aka 4 pm
apologies
what would we call u otherwise
Idk what to call people unless they state their wanted alias lol
Missing event handler annotation
yooo
md_5
epic
ive tried making a glow enchantment
but it didnt work
for some reason
at least the glow didnt show
glow enchantment?
Hey could some1 help code or find a plugin by any Chance
oh afaik you can pretty much inject an empty nbt compound for the key enchs or Enchantments iirc
Been trying so long
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
jack stop asking here
go to the services
open a thread or whatever its called
bro
@quaint mantle
why are u trying to cast a vindicator to a player
is the vindicator eating the item?
what?
check if its a player with entity instanceof Player
if (entity instanceof Player)
or cast it to org.bukkit.Entity instead of player
and use those methods
what is that sentence
I believe Mojang "fixed" this
what an unneeded "fix"
.
remove the potion effect
there is also a way to make the entities glow without an effect
You can't hide the glowing effect iirc
well unless you do some packet fucknuggetry
True
true*
i thought you were a python guy
i like that idea
language conga
I bet you donât know what this is ;
that's great
đł
The code below disables all impact damage of arrows EXCEPT for tipped arrows with Instant Healing II effect. Any idea why?
@EventHandler
void oneEntityDamageByEntity(EntityDamageByEntityEvent e) {
if(e.getDamager().getType() != EntityType.ARROW) return;
e.setDamage(0);
}
See this video: https://youtu.be/dZE7aQ6m1zo (pls don't mind me having the skill of a 74 year old who's never touched a PC in their life)
You probably want to do !(e.getDamager() instanceof AbstractArrow) instead to cover all types of arrows
Or if you still want spectral arrows to work, !(e.getDamager() instanceof Arrow)
Thanks for your reply, however, that doesn't seem to be it: The tipped arrow with Instant Healing II does meet the if condition, so the issue is not that it's returning in line 3. It's just setDamage(0) not applying for whatever reason.
When I print out getDamage() right after, it gives me 0 for all other arrow types. Just this one shows the usual hit damage.
what exactly is the problem? entities still get damage when shooting with an instant healing 2 arrow, but not for all other types of arrow? @verbal nymph
what about instant healing 1?
it's hard to believe that the type of arrow makes any difference, of course the event should work for all types of arrows
you might wanna have a look at this method https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageEvent.html#setDamage(org.bukkit.event.entity.EntityDamageEvent.DamageModifier,double)
declaration: package: org.bukkit.event.entity, class: EntityDamageEvent
?paste
Would someone know of a tip to shoot multiple arrows at once without tripping the ProjectileLaunchEvent multiple times causing an infinite loop đ
get out of this channel man, this is dev channel đ
are you tripping?
i did solve my own problem
sorry about the confusion but it was a custom plugin i were coding
i bet you assume i asked for plugin support? nah
i can read it says #help-development
seems like the class wasn't added to the jar.
players cannot consume when their hungerbar is full
what you COULD do is to deplete the hunger bar when a player right-clicks the item
and then restore it back when they do not actually consume the food
listen to playerinteractevent
then check if it's a rightclick and whether they have something eatable in their hand
that's what my former employer's server did
You could also use an item that can be eaten at full hunger
I think golden apples are the only one
how do you test your plugins that involves 2 people but you only have 1 minecraft account?
ex: i want to test a command that tps one player to another
is there any other way
like to summon a fake player
apply the effects to your player
UwU
If only I could change my nickname here
Bro why your main class is called Main
Oh god that topic again
Description: S O U P
đ đ đ đ
sigh
Brace yourself
god damn it when will people ever learn
i paste this shit way too much in helpchat and spigot discord
get it on a billboard
Where do you put a billboard for the most plugin devs to see it
buy every single billboard
I will ask bill gates to do it
or just project it in the sky cuz the earth is flat
Question
So
I have a plugin that takes a heart away from you every time you die
But
If you have a shield and covered the damage
It will run it as if you had died
Are you using the death event
Player.getKiller iirc
What if the Killer is not a player/
Then it will return null iirc
Thank you
By the way how do I make a nether portal from my TestWorld from taking you to world_nether
cannot resolve method "playSound"
why is that happening?
this is the line thats giving me this error sender.playSound(sender.getLocation(), Sound.BLOCK_ANVIL_BREAK);
we can sender isn't a player, u should check if sender instanceof player?
it is typecasted to player
Is it though
Player sender = Bukkit.getServer().getPlayer(senderStr);
I... have several questions
why
Anywho
Are you on a version from not 6 years ago
im in 1.17.1 api
Strange, donât see why it wouldnât be resolved
give us code maybe
ok
It should at least tell you you have the wrong params
@EventHandler
public static void onChat(AsyncPlayerChatEvent event){
Player target = event.getPlayer();
if(MessageAwaiter.getPlayerList().containsValue(target.getDisplayName())){
String senderStr = (String) MessageAwaiter.getPlayerList().get(target.getDisplayName()); //sender
Player sender = Bukkit.getServer().getPlayer(senderStr);
if(event.getMessage().equalsIgnoreCase("y")){
sender.playSound(sender.getLocation(), Sound.BLOCK_ANVIL_BREAK);
sender.sendMessage("§l§e(!)§r§c You do not have enough resources to teleport to this person");
}
}
the format in discord is messed up
but basically sender is a player
not commandsender
dont get that confused
What does the error actually say
Ah okay just a weird message format
?paste
?jd
Read the javadocs for playSound
weird format?
Iâm not used to seeing a cannot resolve method error if you get the params wrong
can you help me figure out the mistake? not just saying "read docs"
I mean that is what they are for
They will tell you the method takes 4 parameters
A location, a sound, and 2 floats
Hello.
so i've created a configuration file to save a player's location (im creating a plugin to set homes and teleport back to homes)
public class sethome implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender instanceof Player) {
Player p = (Player) sender;
if (args.length == 1) {
String homename;
homename = args[0];
Location coords = p.getLocation();
double x = coords.getX();
double y = coords.getY();
double z = coords.getZ();
UUID u = p.getUniqueId();
File userdata = new File(Bukkit.getServer().getPluginManager().getPlugin("Paper").getDataFolder(), File.separator + "PlayerData");
File f = new File(userdata, File.separator + u + ".yml");
FileConfiguration playerData = YamlConfiguration.loadConfiguration(f);
if (!f.exists()) {
playerData.createSection(homename);
playerData.set(homename +".x", x);
playerData.set(homename +".y", y);
playerData.set(homename +".z", z);
try {
playerData.save(f);
} catch (IOException e) {
e.printStackTrace();
}
p.sendMessage("Successfully set a home with the name " + homename + ".");
} else {
playerData.createSection(homename);
playerData.set(homename +".x", x);
playerData.set(homename +".y", y);
playerData.set(homename +".z", z);
try {
playerData.save(f);
} catch (IOException e) {
e.printStackTrace();
}
p.sendMessage("Successfully set a home with the name " + homename + ".");
}
} else {
p.sendMessage("Please only specify the name of the home.");
}
} else {
sender.sendMessage("This command cannot be executed through the console.");
}
return false;
}
}
^^ this is the class for the /sethome command (used to set a home, and store the coordinates in a yml file)
sorry about the messy code, i havent done java in months, so im a lil rusty
the 2 other parameter can be defaulted right?
You're compiling against the Paper API which has a playSound(Location, Sound), and that Sound is from Adventure
Man
this is so messy
now what im curious about is i want to create a new class for the command /home (which allows a player to teleport to a home they previously set)
just use this instead
Append 1.0F, 1.0F to your playSound call and it will work fine
public record SpawnSet(RisingCore plugin, Locations locations, LangUtil langUtil) implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (sender instanceof Player p) {
if (p.hasPermission("risingcore.spawnsystem")) {
if (args.length == 1) {
String locationName = args[0];
if (!locations.getConfig().contains("locations-data." + locationName)) {
locations.getConfig().set("locations-data." + locationName, p.getLocation());
locations.saveConfig();
langUtil.setspawn(p);
return true;
}
langUtil.alrName(p);
return true;
}
langUtil.noArgs(p);
return true;
}
langUtil.noPerm(p);
return true;
}
langUtil.playerOnly(sender);
return true;
}
}
the langutil maybe you know what i mean
i hope
anyways its a stupid question but what would i do to access that file in a different java class to pull the data i have stored into it?
the location is serializable
constructor
oh i see now, it works now. i thought the 2 other floats have default values so i didn't put them
anyways thanks!
It does everything keyable
is this a good way to create a world :v
getServer().createWorld(new WorldCreator(getConfig().getString("world-settings.deathLand")));
What do you mean by good
So I'm trying to add nms modules for version 1.16 and 1.17 and I'm having problem compiling it because the 1.17 requires Java 16 and I'm using Gradle.
Compile error: https://paste.md-5.net/ijeyijuduq.coffeescript
Pretty sure you have to set target compile versions in the pom.xml
something like that
technically this is bad, as getString() can return null
I have set the source and target to 16 for the 1.17 modules, and set source and target to 8 for the rest of the modules.
You can only compile with 1 version
If I compile with Java 16, would I still be able to use the plugin on Java 8?
No
nah.
will never return null
If I use Java 8, there is an error, it says cannot access 'import net.minecraft.network.protocol.Packet;'
always bad if you ignore nullable warnings, doesn't matter if they return null or not
Yeah I think so too.
Is your core module set to java 16?
Yes if the config value is null or the config doesn't exist it will be null
It should but you won't be able to compile if you're compiling against 1.17 NMS
That is if you're referencing any NMS types
I mean you can just compile everything with java 16
But I donât think anything pre 1.16.5 will run on 16
how would i go about getting a list of sections in a yml file, and then displaying them?
Yeah, but I don't want that.
I got this weird warning too when I'm trying to use SDK 16
whats the difference of playsound and playeffect?
ah i see
I have 2 sections in this YML file:
test1:
x: 9.398253382263606
y: 97.0
z: -1.0819892941608558
test2:
x: 23.992529229161853
y: 73.0
z: 70.29534087655867
how would i go about getting the names of these sections in an array and then listing them off to the player?
getKeys(false)
could you elaborate a bit? its a little difficult for me to wrap my head around. i thought getkeys would return the "x" "y" and "z" values? I need it to return the names of the sections. ex: "test1" and 'test2"
should i use yml or json for config?
Calling getKeys on the config itself will return test1 and test2
Calling getKeys on test1 would return x y and z
Yaml is nicer for configuration
ok ty
GSON does đ
Keep in mind Yaml comments will be lost if you save the file from your code
Unless that has been changed?
why would you change a config from code
I generally donât
:>
I do
But it would be nice to automatically add new entries when the plugin updates
Changing config from code is pog
ok. im just a little bit confused on how to display these to the player, sorry, i know its a dumb question, just cant wrap my head around it lol
Allows for config gui :)
Do you just want to display the test1 and test2, or the contents too
Just make a generic config GUI for all plugins
I was going to but it got complicated
so basically its just a plugin to do /home and /sethome and i want the plugin to display a list of homes to the player, so basically just test1 and test2
For things like items and such
kinda like how essentials will show u a list of all ur homes
One that just supports the main config types would be cool
String, string list, int, double, boolean
Maybe material
Yeah I can easily support that stuff
Hard part is itemstacks cause there isn't really a unified way those are handled
can i dm u my code? sorry i know i must be really annoying right now, just havent done this in a while lmao
Wouldn't reload it for other plugins but overwriting it would be simple enough
fair enough
I should look into implementing the new SnakeYaml in my library
But Iâm lazy
Suppose that works
Then I can use gson serializers for my yaml files and life is easier
I just donât modify the files myself
Yeah that'd be the easiest way
Add the new values yourself ya lazy owners
But since I added the config gui support requests have gone down massively
Instead of making yml files I do that
is spigot api restful?
why does this not work : String alert = "[Alert] ";
yes
Define not work
Declaration not allowed here
I'd use spiget
Where are you trying to declare it
ok thank you , your question fix my question
ok
Are you saying I canât make a POST request to the server itself
Spam upload 200 plugins
That would make you the number 2 author
And the number 1 banned author
I mean
If you spam 200 actual resources that youâve made youâll be fine
Unless the government comes after you for illicit cloning
They'll be 200 of the same resource with slightly different names
Hereteres nice plugin
Hereteres cool plugin
Etc
Well as long as they are nice and cool sounds good to me
Actually better idea
They'll be copies of premium resources with the plugin.yml changed
I think there is already another site for that
:(
14 events * 17 actions or whatever = 238 unique plugins
Time to get to the top
Off topic question
Does anyone know how to find all scoreboards
I don't think there is a way
Have you checked the craftbukkit impl of scoreboard manager
Must have a collection of them somewhere
Yeah I want to do it an api way though
I've managed to block events and commands via the api
Impressive
Takes a lot of work to add reflections
Well the premise of the plugin is per world plugins
Unfortunately I can't get plugin info from that
Shame
I wish spigot had an auditing system where stuff like thst ran through a channel so you could change it
Like events but for lower level stuff
Fork
Well it needs to work with spigot or no one uses it Sadge
That'll never happen I'm pretty sure MD hates stuff like that
Shame, I like breaking stuff
Only other alternative would be to wrap my jar around spigot
But then I couldn't make it premium so that doesn't work either
Kind of like what optic does with is Anti-Malware
Yeah, a project like that exists for paper and mixins
But that also limits people with hosts that donât allow that stuff
True and pwp is already marketed towards people like that
(people who can't afford bungee cord)
I just want to change the piston push limit and let them move tile entities
Spigotplz
feckers
Have to use a non premium option
Someone talked about this before
The premium check is client side and you can bypass it
Ez win
Iâll just toss 500 challenges into my challenge plugin and call it a day
If I ever go back to that
scoreboards are either 1) the main scoreboard, or 2) per player
so all scoreboards = 1 + 2
You could in theory have a scoreboard bound to no players
and scoreboard's have a plugin attached right
cringe
Set<Scoreboard> scoreboards; scoreboards.add(mainScoreboard()); for (Player p : players) scoreboards.add(p.getScoreboard())
Well, I really only care about the ones that are seen
It gets complicated for if there are 2 different plugins handing out a scoreboard
Have to look real quick
BossBar is another thing, I think those can have a namespaced key attached
But not always
Yeah, that's unfortunate scoreboards don't have a plugin attached
how do i get spigot on my singeplayer
?
how!
if they have a key they're saved and tracked and available with getBossBars
Your jar isn't called a server. Jar
oh
Or it isnât in that folder
whenever boss bars were added
Thanks-.-
You change the name of the server. Jar with the name of the spigot jar file
No idea
?
I am so confused
What was that site that let you compare api versions
1.9
Now let's hope someone has made this comp at article for me
How do you manage support across java 8-16?
just compile against 8 and youre more or less there
Ah wait, you avoid NMS donât you
Yeah, I only use the API
Right
how do i do the thingie
Meh, 1.15 and under users arenât my problem
I wouldn't support it if it were really a hassle, but the plugin is really low level so I don't need the new stuff
Just go look at a tutorial there are like 8000 of them
I linked one
where
ty
there are so many literally just type in how make a spigot server on google
.
I try to avoid NMS, but it loves to come say hi
Other than with the seasons plugin, not much I can do there
Yeah, if I use NMS I go for modules over reflections
Yeah, having to make 20 implementations for each version is super annoying, but it's the most performant way, if you're going to do it
yes we need more of those
Please, no more of those
No
we could use more backpacks / portable inventories too
Actually there are probably good free ones already
Stop it
Maybe some bedwars
I enjoy making free plugins that compete with premium ones
also didn't know this existed and that's dope https://github.com/0uti/BuildToolsGUI
Plz no sue
When are you going to make free version of per world plugins
Doesn't work on the latest versions
Iâll just uhh, reupload yours for free :p
Someone legit did that
I mean, the license allows it
he called it H Per World Plugins
Not sure spigot does though
It does, but he was reuploading one from *******got
Yes haha
Very nice
something really cool I saw is someone made a fork and setup a CI for it
however he hasn't updated it recently
github has inbuilt ci now
Removed bstats, added a plugin.yml, and then removed it
Yes
Interesting
senmori, rip
I assume the distribution string is different on the pre compiled version
Yeah I just have a thing in my gradle file that finds that and replaces it
filter { line -> line.replaceAll('VERSION', version) }
filter { line -> line.replaceAll('DISTRIBUTION', 'self-compiled') }
Neat
However it has a big downside in that whenever I have a stacktrace it takes me to the wrong directory
So I may change it
Oh?
Yeah I have to copy over my src to the build directory
then replace the lines and compile
so it uses the code from the build dir instead of my src dir
Ah
However, as long as I don't make any syntax mistakes it doesn't happen so I'll just be better for now đ
The best way to solve errors is to not have them
You definitely haven't
ill keep tryin
the #1 thing I hate in my plugin right now is the stuff like this https://github.com/heretere/hpwp/blob/master/src/main/java/com/heretere/hpwp/gui/main/MainMenu.java#L85-L102
I might just make a file for loading stuff like this, it would make creating the guis a lot less of a hassle
So true, being a software developer improved my overall problem solving skills
But it also increased my number of problems
so many problems
so little time
I didnât have to try and decipher netty stack traces before
TL;DR donât register multiple biomes with the same key
hello, in my yml file i have a string with the world name
pog
idrk how to handle this but basically
i need to take that data and teleport the player to it
grab the world name
and lookup the world based on the name
then create a location with the found world if one's found
test:
x: -142.14804747411188
y: 63.0
z: 348.6155324613635
world: world
could u give me an example? im not too sure how to do that lol
wait nvm
figured it out
lmfao
thanks buddy â€ïž
@ivory sleet ok
so basically
i have this:
World w = Bukkit.getWorld(args[0] + ".world");
Location home = new Location(w, x, y, z);
p.teleport(home);
now when i run the command to teleport to that location
i get this:
heres the console log:
[03:38:46] [Server thread/ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'home' in plugin Paper v1.0
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchCommand(CraftServer.java:790) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.server.network.PlayerConnection.handleCommand(PlayerConnection.java:1931) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1770) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1751) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:46) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:1) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:30) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.util.thread.IAsyncTaskHandler.executeTask(SourceFile:151) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.util.thread.IAsyncTaskHandler.executeNext(SourceFile:125) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.server.MinecraftServer.bf(MinecraftServer.java:1148) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.server.MinecraftServer.executeNext(MinecraftServer.java:1141) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.util.thread.IAsyncTaskHandler.executeAll(SourceFile:110) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.server.MinecraftServer.sleepForTick(MinecraftServer.java:1124) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1054) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:305) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.IllegalArgumentException: location.world
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer.teleport(CraftPlayer.java:672) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at org.bukkit.craftbukkit.v1_17_R1.entity.CraftEntity.teleport(CraftEntity.java:493) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
at com.dioz.paper.home.onCommand(home.java:37) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.17.1.jar:3257-Spigot-dc75aca-960f310]
... 19 more
should i put my config file in src or in the main ?
what did u do to resolve it?
Wait, i think i quoted the wrong message đ, but what is that â.worldâ?
I think they just forgot to actually grab the name of the world
Rn you are asking for a world named "test.world"
World w = Bukkit.getWorld(args[0] + ".world");
Yea, or maybe forgot the getstring
^^
ohhh yah ur ribht
Should be getnow it is ur config file(args[0] + â.worldâ)
i dont have the location
What are you trying to do exactly? Hmmm first is setspawn then now it is what
all the data required for the location is located in the file, so basically what i was trying to do was pull that data from the file and put it into a location. i was able to pull all coordinates, just had a little trouble with the world.
Hey, did you use get<ur config name>.set(path, p.getLocation());?
Or u need to get all the x y z thingy then put it? đ
why didnt i think of that lmao
Hey man
i stored every single value in the config
I think you forgot my ex code
playerData.createSection(homename);
playerData.set(homename +".x", x);
playerData.set(homename +".y", y);
playerData.set(homename +".z", z);
playerData.set(homename +".world", w);
the world variable that you are passing to the location is null
Do you really forgot what is my ex code LOL?
I suggest you to use the search tool
Then find my ex code for setspawn i gave you
(For command btw)
i forgot the getstring
instead of this:
World w = Bukkit.getWorld(args[0] +".world");
i should have done this:
String wld = playerData.getString(args[0] +".world");
World w = Bukkit.getWorld(wld);
Yeah but i donât think you really that bald so i dont point it out đ but ya know
Saving a location is really ez
i havent done this in months my friend
not everyone is at the same level as you, thats why we come in here for help
đ
thank you for the help man, i appreciate it
Ahh i have to find it for u đŠ yeah this is my ex code
Or u only need the getconfig.set(path, p.getloc);
Then saveconfig
Im in tablet no caps for the word :v
And
i forgot about it lol
If you
Trying to get world or coords of it
Just use
getconfig.getLocation(path).get(x,y,z,world,yaw,pitch)
I think i write it right
I hope so
what is the args variable
because it isnt an application right
or are you making a command
wait it is a command i think
as it has home
You can only load a location from config AS a Location, if the world its for is loaded.
just seen this floating around
i this actually a good way to convert something into base64
nice
serialization isnt that hard
you can make a very simple bytebuffer based serialization and deserialization algorithm using recursive reflection
on fields
and then when you encounter a primitive you just write its binary data
i did this but i didnt completely finish it
also has anyone here tried using natives?
im using it for my project
the object files get compiled correctly but the dll file isnt linked properly
the symbol table is empty raising an unsatisfied link error
base64 ._.
How can i enchant a tool after crafting?
use the craft event and add the enchantment
declaration: package: org.bukkit.event.inventory, class: CraftItemEvent
and then ItemStack#addEnchantment()
okay thx
How can I get the crafted tool as an ItemStack?
event.getRecipe().getResult()
i tried
and whats the error?
I did this
@EventHandler
public void CraftItemEvent(CraftItemEvent event){
if(event.getRecipe().getResult().getType() == Material.IRON_PICKAXE){
event.getRecipe().getResult().getItemMeta().addEnchant(Enchantment.DIG_SPEED, 3, true);
}
if(event.getRecipe().getResult().getType() == Material.DIAMOND_PICKAXE){
event.getRecipe().getResult().getItemMeta().addEnchant(Enchantment.DIG_SPEED, 3, true);
}
if(event.getRecipe().getResult().getType() == Material.GOLD_PICKAXE){
event.getRecipe().getResult().getItemMeta().addEnchant(Enchantment.DIG_SPEED, 3, true);
}
if(event.getRecipe().getResult().getType() == Material.STONE_PICKAXE){
event.getRecipe().getResult().getItemMeta().addEnchant(Enchantment.DIG_SPEED, 3, true);
}
if(event.getRecipe().getResult().getType() == Material.WOOD_PICKAXE){
event.getRecipe().getResult().getItemMeta().addEnchant(Enchantment.DIG_SPEED, 3, true);
}
}
version?
1.8.8
try it
Nope. That did not work
