#help-development
1 messages · Page 2256 of 1
In my country we have January 13th, February 16th and March 11th as our national days
Fuck that
not to spigot
send a packet
ah
packette
Packette
packete
Yea, packet might be the only real solution here outside of repeatably setting it
|| or switching to paper and using better API
||
garlic bread is the best
a universally true statement
What do you have to do to beable to contribute to spigot
sign the CLA
CLA?
WorldGuardPlugin#getRegionManager no longer exists, what should I use now?
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
eyy
Is it a gov document cuz then I can't not 18 moment
no
but you have to provide your full legal name and address and shit
Uhm is that public?
no
if you'd have to dox yourself to contribute, spigot would have less than the 2 contributors rn
💀
Why would I give my address hell nah ill just fork it and make changes I want lol
I presume switch case ? By like 3-4 instructions
fork it != contributing to it
Yea ik but 🤷♂️
and like, have fun forking spigot
yo\
it is pain
forking paper isnt 😉
it isn't 🙂
Ə
Do you gave to copy paste everything lol
Figures
I'm curious why you gotta send that info to contribute
Because it’s a legally binding contract giving spigot the right to your contribution
they can finally remove those activeX shitty polyfills
I can't sign contracts lol
Then you can’t contribute
F
It’s to protect spigot from some idiot like Wolverness contributing and then DMCA the codebase years later
Like he did to bukkit
I thought you had to be 18 to sign any contracts
WorldGuardPlugin#getRegionManager no longer exists, what should I use now?
Atleast in America
You need parental consent under 18
Ye fuck nah
You definitely should
but ehhh, this is not legal advise and I am not a lawyer 🙂
As a minor you legally can’t enter into any kind of contractual agreement
It’s not enforceable
That’s why parents have to co-sign
Kids aren’t expected to know better
fuck sake can someone answer my question
I'm trying to add tab completion to my command which supports multi-word arguments in quotes, and everything's working except if you manually type the first word along with the space, the visual moves to the next word, and if you then press tab it inserts the whole string. Is there a way to stop that? A specific example of the command I'm trying to get to work is /war start "Team One".
You can't have spaces in your arguments because a space denotes the next argument. Even if it's in quotes. You'd end up with args[0] = "Team and args[1] = One"
Hello does anyone know how i could send a pure packet without going through the netty thread? and therefore send it whenever I want without being dependent on the 20 tick limit
I mean, you CAN. Its just more work
Yea, but you wouldn't get good tab completions from it.
Not without a lot of potential jank.
I have it all working except when I actually press tab in the second word it inserts the whole string instead of just the missing part.
interact probably fires for right click, i just want left
Actually, arguments such as greedy arguments can contain spaces
And also you can use quotations for arguments to define a String
If you use brigadier, a greedy string will take anything after
How would I change a players name tag, not using scoreboard or setDisplayName
Basically lets say you want a prefix for the player, only the nametag above his head, not in tab or chat or anything
Custom name wont work btw, "This value has no effect on players, they will always use their real name."
armorstands
Correct me if I'm wrong, but I think you will need to use packets
I used packets to alter what armor do players see (to hide weared armor)
any example?
I'm actually new to packets
But here you can find all the packets and their descriptions: https://wiki.vg/Protocol
I cant use CraftPlayer for some reason
How can I access and modify an Entity's data similarly to the /data command?
I'm trying to access a ZombieVillager's level, in a Villager you can access this value with the method getVillagerLevel(), but ZombieVillagers lack that specific method
In game you can use the command /data get entity <entityid> VillagerData.level to read this value
I haven't tried that, I'm currently unfamiliar with that concept
Is this the only way to access this information?
But the villager level doesn't seem to be accessible through a ZombieVillager object 🤔
is it possible to check a player's title?
Which public method?
I mean the title displayed by player.sendTitle
thinking about it there is a simpler solution for what I tried to do
but thanks for the help!
can i pass a null ItemStack in the array of PlayerInventory#setArmorContents?
yea
its @Nullable ItemStack[] items
Hi, where can I contact support on spigotmc page / open a ticket?
why does this not work?
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player p = (Player) e.getPlayer();
Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {
@Override
public void run() {
if(p.hasPermission("fthme.join.gm")) {
p.setGameMode(GameMode.CREATIVE);
p.sendMessage(SP + "§5KREATIV");
}else{
p.setGameMode(GameMode.ADVENTURE);
}
}
}, 20L);
}
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
Caused by: java.lang.IllegalArgumentException: Plugin cannot be null
at org.apache.commons.lang.Validate.notNull(Validate.java:192) ~[spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.validate(CraftScheduler.java:397) ~[spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.runTaskTimer(CraftScheduler.java:123) ~[spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.scheduleSyncRepeatingTask(CraftScheduler.java:119) ~[spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.scheduleSyncDelayedTask(CraftScheduler.java:102) ~[spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-21fe707-741a1bd]
at net.fthme.com.jumpsystem.Listeners.joingm.onJoin(joingm.java:25) ~[?:?]
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 org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.8.8-R0.1-SNAPSHOT-latest.jar:git-Spigot-21fe707-741a1bd]
... 14 more
Error message
so your plugin variable is null
y
fuk if we know
public static Plugin plugin;
public joingm() {
this.plugin = plugin;
}
ew
where do you initialize this class?
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.
this.nullVariableFromStaticContext = null;
oh i didnt notice you dont pass a variable there
Aight what kind of problem a plugin can get, that a unused code (basically just two slashes) are detected as errors?
(ex.: line 40 is //, and nothing more, but yet is still an error)
try to recompile your code
Well, the console prints for line 40 which is just two slashes, so now what?
what event do i need to check for if someone is standing on a block
or is it even a event
isOnGround? idk
or get the block below them
and if its solid then yeah its a block
(I am actually trying to import the player data into MySQL, but it just messes with me)
try BlockEvent
?jd-s for me self
oh pog theres an Tameable interface
thats an abstract, you cant check for that
or at least not that i know of
but i will try to find the block below player, i think thats a good idea
so guys what can I do with my code?
your constructor needs to receive a variable
without that you are setting a variable to itself (null to null)
dont need the constructor since the field is static
but itd be better to use di probably
so add the parameter to constructor and then make the field non static
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
private Plugin plugin;
public joingm(Plugin plugin) {
this.plugin = plugin;
}
Initialize the class in your main class i guess and pass the plugin there - dunno, this looks like you're passing the bukkit's Plugin class which you should not unless your main class is called Plugin. Change it to your main class (that should extend JavaPlugin).
as of now, you were passing the variable to itself
Player move event
i saw that, but isnt that when a player is moving only
so when a block get changed while a playing is standing still
it wont react
When you change a block maybe you can check I'd there are entities above it and apply logic there
Nevermind got the fix. I just had to export the plugin with another jar name.
I made a new Plugin with the same code now it works without doing this
without doing what?
i expect you did everything static, which is a way but a ugly way
I just wrote this again in the main class
it is
yeah, i would split your events into a Listener class
but I just wanted to know if I did it right or not
and register them - getServer().getPluginManager().registerEvents(new YourListenerClass(), pluginInstance);
Packet armorstand not working anymore ?
because i dont have suggestion like "setCustomDisplayName" or something like that
if (event.getEntityType().toString().equals("ENDERMAN")) {}
```how would I make this like a if not return
else ?
if(){
// Code
} else {
// Code
}
What about return?
wdym return?
Like cancel if it’s not enderman
its a event ?
return <what u want to return>; <--- if not void
if void just put return
?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.
Hello guys
Do you know an API or anything for use custom_model_data or similar in 1.8 ?
I'm searching since 2 days but i didn't found anythings work
It's for add an texture to a custom item
custom model data doesn't exist in 1.8
And i dont think they are alternative
Yeah I know that why i'm asking if someone have alternative
That exist
I saw that in youtube video
or just deal with a ping and stop crying
Lewi you have an idea ?
What
Maybe cause i ping back him but he did first X)
I always ping on reply
nah sorry
Iirc this isn't even possible in 1.8 may be wrong If it is you'll have to dig around nms
Yeah maybe
Its not possible in 1.8
Not even with nms. The game simply had no such features back then.
1.9 introduced custom textures based on the damage of an ItemStack.
Thats what you have to live with if you decide to use outdated, ancient, broken software.
pov the person ur talking to doesn't know how to silence notifications
Wow too far man stop being honest
Cause Ex Pvp mechanic ^^
why nms methods are hidden
For armor stand
Stop complaining about the adhd pvp and invent a new exciting custom pvp mechanic.
Did you add nms to your classpath?
I want to do NMS armostand to make armorstand display the name of player in 1.16 it work but in 1.19 i cant see the methods
yes
i used buildtools and replace spigot api with spigot in maven
In 1.19 the method names are completely different. They use the official mojang names now.
oh okay
Thats not how you do nms in 1.19
Since 1.17 the process of how to get nms to work has changed
ah yeah I'm damn late
there is a tutorial to learn how to use nms in 1.19 ? because i searched about 2 hours and i cant found nothing
https://www.spigotmc.org/threads/spigot-bungeecord-1-19.559742/
Scroll down to "NMS"
Anyone use Maven in VSCode? I'm trying to build my first Maven project but I'm having some problems.
& : The term 'g:\Downloads\Spigot 1.16.5 Server\plugins\' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:3
+ & "g:\Downloads\Spigot 1.16.5 Server\plugins\" package -f "c:\Users\Da ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (g:\Downloads\Sp...Server\plugins\:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException```
Unless I'm not doing it right.
99% of people use intellij so
maybe dont use vscode lol
Hello, i have question
I just want to change a value and it doesn’t change anything
main.getConfig().set("whitelist.work",false);
main.saveConfig();```
Config.yml
```yml
whitelist:
work: true
Thank you in advance 😄
I prefer VSCode to Eclipse.
Vscode is nice lol I like it but I don't use the bloatware called windoes
How do you build your Maven projects?
Use the buttons they provide
Otherwise for command line I'll use mvn clean install
What button are you pressing? I've tried the "package" and "install" ones and they don't work.
You also have a command not found compiler errorr lolI
Yeah it's running this command when I try "install" the project.
Try just mvn clean install in the proper directory including the pom
Not sure how to get it so that I can use maven from the command line tbh
Plugin antiRedstoneClock
how to remove the "no API version" method in the console
as i want my plugin to work on any version.
is this the wrong way to do it and if so how do u do it
So after you mvn clean install, is that making the jar file that can be put in the plugins folder?
Yea
Finally got everything working on VSCode only took me 5 hours lmao
Thanks for the help
Np nerd
Get good next time
hello
got this error
Hi
org.bukkit.command.CommandException: Unhandled exception executing command 'awc' in plugin AntiWitherCreation v1.0
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper.jar:git-Paper-794]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[paper.jar:git-Paper-794]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:826) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PlayerConnection.handleCommand(PlayerConnection.java:2185) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PlayerConnection.c(PlayerConnection.java:2000) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1953) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:49) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:7) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:35) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1271) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1264) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1225) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1139) ~[paper.jar:git-Paper-794]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[paper.jar:git-Paper-794]
at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at eu.cuziamnoah.antiwithercreation.commands.AntiWitherCommand.onCommand(AntiWitherCommand.java:22) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper.jar:git-Paper-794]
... 19 more
[03:35:49 INFO]: CuziamNoah lost connection: Disconnected
[03:35:50 INFO]: CuziamNoah left the game
What I do wrong?
Null points error
Idk 🤷♂️ theree a null point error I have 0 other information from you other than that I'll help yoh here and send a few useful links
?npe
The NullPointerException, (commonly referred to as NPE), is thrown in the following cases, but not sealed to: 1. null is passed into a method or constructor which does not allow it; 2. When trying to access a field on an object pointing to null; 3. Casting null to a primitive. See https://stackoverflow.com/a/3988794/17047120 for information on how to debug NPEs.
I want to fix the error, not to know what the error is.
Don't you have to know what it I'd to fix it
If I spoon feed you here you'll come back if you learn you'll beable to do it yourself in the future
Now what command did you send to your server
/awc
Ok now when you do args[0] that's an array of arguments you send.
You can't check for something that could exist without checking if it exists first
yes i know that, but I don't know how to change that.
For example your assuming every time someone runs aws they will have an argument such as enable or disable attached
I'm very new in java
So your assuming they will add an argument like so
/aws enable
/aws disable
So if someone were to run
/aws
and you check if an argument exists null a synonym of nil or nothing will return because there Is no argument
Ok and how do I add the argument for aws?
Now how do you combat null pointer errors or npe so it's fairly simple
Pretty simple
You can do something like
If object == null or in the case of an array of arguments you check for length so if length == 1 the following things can happen
Command arguments are structured like most list indexes in programming for example you can think of it like do
/aws arg0 arg1 arg2 arg3 arg4
And so in
If you were to run
/aws it's obvious that arg0 doesn't exist so therefore when you go looking for it it won't return anything and be out of index
Indexes always start at 0
No so you want your commands to look like this right?
/aws enable
/aws disable
So enable and disable in the examples above are at the index 0
So when you do args[0] it'll get enable and disable
ok
But with the current way your code is structured it's automatically assuming your command will always have 1 argument
So you need to check if that array (think of it as a list) is 1 item long
Before you can check if the argument is enable or disable
A null pointer error is when you try and dereference something that doesn't exist.
damn
So you have a pointer that's not working properly.
You need to check array length to see if it contains 1 argument before checking if its enabled or disable
so the sudo code would be
If array is length of atleast one continue to logic
or alternatively
If array isn't length of 1 return true
ok
?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.
Other useful resources for basics below
?paste
Is there a tag/guide to learn how to make my plugin compatible with other versions?
Right now, it works with 1.18 and 1.19... I need it to work with 1.16.5 and 1.17 as well.
how to modify/update code in a plugin you already added to your server in real time?
just make sure u use components that exist for all of those versions
I get this error: [22:18:52 ERROR]: Could not load 'plugins/RaidTheMine-Core.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.18 at org.bukkit.craftbukkit.v1_16_R3.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:361) ~[patched_1.16.5.jar:git-Paper-794] at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:149) ~[patched_1.16.5.jar:git-Paper-794] at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:414) ~[patched_1.16.5.jar:git-Paper-794] at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:322) ~[patched_1.16.5.jar:git-Paper-794] at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:393) ~[patched_1.16.5.jar:git-Paper-794] at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:269) ~[patched_1.16.5.jar:git-Paper-794] at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074) ~[patched_1.16.5.jar:git-Paper-794] at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794] at java.lang.Thread.run(Thread.java:831) [?:?]
or make ur code do things as similarly as possible if X version doesnt have what Y did
use the lowest version api u need to support
I'm almost certain the components aren't new that I'm using since it's very basic stuff :P
Where can I change my api version, sorry?
https://paste.gg/p/anonymous/fefa90cd0ca340d7bcf54ed808a39fbd is my current pox.xml. I'll change my plugin.yml to 1.16 api version
change ur paper version in there to be 1.16 instead of 1.19 too
and then in plugin.yml make api-version: 1.16
<version>1.16-R0.1-SNAPSHOT</version> like this?
Dependency 'io.papermc.paper:paper-api:1.16-R0.1-SNAPSHOT' not found oof
sec let me look at their mvn repo
Thank you!
https://papermc.io/repo/#browse/search=keyword%3Dpaper-api:maven-snapshots%3Acom.destroystokyo.paper%3Apaper-api%3A1.16.5-R0.1-SNAPSHOT looks like they still used the old groupid
Nexus Repository Manager
so com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT maybe
<dependencies>
<!--This adds the Paper API artifact to the build -->
<dependency>
<groupId>com.destroystokyo.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>``` Like this?
looks right
java: package net.kyori.adventure.text.minimessage does not exist damn. Okay, welp no gradients 😂
I thought it was 1.16, but not a clue
hmm
well minimessage is @young vine's no? they might be able to help
ur also better off asking this stuff in papers discord considering ur working with paper related stuff
this is a spigot
special text stuff
Was about to say...
Show
Yes thats me
beautiful
even my new garbage is embarrassing
https://github.com/winnpixie goes hard tho
I have a star?
Fork projects with many stars

Only occurs to me here that these are two emojis
I really missed having emotes when i didnt boost. How do youy guys survive without shitposts?
:big_slime:
returning fire
Ayeee, I got shooters.
me waiting for mojang to add custom glass pane colors
suspect is fleeing
texture pack ezpz
Feel like making a texture for all 16581375 combinations of color?
Feel like writing a python script to do that for you?
I dont know which one would be worse
What packets would I use to set a players name tag?
Packet
setCustomName
no that doesnt apply to players
pewpew
only mobs and other entities
how to draw lines 101:
grab ur pencil -> move it from point a to point b on a piece of paper -> voila
just write code to do this smh
i would do it in java bc a) i hate myself and b) fuck Python
The clout
Ikr
If you hate on Python your just a beta male
I really wish i could kick you
Lol
ur 1 away from greatness, do it.
How tf do i get one rep
Why
idk i dont have an SO account
Can someone help me figure out how to code a spigot plugin in python
just hack the JVM
@lost matrix i know you are experienced in this 😠
I know the ?ask command says to be patient but i am helper and we are friends therefore the rules do not apply
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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
how to modify/update code in a plugin you already added to your server in real time?
restart
is there any faster way to do it
Alternatively if you want to include memory leaks and unintended errors in your plugin you could reload
^
Otherwise stick with restart👍
how do you edit the code in a plugin?
Open compiled class in the jar files
And edit them with your unmatched knowledge of the compiled language
Jk, it depends on whether the author open-sourced the plugin
real
recaf
I'm trying to make the plugin and then add it to my server, would that work
Edit or make?
make and then edit
Oh, then it is whatever that has been replied
^
got it thanks all
If you meant to debug your plugin and find it troublesome to restart every time you make a change, there are some debugging tools out there able to connect to the server
But every time I use it my server will just crash after some time being stuck on the same tick lolol
You can use hotswapping with for instance dcevm, plugins like PlugWoman can also be nice to use for quick reloads though should definitely not be used on production.
how to change attack speed of item without NMS?
Just set the attack speed attribute of the item,
No. If you want to increase the attack speed of all items then you should just increase the base attack speed of the player.
I was asking if items like 'apple' could modify the attack speed, not only tools.
Bruh said it too hard.
Can I make the dragon with a speed of 2?
Yes you can set any attribute (like knockback, armor, damage, attack_speed) on any type of item
O redempt made plugwoman
This is a very interesting issue. But I'm having issues compiling my code.
It keeps going to pox.xml, not sure how to fix this.
Is there a way to make this using Bukkit/NMS?
With a resourcepack you can maybe do this. But it will be a lot of work.
Yeah, I've thought about that, but ty anyway
I don't understand... it just builds a pox.xml jar file, what?
Cus pom was selected as module?
I have 0 other options https://fwoostyhub.com/🎤🌖🏠🚐
You should just use build in maven. "Mvn clean install"
can I append a ComponentBuilder to another ComponentBuilder?
How could I run a function that returns several Components that I want to append to a ComponentBuilder?
Where would I find that? I see an install or compile
You can append components to each other no?
You can make a new ComponentBuilder and append stuff to it like TranslatableComponents or TextComponents but I have a function that creates a long list of Translatable/Text components appended together and i want to append those to the main ComponentBuilder in a different function
I think you can use the search bar and just enter maven clean install, the option will show then.
Then pass the builder into those functions?
There's a search bar? https://fwoostyhub.com/🍜🍵🪐🤎
I am so lost 😅
https://fwoostyhub.com/👄🍧👀💗
Same
You usually use BukkitAudiences.create(plugin)
And well… first check if the class is loaded during runtime if you’re not providing a classload of it yourself
Download the minecraft dev plugin for intellij and let it generate a clean project for you.
PS: Make sure your pom is in the right directory.
I've never used a plugin, is there a guide? :P
^ + a bunch of qol features
Nvm, I think I got it installed.
If you press the M there is yea
Now, time to try it :P
click edit configurations, add a maven configuration, command is clean install and click save or add or whatever, then run the configuration
@lime moat
I thought u would be the one person to understand how to do this, even I can do it smh
mister "I made java in python" guy
wait that was a serious question?
LOL i thought he was joking
@quaint mantle single beam or like a projectile?
Okay, I fixed the building after installing the dev plugin. Now, how can I change the build java version? (I need java 16)
Ah, thank you!
Add the maven-compiler-plugin and set source and target OR relese
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/froostysnoowman/Main has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 60.0``` still appears to not work
Alternatively use the properties to set target+source
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>```
ur java is too old?
oh wait nvm
60 is 16
are you building with maven?
IDE moment
No, with the Intellij build.
build with maven
Sure, this is how?
Do not use the IDE
yes
Most important step
https://fwoostyhub.com/🧖🦟🍦🐡 does this seem right?
Ah, I don't have java 16 installed on my pc. Do I need that?
What do you Run the Server with? Black Magic?
I have a host :P
error while writing com.froostysnoowman.Commands.FlyCommand: could not create parent directories welp
That's the error I get when I build it with maven
Whaaa
select the working directory as your folder
How can i fix this?
the folder ur code is in
Fix what?
it has error
https://fwoostyhub.com/🌒😠🥊🤽 it should be
the working direcotry is ~ somthing
I'd discard the Error If it works anyways
maybe use the file selector to selcet the folder
My eclipse Install complains about These Plugins Not existing too
But it still Runs anyways so eh
It should be like this, correct? https://fwoostyhub.com/🦺🔧💜🐒
Try to search it on https://mvnrepository.org I guess
okay thanks
And find the proper coordinates
what is the java version on that project.
1.8
my friend uses 1.8 too and he doesn't have that error
okay, thanks
Isn't shit, just learn intellij idea
theres a basic course on youtube
I've gone through every single tutorial to change the java version. It seems to be changed... then just isn't :D
The IDE isn’t shit due to that, you just don’t know how to change said property… that’s all
Dunno, I attempted to follow their docs, seems fine, but then just doesn't update?
There are only 2 places where you could change the jdk. 1) In your pom 2) In File > Project Structure... > Project > SDK
Did both
Then whats the issue
Show your pom
Just reloaded maven for the sake of it... and now this error: https://fwoostyhub.com/📹🤢😈😉
Close all directories and make screenshot of your project structure.
And then show your pom.
I can kinda build it with intellij... Maven has no hope right now...
But, when I build it and run it on a 1.16.5 server, I get this error: [02:32:23 INFO]: [IDunno] Enabling IDunno v1.0 [02:32:23 ERROR]: Error occurred while enabling IDunno v1.0 (Is it up to date?) java.lang.NoClassDefFoundError: net/kyori/adventure/sound/Sound$Emitter at com.froostysnoowman.test.Main.onEnable(Main.java:26) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Paper-794] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.16.5.jar:git-Paper-794] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.16.5.jar:git-Paper-794] at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:518) ~[patched_1.16.5.jar:git-Paper-794] at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:432) ~[patched_1.16.5.jar:git-Paper-794] at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:599) ~[patched_1.16.5.jar:git-Paper-794] at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:298) ~[patched_1.16.5.jar:git-Paper-794] at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074) ~[patched_1.16.5.jar:git-Paper-794] at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-794] at java.lang.Thread.run(Thread.java:831) [?:?] Caused by: java.lang.ClassNotFoundException: net.kyori.adventure.sound.Sound$Emitter at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:155) ~[patched_1.16.5.jar:git-Paper-794] at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:114) ~[patched_1.16.5.jar:git-Paper-794] at java.lang.ClassLoader.loadClass(ClassLoader.java:519) ~[?:?] ... 11 more [02:32:23 INFO]: [IDunno] Disabling IDunno v1.0
May be an Adventure error, but not 100% sure
You cant just build a maven project like that.
this looks so cool ngl
the embed and the picture
Why do you have "outputDirectory" configured? Do you even have this path on your pc? D:\AntiWeather\Plugins
I should have it
Delete this line
It appears to have a build success now, what...
After deleting this config entry?
Yes
Thank you for the maven help, I don't understand why that directory was doing that...
Now, to the console error: https://docs.adventure.kyori.net/platform/bukkit.html isn't this adventure?
yes. After compiling with maven the error should be gone.
Not entirely
I do also have this one: https://docs.adventure.kyori.net/minimessage/api
That’s just the Bukkit platform
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>4.11.0</version>
</dependency>```
It would but it’s a little bit special
You see…
In 1.16.5 adventure isn’t a part of paper
But in newer versions adventure is a part of paper (the classes get shipped with the paper jar)
Yeah, that's also another thing, I need it to work with default spigot :P
Why depend on adventure at all then?
sender.sendMessage(MiniMessage.miniMessage().deserialize(prefix_message + ' ' + no_permission_message, Placeholder.component("permission", Component.text("rtm.fly"))));``` This is the only way that I'm aware of to replace something in my config file with something else
(replace <permission> with rtm.fly)
Oh you use mini message
Yes
I mean why not just MiniMessage.miniMessage().deserialize(message.replace("<permission>","rtm.fly")) and then take the component and just convert it to text and send it
Suboptimal but that’s that
So, something like java sender.sendMessage(MiniMessage.miniMessage().deserialize(message.replace("<permission>","rtm.fly"))); would send it?
Don't suggest text replacements when a full placeholder system exists
What's wrong with placeholders?
Oh yeah don’t mind me on that one… but anyway you (froosty) probably have to shade both mini message and adventure to make that work on spigot 1.16.5
How shall I shade? (I'm very new to Java if you couldn't tell heh)
To use MiniMessage on legacy systems you need to shade MiniMessage, adventure and adventure platform so that you can actually send components
But why support legacy when the majority moved on? :/
^
Maven
Most of my personal servers use 1.16.5 (for gamemodes), so I need to support that
Time to update then
Let him live lmao
:<
xd
@lime moat shading with maven is a general Java thing rather than spigot, Google has plenty of resources on how to do it
Okay, just so I'm not horribly on the wrong track... is this something that I should be looking at? https://datacadamia.com/maven/shade
Else wise
Still gonna bugg you to update… but Alex there explains the concept of shading rather well I believe
👍
invalidate caches and restart...
tried👍
Try to use the maven CLI I guess
Quick question, would something like .replaceAll("<player>", target.getName() work instead of using MM?
Maybe but I was in the wrong there, use the placeholder tag resolver
Probably works much better with mm
Im thinking for 6 hours how can i set the block type between z=2000, x=2000??
I know how to fill but i dont know how can i make a function
for(int x= 2000; x> 0; x--){
//setting stuff
}
}```
Server will crash 100%
You need to distribute this over several ticks.
you can do it async
if you get the nms chunk
its block palette is synchronized
and yeah distribute it over multiple ticks
its not
Is there any tutorial? I dont know what is nms
paper made it synchronized
spigot will throw exceptions at you
sucks
Bad idea
cant you synchronize it yourself
Can this fill between 2000x2000?
the data is volatile tho
you could, but have to inject your own threaddetector
BRUH does spigot have that async thread detector built into nms
thought only bukkit api
There is a reason why that exists
You shouldn't modify the world on another thread
if its synchronized
you could
and the data itself is volatile
so it wouldnt cause any concurrency errors
but at some point that would block the main thread
you can do it per chunk sections
and if you subdivide the process into different threads, you can speed it up even more
if you make sure they all do different parts
and never conflict
Sure you can just put everything behind reentrant-able locks, but that will make your application suboptimal in terms of performance, if you wanna do things faster you’d have to java 9+ memory ordering effects along with compare and swap stuff, but that is hard to test and not at all trivial, as you probably know just setting everything to volatile isn’t very optimized either as you’d essentially be forcing local registries to flush too frequently if every non final variable would be put under memory effects of volatile (and as I hope you’re aware… volatile doesn’t solve all problems with concurrency inherently, especially when you need to invoke a set of operations in one go, where proper atomicity is needed)
words ^
dont think it would take too big of a performance hit, at least better than blocking the whole main thread with the operation
I mean you can just distribute the operation over several ticks
As I believe smile even wrote a guide for that
people need to learn how to use repeating tasks as do{} while() loops
so many people sturggle to understand that
Yup
heyho, i have a question. i wanna make a door permission lock, what means that only permissions what i set to them can open the doors.. how do i do that? im trying since 2 months and found no working soloution
Iterator<Block> iterator = cuboid.iterator();
Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, () -> {
for (int i = 0; i < BLOCKS_PER_TICK; i++) {
if (!iterator.hasNext())
return;
iterator.next().setType(blockTypes.generateRandom());
}
}, 0L, 1L);
@kindred valley
are you new to java?
not that new, but still in learning
tbh, if you're trying something like this for 2 months and havent found a solution, something is wrong with how you research stuff
what have you tried?
do an InteractEvent and if the block is door and the player has the specified permission allow the event but if the player doesnt have permission cancel the event
if (player.hasPermission("door.perm")
Problem here is that the task will keep running even when the iterator is empty.
i thought its like u click it with a tool, the position of the door getting saved and when the players tries to click the door the locations getting checked and if he got the permission then he can open if not its getting cancelled
oops
what
just need to add a cancel if it doesnt have a next
my english isnt the best so sorry when u cant understand it very well
yeah but how do i register them
?workdistribution (:
Is there a way to make projectile undodgeable by Enderman
what do u want the door permissions to look like?
just set nicks like med mex or something, little permissions i can add players to
dont use permissions to store data
@EventHandler
public void permDoor(PlayerInteractEvent e) {
Player player = e.getPlayer();
if (e.getBlock().getType() == Material.WOODEN_DOOR)
if (!player.hasPermission("awesomedoor.perm") {
e.setCancelled(true);
}
}
100% real
he wants to trust players
so u need to store trusted players
easy
yeah but i dont want to lock every door of that type yk
just only a few selected ones
is there a way to unobfuscate the nms code
Can’t use moj mappings?
store player names on array or file and if the file / array contains player names uncancel event
hmmm but how do i store them to different doors? like i want that one door i can open the other door only other player can open...
this unobfuscates nms
search the class and then the method
tells u moj mapping, obfuscated and spigot mapping
store location and player
sweet
ArrayList<Location, Player> magicdoors = new ArrayList<>();
LOL
?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.
and then i just make command for it to set the players those doors?
yea
hmm sounds good to me..
You mean map
ill go try it, ty
i confused
o.O
its hashmap
Map moment
this
you know if its possible to make it with a tool like a stick or something?
yep
listen for the interact event
PlayerInteractAtBlockEvent
i think
im going try it
😦
that was mean im sorry
im such a dumb idiot, forgot to set the sticks names so the plugin recognizes them
xd
is there a way to make projectile undodgeable by enderman
packet handlers in NMS have async catchers too, but they're vanilla
PacketUtils.ensureMainThread() gets called everytime packet gets handled
and its native
iterators not killing server?
iirc
is it possible to cancel jumping entirely? with or without nms?
MoveEvent?
Very high jump boost
put a very high jump boost on someone
That’s buggy
PlayerToggleFlightEvent?
i tried calculating and canceling it
Does not get called every jump
That could work
The high jump boost is the best strategy
Yeah i had many problems with move event too
alright thank you all
Huh?
Iterators kill the server?
Btw cancel if iterator doesn't have next
is it possible to replicate or fire the wardens sonic boom?
Im not even sure how the sonic boom is implemented.
Its not an entity so im assuming that its just a particle effect.
hmph i’ll do some digging and maybe some ray tracing then
okay im back, got it to save the location and owner, but now, how do i save multiple locations for one player?
I have no context but: Save a list or set of locations.
Map<UUID, List<Location>>
Nested collections is a bad code smell. I would advise against this. Encapsulate the List in a data object.
Not really..
For his use case it’s perfectly fine, no?
Referring to?
Its not perfectly fine. Its unclean.
It exposes data structures.
Unclean, how would you store it then?
Map<UUID, SomePlayerData>
In an object..
And SomePlayerData strongly encapsulates a List<Location>
Sure, kinda is the same thing though?
I guess not really.
i take that back
Object is better bc you can have multiple fields other than the said list if you wanted.
Alright
Don’t use that,
okay
use what 7smile7 said instead
That is just a nice effect. But the real benefit is that the list is no longer exposed which makes your code
just so much more robust.
Robustion
i wouldnt care about the list being exposed but it is nice to have the flexibility to add new fields
I would care very much if the list was exposed... It makes working with this data faster and cleaner.
Why would you write fragile code if you could just not?
yeah using a player data object is better
*And you could let the data object implement ConfigurationSerializable which means you can just put .set("some.player.path", playerData) it in a FileConfiguration.
like that?
Sure, kind of like that
Can I get support for ACF here?
You can ask and see if someone can help
Im using ACF for quite some while now
I followed their setup guide for the paper version, but in my Main class it doesn't recognise PaperCommandManager
Show your pom
Try invalidating your caches and restart
Didn't work
Does Intellij recognise the dependency?
Or is it still red
Oh hold on
It's still red, but now there's import class
wasn't there before
It works now, ty
Let the suffering begin. Acf takes a while to master.
Thanks xD
what is acf?
how do i give players permisions tags
only thing i can find is player.hasPermission("blabla")
other thing, how do i check for multiple events at once
so like, something happens when i shift and right after that
Pretty sure it just fires in a general player direction, with no tracking of who it was meant for
Ghast#getTarget returns the ghast's target because a ghast is a single-target "simple" entity
The dragon has phases
so can i get the direction ?
if i have a plugin thats made for 1.18 but a player uses it on 1.19 how can i make it so the player can use 1.19 blocks if they are on 1.19 even though the plugin is in 1.18?
Material#valueOf should consider that
how would i add permision to players
or check for multiple events that happen right afther eachother
you just listen to all of those events?
Permissible#addPermissionAttachment
Hello, did anyone know how to get vector from some location (x,y,z) to some player?
I think you can just subtract the two locations and that's the resulting vector
thank you
just subtract the destination from the origin
okay, now how to make hit from this direction looks like actual hit from player? xd
normalize the vector and you should be fine
to normalize a vector, just divide it through it's length. there's probably a normalize() method too
Hey, is there a way to play custom sounds using spigot? (Those custom sounds are added with a resource pack)
Nvm, found it
can you help me with plugin
Caused by: java.lang.NullPointerException: Cannot invoke "ru.yooxa.yapi.Gamer.isPartyOwner()" because "gamer" is null
at ru.yooxa.party.PartyListener.onQuit(PartyListener.java:67) ~[?:?]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[spigot.jar:git-Spigot-1.7.9-R0.2-208-ge0f2e95]
... 11 more
plugin - https://dropmefiles.com/2t40I
I can't figure out what's wrong
Make sure "gamer" is not null
I don't understand why it's null
Paste your code pls. And not as download
?paste
it still do some different type of kb, it just wired, tere is no vertical kb if im standing still, also power of kb depends on the distance from the block
i did
Location l1 = new Location(p.getWorld(),0.5, 2.62,0.5); Location l2 = p.getLocation(); Vector vec = l2.subtract(l1).toVector(); p.setVelocity(vec.normalize());
is image on map 1.19 avalable
should be
targetLoc.toVector().subtract(player.getLocation().toVector()).normalize();
You gotta normalize the resulting vector lol
its not even get better
i can still fly into the sky
what? that is a unit vector from the player to the destination
i also tried swap it
What are you trying to achieve?
emulate hit by player
i am trying to do a thing called reduce bot
Bukkit.createInventory(InventoryType.BEACON) is broken
beacon functionality is completely broken
it could be on purpose tho because there's no range
Why are you creating an inventory instead of getting teh beacons inventory?
ah
Bukkit.createInventory() implementation is very hacky in spigot
but it works
it creates a Class CraftInventoryCustom which creates spoofed container class for NMS to delegate NMS container classes
the problem is that packet handling do not check if craft inventory is custom
basically packets gets handled only if container type is derived from the NMS container type
which is not the case with wrapped MinecraftInventory class since it directly implements Container interface
i bet enchantment table is broken too unless its patched inside delegation class
lemme check
*on spigot
it has a patch inside CraftContainer
class to fix the anvil and crafting table
but not the enchanting table and the beacon afaik
oh man
Enchanting table is even more broken LOL
lemme record it
hmm buggy asf
Beacon GUI dont even provide default name when opened
beacon name is displayed by hovering the buttons normally
but instead i get container.beacon there
Are you building everything from ground up with containers or using bukkot createInventory
I am patching this from ground up for myself but what im showing is the functionality of Bukkit.createInventory()
Do you think you could write to the registry for custom inventory sizes it's something I've looked at in the past but was unsure about
I tried but one interface I needed to use as a parameter was private and nested
this could be fixed easily by adding instanceof CraftInventoryCustom.MinecraftInventory minecraftInventory && minecraftInventory.getType() == InventoryType.INVENTORY_TYPE_OF_PACKET into each guard clauses of ServerGamePacketListener class
i'm currently having a KingdomsPlayer class, which is basically a wrapper for a player which provides some extra stuff etc. in my opinion, it would be better to store a WeakReference<Player> internally instead of callin Bukkit.getPlayerExact every time
so is this a good way to set the player object when its actually available, (async pre login event doesnt have a ::getPlayer)
since packet handling except for slot handling are being ignored for the most past
Inventory sizes are not being stored in registries
InventoryTypes are
Ahhh
So even if you create another type there's no point since it can't be displayed by the client
yeah but make sure to make it weak
NMS Container class and in some places Menu with SimpleContainer inside store the size data
yee
i also have a logout method which stops sending an actionbar and stuff and clears the reference
It'd be impossible to have like a 5 slot inventory right?
hopper yeah
you could but it would desync from the player's client
unless there's menu type which provides 5 slots
Hmmm interesting
closest i can think of is hopper
Would you think it'd look fucky or just break
I'm just talking about non-conventional inventory sizes
for slot operations this method is not broken
there's no way to make those, unless you use some kind of resource pack to hide the other slots
and make implement a new class
in order to desync other slots
I've been curious about that for a long time when overlaying a resource pack title on an inventory what stops the other slots from ruining tje effect via shift clicking etc
Do you have to send packets on click to make it seem like there's no free slof
myes

