#help-development
1 messages · Page 267 of 1
gh is quite common
I think jsdelivr's endpoint for github links is also gh
It makes sense since its shorter than git and git is the tool and not the platform
File configFile = new File(getDataFolder(), "config.yml");
YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile);
if (config.getDouble("config-version") != 1.3) {
config.set("config-version", 1.3);
try {
ConfigUpdater.update(this, "config.yml", configFile, Arrays.asList("none"));
} catch (IOException e) {
e.printStackTrace();
}
// save changes
try {
config.save(configFile);
} catch (IOException e) {
throw new RuntimeException(e);
}
// reload config
reloadConfig();
getLogger().info("Updated config file to latest version");
}
I am using this library - https://github.com/tchristofferson/Config-Updater
it updates config-version in plugins/MyPluginName/config.yml
but It does not enter any new values which I put in the resources/config.yml file
like for ex I added settings.check-for-updates = true to my resources/config.yml it will update config version but wont add the field to settings.
.
create a plugin that broadcast a message to everyone on the server when a player joins and make it configurable in the config.yml
ok!
Sure! Here are 15 spigot plugin ideas for beginner developers with small descriptions and catchy names:
"CraftyChests" - a plugin that adds custom chest designs and functionality to the game.
"MobArena" - a plugin that allows players to compete against waves of mobs in a custom arena.
"IslandLife" - a plugin that adds the ability to create and customize your own island, complete with fun minigames and challenges.
"WeatherWizard" - a plugin that allows players to control the weather in their worlds.
"EcoSurvival" - a plugin that adds a more realistic survival experience, with features like hunger and thirst mechanics.
"BlockParty" - a plugin that allows players to host their own block party events, with custom games and decorations.
"QuestsPlus" - a plugin that adds a quest system to the game, with various objectives and rewards for players to complete.
"MineMania" - a plugin that adds various minigames and challenges to the game, including parkour courses and treasure hunts.
"ChatCharms" - a plugin that allows players to customize their chat messages with different colors, symbols, and effects.
"PowerTools" - a plugin that adds special abilities and functionality to certain tools, such as a pickaxe that can break blocks faster or a sword that can ignite mobs.
"Skyblock Plus" - a plugin that expands upon the popular game mode Skyblock, adding new features and challenges.
"BuildBattle" - a plugin that allows players to compete against each other in building contests, with various themes and judges.
"CratesPlus" - a plugin that adds customizable crate rewards to the game, allowing players to earn special items and bonuses.
"GriefProtection" - a plugin that allows players to protect their builds from being destroyed by other players.
"MagicSpells" - a plugin that adds magical abilities and spells for players to use, including fireballs and teleportation.
done
thank you!
Ayo it's chatgpt
Yes
@terse ocean If you make a github, feel free to post your projects here from time to time for a review. Sadly we will definitely pick on what you have written and suggest changes forever. So only if you can handle it
Judge my code lol
yes i really want to improve my code/java skills and for that I do need reviews to what ever i code
I am lazy tell someone else to do it
?paste
https://paste.md-5.net/qaxivivite.java
doesnt register placeholders
Hey its on github just check out megumi
Nty
Me!!
Can you explain what tf this does
@river oracle find another savage beast
What does?
What
His project
It's just my lib lol
For what
So it does everything I need
// if config version is old, update it to current version
File configFile = new File(getDataFolder(), "config.yml");
Configuration config = YamlConfiguration.loadConfiguration(configFile);
if (config.getDouble("config-version") != 1.3) {
config.set("config-version", 1.3);
try {
ConfigUpdater.update(this, "config.yml", configFile, Arrays.asList("none"));
} catch (IOException e) {
e.printStackTrace();
}
// save changes
saveConfig();
// reload config
reloadConfig();
getLogger().info("Updated config file to latest version");
}
everything updates successfully except "config-version" to 1.3
Granted I haven't pushed fixes
Has anyone been able to build the new PacketPlayOutEntityMetadata in Spigot 1.19.3 ? They changed the constructor from (entityId, dataWatcher, true) to: (int var0, List<DataWatcher.b<?>> var1) {
Tasks seems kind of redundant
I guess var0 is the entity id but. What's that list?
Since you could make 1 class and just do Tasks.sync and pass in a lambda
It's a builder function
Which is what you have
It's nice
But it's annoying to do conversions and such which is handled by the builder
Conversions?
Time conversions from ticks to other time units
i'm softdepending it in plugin.yml
why saving config on every join
do the saveDefaultConfig in your onEnable
might wanna use PlayerJoinEvent#setJoinMessage too but ye i said broadcast
ok got it
hey i have a question what is better eclipse or intellij?
Intellij is probably used by the majority
What you prefer is, as always, subjective
if(inv.getName().equalsIgnoreCase("§8Mon Menu")){ send cannot find symbol i forget a package?
Don't detect inventories by their name
Use the inventory instance in a Set/List or use a InventoryHolder
Yeah using an InventoryHolder isn't ideal but it's better than using the inventory name
I have a world for each rank and extra worlds for other modes so around 20 wolrds. How should I be loading and unloading these and creating these
Whats the best way to manage
How
Me ?
How do i make it not auto load
Ok so my plan is if someone decides to teleport to a world that is not loaded i will do Bukkit.create and trleport them. But if they leave and there r 0 ppl i will unload it so i would have to create again if someone decided to teleport
And i would save the world everytime i would unload it
@last temple would this work
Yes
Yes but what i said is for loading and unloading depending on players
Oh ur saying j wouldnt bave to load or deload if it just doesnt auto load
for what in whuch yml
should i also create every world using worldcreater on enable
or what
do i do
but then how am i supposed to make locations
cus like i used /warp worldname and teleport the player to the world and the spawn loation
but if i dont create a world on launch
like if i dont do createworld(WORLDNAME)
then i cant teleport to WORLDNAME world
guys whats so special about a custom config file?
Nothing really
oh ok
Hey all, giving it a shot here as on the forums there is no reply. Does anyone have experience here with using "Populators". My goal is to somehow add additional mobs (with different equipent, commands, etc) to the natural spawning behavior of the world
Who? Me?
Yeah you
as for your question the easiest approach is to replace a spawned mob with your own
First of all, yea, true, It's been while 🙂
Had surgery 😦
Very major, several months of revalidation to go, but hey, can't leave it to start looking into development again
As for your proposed solution, that is what I did initially, but it would have been much nicer if I could add my own mob the spawn mechanics. I heard that you can control even conditions when they need to spawn which would be ideal
It's gotten a lot easier to use on modern version
will check that @river oracle , it's worth a shot
But I saw that it's possible to add populators
it would be nicer if I didn't had to replace existing mobs
but if it' really the best way
I just want to avoid to include logic where certain mobs don't have to be replaced etc, that makes it difficult
Spigot only has block populators
That is why I'm looking for a way where I just (add) a new mob (type) or mob loadout
I'd assume the nms isn't too complex for that but I may be wrong
little question, i wanted to make a click event that does something in the code itself, welp, turns out i cant. is there some way i can do this?
Yea, I'm more or less open to anything, as long as it's a durable solution 🙂
@dawn plover , the way I approached that is by having a command do the logic
with possible arguments in the command to pass along data
oh thats bigbrain
yea true, but what is the permission rule with that
the clicker?
aha, okay
yea, just the same, but a little shortcut
hm I was looking at the nms code for mob spawning, it doesn't seem like there's an easy way to do that without replacing existing mobs
Everything is pretty much hardcoded
I`m blacklisted for no reason and for 2 h i have been loosing my mind trying to log in. Can i get un-blacklisted please?
from middlecraft
oh wrong chat
-.-
Hello
Cys i cant create location without an instance of World and I cant get an instanxe of World without creating first
Or do u know a way
Are. you running your plugin pre-world init?
So all worlds should be created when i launch server
Thank you for checking, in that case we will stick with the replacing of mobs 🙂
So if i did nothing
And did player.teleport(new Location(Bukkit.getWorld(“hub), 0,0,0,0,0)
This would teleport
But in this case hub should have been loaded
Beforehand
Cus otherwise it says world doesnt exist
what does POSTWORLD do
force loading all worlds seems like a bad idea
i do it on my server, if its a void world it literally takes like 200 ms
actually i do it with 2 worlds and one is not void ~600 ms
Well considering he put his plugin to load pre-world-init, other plugin doing the same might get confused.
you could do it in a PluginEnableEvent or schedule a task to run when the server is done loading
How do i get NMS
i have a weird issue in gradle, so basically i have my own Lib thing that I shade into my projects. That Lib itself shades a bunch of stuff (for example color api). However when I add my Lib to a project it demands that I add one dependency even tho Lib already provides it.
Anybody knows whats up with that?
now how do i add it as a depend
what spigot version & what build tool?
1.19.2 and latest
with build tool, I meant maven, gradle, ant, ... ?
mav
^ then this is the answer
obviously the <dependency> thing belongs inside the <dependencies> thing
your whole pom is messed up
ik
?paste it pls
that actually looks correct
want me to redo buildtools
do you get another error message now after you fixed the </dependencies> thing?
the pom you sent should be working fine
fixing what?
💀
oh damn
I totally misread your screenshot
have you actually ran buildtools for 1.19 with the remapped option?
lmao i did too
looks like you haven't
as the blog post says, you gotta run java -jar buildtools.jar --rev 1.19 --remapped
I thought they messed up the XML lmao
if thats all i might die
where do i have to but the files tho
in your case, 1.19 ofc
nowhere
buildtools automatically installs them to your local maven repo
that's why maven is so awesome
you don't have to worry about stuff like that
kinda do lol
you just run buildtools and then it should work
the spigot .jar is only like 20mb or sth
ye
is that your only disk?
i would feel bad for you
if you only had disk
bruh you got 4.54 tb external
laptop?
pc
hmmmmm interesting
Whenever you download something, especially programs, reroute it to your D drive. You can also change where your downloads, desktop, and documents folder is in by right clicking it and clicking "Properties"
ik
apache or nginx for proxy
nginx
Why?
I use apache
based ty
For web based applications i use apache, but for rev proxies i prefer nginx
can the luck attribute not be added onto itemstacks in 1.12.2
i think apache is capable of both?
both are capable for web apps and rev proxies 😉
nvm was missing the name
depends
apache is just way easier to configure and it can do much more
nginx is faster if you serve 200 thousand static files per second
I use nginx because it sounds cooler
apache can more ?
I dont think so, but yea it's easier to configure
sure
first thing that comes to my mind:
.htaccess
You can do anything in nginx which is possible in the .htaccess file.
There is a reason why nginx don't use that -> performance.
apache is capable of reverse proxying as well
I said that already @wet breach 😉
no, what you cannot do is just upload a file that overrides directory specific settings
I think i’ll go with apache for my api, thanks !
you should use whatever you are more comfortable with
I have no experience in either
then take a look at both config syntaxes and decide what you like more
but both are very popular so I was unsure of what to use
As i said, it is possible with nginx to configure anything like the .htaccess but it's not that easy as upload a .htacces 😄
apache is kinda "xml like", nginx looks more like build.gradle files lol
apache is more mature and stable and makes sense to choose it for api purposes
I'd say that maven users probably like the apache syntax and gradle users will like the nginx syntax more
i think apache as it feels like xml whilst nginx is kinda gradleeee
also, apache allows for installing custom modules too
and ant users... idk... they can use lightppd or sth lmao
YES lol
does anyone know a good playerlist library
what i was thinking exactly
as in Bukkit.getOnlinePlayers()?
As in
there’s your player list
so i can create a player list
a tab list?
or should i say tablist
you can use the spigot api for that
how do you people like my bash "spinning" animation thing?
from video it doesn't look too bad
I like it
kool
it’s cute
Yes but he was trying to say that he likes to do that with nginx more
it's better than just printing "Please wait..." and then people think it crashed after 5 minutes
mhm mhm
how do i get name of inventory where item was clicked (1.19.2) because i cant use e.getInventory().getName()
you should probably get the inventory holder instead
since the name of an inventory isn't really all that reliable
get the InventoryView (InventoryClickEvent#getView()), then get the title from that
getTitle() not getName() sorry
declaration: package: org.bukkit.inventory, class: InventoryView
does in title also go color codes or just the text
if it has colors, then those colors are ofc part of the title
for example full string that i gave to inventory is ApexCore.themeColor + "Available tags:"
so should i put
ApexCore.themeColor + "Available tags:"
or just Available tags:
why would you ever need to get a view's title anyway?
that sounds like a shitty idea
remember that people could just rename their shulker box / chests to "Available tags:" to mess with you lol
people love doing things the wrong way too
you should keep a Collection<Inventory> or Map<...,Inventory> instead
or create your own custom InventoryHolder, although that's a bit hacky
well i have inventory with Paper items for tags so i would like to see if the inventory where player clicked is the one with tags not their own inventory
one could argue about that tbh
the docs say that the API is designed to only be implemented by plugins if the class is "obviously designed for extension". I don't see any reason why this shouldn't be true for InventoryHolder
wasn't that added in java 17?
oh
lol
@tender shard do you need those cases and skins in csgo 😂
does anyone know of a nice way to get mob heads for each type of mob, or am I just going to have to cry a lot here while implementing the hard annoying scuffed way
not if you pay me $$$
it's called "Sealed classes"
public abstract sealed class Shape
permits Circle, Rectangle, Square {...}
can you dm then ?
if we are going to talk abt money
well okay i wanted to say that i could help you flip twice more value than you have rn if you would give me those skins and cases
e.g. you could do "public interface Inventory permits Container, Entity {"
then only containers and entities can implement InventoryHolder
but bukkit is still on java 8 sooo
won't happen anytime soon
Good that I still use Java 8 Syntax in Java 17
I hate all the new shit tbh lol
Ugly
NoteBlockAPI still uses java 7 😄
I bet you dont use lambda switch either
I use J17, but I basicly just use J8 syntax at all
I love all the new LTS stuff idk if this was j17 or 11 or neither,but honestly
if(!(sender instanceof Player player)){
return;
}
player.sendMessage("Playa");
that's pattern matching, it's java 16
Does that work?
sure
this also works:
public String test(Object obj) {
return switch(obj) {
case Integer i -> "An integer";
case String s -> "A string";
case Cat c -> "A Cat named " + c.getName();
default -> "I don't know what it is";
};
}
<:
note the "cat" line
That will hella usef
I used lambda 1 time yesterday, because it was needed
Kotlin did it better
java 8 was definitely the best update ever, everything that came after that is... "nice to have", but that's it
They are @river oracle
You use bukkit runnables dont you
ok I panic when I say stuff and I'm not sure
Whenever I hear "Kotlin" im about to punch a monitor
this
@orchid gazelle weird
I don't like kotlin either, it's kinda ugly and has weird priorities
No.
I think its just Java in Ugly
why does the String come after the variable name
lol
the type is way more important than the variable name
:} help please if anyone knows
Kotlin = Java + Ugly
can't you just do EntityType.name() + "_HEAD" or sth like that
and then do Material.valueOf or sth
aren't there only a couple MHF tho
there are more than a few
I saw a list somewhere, and only saw like 10
is there a list somewhere
oh well yeah there's 18 builtin heads
the other ones are ofc not native
they are just random textures someone once uploaded
so yeah you would have to hardcode that
hm I could add that to JeffLib's SkullUtils class
SkullUtils#getHead(EntityType, boolean wall)
I suffer not using jeff lib
however using those MHF heads is still kinda weird
if you have a texture pack that changes creeper's heads, but then you use the MHF_CREEPER head, it would look like a vanilla creeper
howso
creeperHead = new ItemStack(Material.CREEPER_HEAD)
someMobThatDoesntHaveDefaultHead = someMHFHead;
now creeperHead always looks like your player's resource pack
but the other mob always looks like the default one
kotlin mfs when they discover a new keyword 
10% shorter code, "less verbose" and they just pack 70 keywords in
"less verbose" is one of the reasons why kotlin is shitty
we all love java because of its verbosity
I mean, if they really hate typing 2 extra letters, why didn't kotlin rename String to s?
yeah
and because it has the priorities right
because everything is so specific that there's no way to fuck it up
Yeah
modifiers before the type, which is before the name
this is what pisses me off about new langs
because it's ordered by importance
Verbosity imo is a good point for programming languages
var someObjectAndYouHaveToCheckTheEndOfTheLineToKnowWhatTypeItHas: String
Wtf
I'd rather know instantly that it's a string
sure sometimes it sucks that we have to engineer a whole backend structure to make a basic plugin
but if you argue around that, use skript and fuck off
M8
We don’t even type String most of the time
val str = “some string”
yeah ik you use "var" and "val" and then nobody knows whether it's a string or a CharSequence
mans can't type function so they make it fun
lol
Just infer it smh
yet then they decide to do a companion fun object
I never use var lol
companion stuff is weird
Why not just type int in the first place????
yeah that stuff is really shitty about kt
the var and val stuff just makes code 10x more ambiguous
You do
Thats what im saying
Just read the code context or hover over it easy
Most likely string
I'd rather spare 1000000 braincells and use them for actual coding not trying to find out what type it is
no, it's a CharSequence
Well doesn’t matter much
"Most likely" too
Java is unambiguous, Kotlin is poo
it does, you might have a method that requires a String
e.g. Player#setDisplayName
the elder has spoken
jan needs to respect his elders
CharSequence*
alex I haven't seen your upvote on the nms tutorial, you lackin too 😠
val reversedName = StringUtils.reverse(player.getName())
player.setDisplayName(reversedName)
wouldnt compile
kotlin automatically converts getters
yeah but that's not the reason why it wouldnt work
Cringe
the reason is that reverse(CharSequence) returns a CharSequence
in java you would do it like this:
If I see "val" 1 more time I need some Jägermeister
String reversedName = StringUtils.reverse(player.getName());
and then you would instantly see that it's not a String
imagine using utils for that
java is less headache
No, only if variable is called same after "set"
ie if variable in player object is called displayName
TLDR: Kotlin is making things worse by simplifying them
TL;DR - Kotlin's concepts are different to java's concepts, but they're both based on the same platform, so arguing that one is better than the other is worthless because it's a personal matter
=(
another reason why kotlin makes stuff more complicated:
Nah man I just need a doctor when I see that somebody uses kotlin
oh no wait
Ok
I should pull a mineacademy move and make my own programming course
with my sexy voice and 480p webcam
Lmao

but instead of a german accent it's a weird shitty slavic accent
mixed with west european
// IMagine this is from java lib
public class Person {
protected int age;
public void setAge(int newAge) {
if(age >= 100) {
throw new IllegalArgumentException("Age cannot be greater than 100");
}
age = newAge;
}
}
And now you use it in kotlin to create a class that extends Person, like this:
class Mfnalex : Person() {
init {
this.age = 101;
}
}
does this throw an exception, or not?
even though we have a protected variable
so it prevents me from using a visible variable?
how "useful"
why would your var be "visible" if you have condition for it ?
because it's protected and it's a subclass
sometimes you want outside classes to only use the setter while you want full control from subclasses
also wtf is this
I mean, that's not a kotlin problem, but intellij's fault
eye cancer
why can I not run a simple kotlin project from within intellij
Hi, license system on premium plugins is acceptable?
read the rules
upvotes?
yes
which nms tutorial
bio
I will not upvote anything that encourages to use paper api tbh 😄
I literally copypasted your pom.xml from your blog
I gave options, it's just that the only remapper for gradle that minimally works is paperweight
paper should contribute upstream instead of inventing their own weird API, and then complain when spigot adds it too because now it breaks their bytecode compatibility
looking at you, ADvancementInfo class
everything with a String is deprecated lmao
as if anyone would like to use Components
Components have their use, just not in place of EVERY String
"Hey, I want to rename this player. Thank god the string method is deprecated, I'll rather just use a BaseComponent[] to rename "mfnalex" to "Alex"
exactly
it's fine to offer both. It's a jerk move to not offer a string method or to deprecate them
Why is protecting plugins from being cracked locked? 🤔
you cannot protect your plugins from being cracked
wut the heck you must use paided obfuscator?
not even rockstar games can protect their games from being cracked, why do you think you could do that?
I secured and have not had any crack for 2 years.
i mean obfuscator
then probably nobody cares about your plugins enough
either your code is absolute garbage or you have a 10/10 decompiler stronger than the NSA
the reason why DRM is not allowed is this:
Many people have tried
ok send me your .jar and I'll get it working
Lmfao
post it here, I want a challenge too
Illusion if you would have written the guide 2 months earlier, you would have saved me like 10 hours literally

it has been in writing for 2 months
also what does your "licensing" do?
I've provided drafts here and there
query some license server that returns "yes" or "no"?
But now I already learned about nms lol
I still have a lot of work to do on that guide in order for it to be the mammoth I wanted it to be
still, give me upvotes I need validation
@echo basalt Just wanted to come back here to thank you so much for your help yesterday. everything is working fine now. ty a lot
🤗
I helped you yesterday?
lots of ifs code and not using ConfigurationSection
I spend upwards of like 6 hours on this server, every day
Also drm is not prohibited in the rules
well, im grateful either way
cheers then
Any plugin worth stealing has been stolen
I do it a bit tricker
I let leakers leak using versions, but they crash the server after 12-24 hours with an internal jdk error
People never realize that
They think they cracked it and then the 13 year olds wonder why their world got corrupted after a week
Why is general chat in help development
movement
I could just watch a scary movie, that way I won't be lonely anymore
position
are you new here or sth?
Happens when there are no questions
Well how do they leak the manipulated version
we're talking about character development
this happens five times a day
Not the normal one
it's in the original version
How do u know who pirated then?
by a ton of different things
Uhm
for example, the user placeholder. the license internet check whether this is actually a user who paid for this on paypal. by checking the file size. by checking the method names. there's a check for this in most classes
cus of alteration
by checking how many different IPs have used this exact NONCE within the last 7 days
and more stuff
Anyone who has the sourcecode can just remove all checks lol
a very easy measurement for example is to check the number of methods a certain class has
if it's off, then obviously it's not a valid version
if AngelChestPlugin has 27 methods but this version has 28 -> Unsafe#putAddress(0,0) after 12-24 hours
Then they just remove the check
the stacktrace doesn't even show the method where the crash comes from, the JVM just dies
They can see where checks happen in your src
ey nothing is gonna be perfect
in every of the 400 classes? and then do it for every new update again, where every method looks different and has a different name?
Sure, if one has 300 months to do that, they can do that
but it's not worth the effort
Just write a script.
^
and how is that script able to detect that method?
You can easily find specific methods etc. If all your checks are similar they can find that too
okay let me show you sth
this is one of those methods in angelchest 9.8.0
this is the same thing (exact same source code) in 9.8.1
Uhm
Looks fun
I personally think thats not easy code lol
makes the plugin so it needs to connected to web for scripts
and now remember, that such a method exists in nearly every class, but it looks different every time, has different method signatures, gets called in different places, different names etc
and everything will change with every new version again
so yeah, if someone wants to spend XXX hours for one specific version, they can crack that
sounds like a waste of performance
but once they cracked that, I already released 5 new versions meanwhile
why do that when you can just live off commissions
Has anyone figured out this issue Access to XMLHttpRequest at 'http://localhost:8000/login' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute. I've tried searching for answers but i've tried most of the solutions online that I can find and still hasn't fixed it.
nah
because I get angry when people make money with leaking other people's work
when someone messages me "yo I cannot afford plugin X, can I get a discount / get it for free?" then I say "sure no problem"
Even if they don't
you can block outgoing packets 😂
but when "leaker XYZ" makes 300€ per months by selling MY SHIT on leaking sites, then... no
there are like 2 sides to this argument
sure you can do that
one is like
make it open-source and let the community benefit
sure leakers can leak or the user can just pull from git and build
but all those leaking websites also automatically add their own methods so the method count is off for at least the main class
or do what citizens does, and have a jenkins page
there is a ton of ways to detect whether this is an original .jar or not. asking some website is just one of those
just don't forget that if you one day randomly decide to stop posting updates, you're making it harder for people to pick it up after you
I already got that ruled out. Cazcez has access to all my stuff and if I'd suddenly die or whatever, he got access to all my github stuff and makes it public
Yeah seems like a lot of work, I just make my plugins open source and stop caring about leaks
I did that for new plugins as well, e.g. StackResize or Daytime
I'm feeling like making a public plugin
that's like gui-based or something
I just don't know what it should be about tho
but my drm stuff is already done, I just let it run through Stepsister.jar after packaging and that's it
Stepbro 😳
StepDancer
Do the Stepsister.jar sometimes get stuck?
Stepsister has very interesting code. that's the unobfuscated, original code lol
it was originally called Daddy, but then it got stuck in an infinite loop, that's why I renamed it to Stepsister after fixing that
That has nothing to do with spigot lmao
I used to do stuff like
if(Daddy.allows(PremiumFeatures.SOME_PREMIUM_FEATURE)) ...
name it "HR"
"Run it through HR"
so
You're not likely to get help with CORS here
Always worth a try
insert method?
If you say so
I also wrote this weird string encryption recently but haven't used it so far in any uploaded plugins
ofc it returns sth different every time
nice :O!
and no you cannot just open recaf and let it "optimize" this stuff, it depends on the class and package names that called the decrypt that whether it works or not
and most leakers are stupid and replace the user placeholder with sth different in every string
i think theres something wrong with mc i have this but i get an error abt IndexOutOfBoundsException
if (p.getMetadata("scoreboard").isEmpty() || p.getMetadata("scoreboard")==null || p.getMetadata("scoreboard").size() == 0) {
p.setMetadata("Scoreboard", new FixedMetadataValue(plugin, true));
p.getScoreboard().clearSlot(DisplaySlot.SIDEBAR);
}
if (!p.getMetadata("scoreboard").get(0).asBoolean() || !p.getMetadata("scoreboard").isEmpty()) {
p.getScoreboard().clearSlot(DisplaySlot.SIDEBAR);
continue;
} else {
p.getScoreboard().clearSlot(DisplaySlot.SIDEBAR);
}
so that further breaks it
send the full stacktrace
?paste
Hello guys ! I have a question does anyone know if it is possible to intercept the packet (with Protocolib) that sends the text over the hotbar? I have tested the Server.CHAT and Client.CHAT packets, neither of them is triggered.
what's Main line 127
You're not using else if on that second if statement
if (!p.getMetadata("scoreboard").get(0).asBoolean() || !p.getMetadata("scoreboard").isEmpty()) {
isn't there an ActionBar enum?
huh
looks like the scoreboard is empty
it shouldnt be
check if it's empty BEFORE calling get(0)
if (p.getMetadata("scoreboard").isEmpty() || p.getMetadata("scoreboard")==null || p.getMetadata("scoreboard").size() == 0) {
p.setMetadata("Scoreboard", new FixedMetadataValue(plugin, true));
p.getScoreboard().clearSlot(DisplaySlot.SIDEBAR);
}
?codeblocks
You capitalized the S in scoreboard
?codeblock
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
ik
There we go
if (p.getMetadata("scoreboard").isEmpty() || p.getMetadata("scoreboard")==null || p.getMetadata("scoreboard").size() == 0) {
p.setMetadata("Scoreboard", new FixedMetadataValue(plugin, true));
p.getScoreboard().clearSlot(DisplaySlot.SIDEBAR);
}
i check 3 times
yeah you set the Scoreboard meta
if you are not very well versed and are not touching internals, the odds that there is something wrong with MC and not your code is virtually 0
but you get the scoreboard meta
so assume first it is something wrong with your code and not the other way around 😉
well well well
change "0" to "0.1" and I agree 😄
lol
there have been so many spigot bugs I tried hours to fix
@wet breach e.g. try to save a PDC tag like this: {"name":"mfnalex"} into an ItemMeta's PDC, then save that item in a config, and read it again.
you'll be fucked
I am not saying bugs don't exist, however in general when not touching internals though and using strictly the api, it is more likely to be something wrong with your code though especially if you are still learning the java language
we already told you twice
s != S
yes
true, in 99% of cases one is responsible oneself when a stacktrace occurs
I prefer to blame the server
i only do that when people send me stacktraces of their weird mohist / catserver servers
Not sure that needed to be a gif
I have started to just check this in onEnable(), and when it returns true, I disable the plugin and print an angry message
I just say "Here's the software I support: ...
If you're not using that/one of those, then fuck off from my DMs"
💃
yeah but that doesn't help from getting tickets anyway
then I ask "what server software do you use"
and they answer "latest"
and before they finally tell me they use "mohist", they already wasted 15 minutes of my time
That's when I smash the close button. Call me an asshole but I don't care
anyone know why this is happened ?
i setup building the artificat and build it and then i put it in a server like minehut and run the /plugin command and my plugin isn't there and my plugin's functionallity isn't there either i tried server hosters like minehut and server.pro
?paste latest.log and your plugins name
what do you mean latest log
you go to your server's "logs" folder
oh ok
then you copy/paste the contents of the file called "latest.log"
and paste it into that website
then you click the save button and send us the link
ok doing that
The S in Scoreboard
i changed it to coreboard
Didnt 2 people tell them that over 30min ago
Api version 1.19 not 1.19.2 in plugin.yml
what?
It just needs 1.version not the minor
but in the yml file its 1.19.2
Change it to 1.19
It doesnt need the 3rd number
The api-version only goes off the major versions, not minor
That can stay as that
does that apply to pom file
okeyyy
The pom file needs just 1.19 for the api-version for it to work
so like if 1.20 comes out ill do 1.20 but if 1.20.1 comes out ill still do 1.20
Yes
thanks!!
anyway i can just remove fishing drops all together?
?jd-s check the fish event or something like that, i would guess it has a set drops method
no
declaration: package: org.bukkit.event.player, class: PlayerFishEvent
cancel it, i guess. then do what you want to do instead
it's probably EntityDropItemEvent
let me try this out rq
also this https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerBucketFishEvent.html
but that's deprecated as you will see, so use the more general one, check if it's a fish and cancel it? if you want
declaration: package: org.bukkit.event.player, class: PlayerBucketFishEvent
cant fish now
xd
they want to stop drops from fishing
^
so cancel EntityDropItemEvent when the entity is a fish
but what about the random item drops that can occur? like leather and stuff?
that's handled there, you check the fish state and see what it is. caught fish, caught item, etc
check and cancel appropriately
yeah i just want all drops to be gone from fishing
then try the EntityDropItemEvent and cancel that
I am not sure whether it works
you'll have to try it
what does the "EntityDropItemEvent" even do? Does that do all item drop events?
cuz i kinda just need it only for fishing
i think you can use that fish event, but dont cancel. instead get the hook and just set the hooked entity to null
it gets called whenever an entity spawns a "drop"
it will unhook whatever it is
it only has a "setCancelled" method, nothing else
no it doesnt
declaration: package: org.bukkit.event.player, class: PlayerFishEvent
it literally has getHook()
so get it, then call setHookedEntity(null)
ah ok
yeah that might work
I thought you meant that the event itself has a setHooked method or sth
let me try
however, that might not despawn the hooked entity if that's what you want 🤔
but yeah try it
ah its not clearing the caught item when you reel it in
they could just do getHook().getHookedEntity().remove()
get the hooked entity and manually delete it then
Does it work?
idk, you have to try it
and so i will
probably it'll work
yes that seems like it would work
Also for chances i use the Math.random() function right?
I'd rather use ThreadLocalRandom().nextDouble()
you can make some type of chance that way but computers can't do true randomness so it'll be pseudorandom and probably somewhat predictable
hm ok
not a whole lot you can do about that though
So lets say if i wanted to do a chance of 5% what can i do to make it efficent?
efficient*
what
public class Something {
private static final double CHANCE_TO_GET_DROPS = 0.2;
public static boolean shouldGetDropNow() {
return ThreadLocalRandom.current().nextDouble() < CHANCE_TO_GET_DROPS;
}
}
this would return true in 20% of cases, and false in 80% of cases
except for that fact that it's not truly random so that's not the true probability
but, yes sure
alr ill have to give this a go,
please don't start a discussion about "truly random" now here when they just wanna get a random chance for fishing drops
uh but back to our other issue,
For some reason "getHook().getHookedEntity().remove();" isn't removing the caught item...
and you can explain it to them
show your whole eventhandler code pls
Usage: !verify <forums username>
!verify MusicalCode
This account is already verified!
did you register the event? also line 5 will probably throw many errors
yes i registered the event
everytime you do a fishing related thing that's NOT "reeling in" or "caught fish", it will throw a NPE
but it should still work though
if (e.getState() == PlayerFishEvent.State.REEL_IN){
e.getHook().getHookedEntity().remove();
}
Do you think this would possibly fix it?
nah
remove() only marks it for removal, it doesn't process the removal. I am not sure how to force despawn it though
it would fix the exception, but if the current thing doesn't work at all, this also wouldn't work at all
remove() despawns it on the next tick / after the current tick is done
yeah that's what they mean with that
k
at least that's how I always understood it
hm well lemme start intellij in 10 minutes, then I'll try a bit
like i never been stuck on something this weird before,
are you still setting the hooked entity to null on the fish hook so that it unhooks? try unhooking it and also marking for removal
I tried removing it when it was being reeled in,
but that doesnt work
if you're making a custom GUI is there any method that can instantly close it after the person using it does a particular action
p.closeInventory() should work
Player#closeinventory
whats the differnce in that and p.closeinventory
cause i tried p.close inventory
didn't work
its the same...
„p“ is a variable name
Player is the class that declares that method (actually HumanEntity but…)
i tried googling this issue, but i cant find a fix..
oh yeah my bad i had another check running of player closed inv and it will open it again
should work now 😅
don't know, sorry.
I‘ll find a solution in a few minutes, then I have a reason not to go to bed
oki thx u
ye
kk lets start IJ
i just find it weird how i tried everything and the items arent being removed.
ah ok im an idiot i read this wrong,
but no i haven't not till now
and that removed it..
xD
np
private static final double CHANCE_TO_GET_DROPS = 0.2;
public static boolean shouldGetDropNow() {
return ThreadLocalRandom.current().nextDouble() < CHANCE_TO_GET_DROPS;
}
@EventHandler
public void onFish(PlayerFishEvent event) {
if(event.getCaught() != null) {
if(shouldGetDropNow()) {
event.getCaught().remove();
}
}
}
now you'd get only drops in 20% of cases
I always use this utility stuff from my lib for chances @quaint mantle
e.g. "chance(0.5)" returns true in 50% of cases
chance(0.2) returns true in 20% of cases
basically: just create a random double between 0 and 1. 0.5 is 50%, 0.2 is 20%, etc. and when the random is <= the "chance", then the chance is "successful"
and you should use ThreadLocalRandom.current().nextDouble(), that returns a number between 0 and 1
well i gotta see wat i can do, for now in terms of another trick then if that fails ill just resort to what u sent
just do it like this
that will 100% work and it's only like 10 lines
the general idea is:
1. create random double between 0 and 1
2. check if that double is lower than your desired chance (0.2 = 20%, 0.4 = 40%, etc)
3. if yes, then do your stuff, otherwise don't do it
the trick i tried just rn, seems to be working fine
nice
ty btw for ur help
np
don't forget to check whether getCaught() is null before calling remove() though
otherwise you'll get a ton of console errors
ye
i have it in the REEL IN fish event part,
I still wanna add one thing
sorry but "p" and "e" really are fucked up names for variables 😄 😛
okay then
thank you ig
xd
I used those single letter variables myself for 3 years, so I know that it's bad 😄
Personally i just call all my methods and vars letters of the alphabet
I use the greek alphabet
I love how copilot instantly knew what I'm up to
I need help I can,t connet to my server
with Copilot you don't even have to know anything, you just use proper method names and copilot writes 80% by itself lmao
Why lightmode
how is that a development question though?
Give us details
have you written your own server software in java?
like I start up my server and then i can,t coonet
^^
oh
new WorldCreator("arena").createWorld()
should I use this to load all my worlds onEnable() (I have around 20)
yes
woudlnt that take long everytime
Why would you need to load 20 worlds on startup
loading 20 worlds always takes long
so i can teleport my players when they do /warp to a certain world
why do you even have 20 worlds
just lazy load them instead. when they use warp check if its loaded. if not, load it.
then warp them when its done
how do u lazy load
i just explained it
the real solution would be to have 20 different servers using a proxy like bungee/waterfall/velocity
Just have a void world and spread them appart by a couple thoussnd blocks?
ye idk how to lazy load tho
i literally just explained it
when they use /warp, check if the world is loaded.
if not, load it.
oh and another solution would be not split up your player base between 20 worlds / ranks. how many players do you even have
then warp them.
new WorldCreator("arena").createWorld() this is loading right
and block the main thread?!
There is not a valid reason for 20 worlds that you can gi e
yeah but nobody is online then
doing just for friends
but i dont want it to matter
how many
A rank per world is pointless aswell
k whatever, then load the shit on enable. pretty sure yall aint gonna convince the lad to run a network
if you really want to have 20 worlds where players can teleport to anyway, you want those worlds to be loaded already
besides his wallet probably isnt fat enough
so load them in onEnable or sth
Bunch of lobbies and match levels
do you know which 1.19.3 method can turn an entity invisible?
LivingEntity#setInvisible
nms
ok instead then would i be able to make 1 world that has likethe prison mine for each rank
but different environments
like its night at some part and raining
and some part is sunny
in same world
I need to turn a horse invisible
Worldguard can do that, you could prob check source
each player can have their own time/weather I bleieve
can I do that without nms?
Yes
as I already said
declaration: package: org.bukkit.entity, interface: LivingEntity
ok thx
is this meant for me
Yes they can, the only nuisance which shouldnt be an issue for them is it doesnt change server spawn stuff lol
Yes

