#help-development
1 messages · Page 1839 of 1
For example if the command takes an int arg and you type hello it will say invalid argument for <argument name>: hello and show the usage of that command
setsneaking inherits from entity
is pretty nasty
im using mojang mappings,
so idk what they are in mojang mappings
wait
I don't really agree, but I guess I can't convince you regardless
there is nms way
This said... the nice thing about having a really simple flexible command system is... if I want to create a big help thing
what do you mean with mojang mappings? i always use NMS classes
I can do add it ontop without requiring it
unless we mean the same thing i have no idea what you're talking about
do you know what mojang mappings are?
@waxen plinth yeah I mean, there are pros and cons... I haven't used your tool you haven't used mine so hard to say.
True
I might come around to it... and you might come around to my way.
I very much like my command file and generated help menus
back in the days I used EntityPlayer.setSneaking(true); to make fake player sneak idk if it still here
I just have found that even though having these super highly reactive systems is new and different and has a learning curve... so far it's got an almost 100% "omg this is great" ratio.
I should be going now though, I have a call soon
Yeah same, was fun
java.lang.NoSuchMethodError: 'net.minecraft.nbt.NBTTagCompound net.minecraft.world.item.ItemStack.save(net.minecraft.nbt.NBTTagCompound)'
It's been nice catching up with you
help me
it is in 1.8 but i'm not sure for later ones
danm Entity is 2k lines of code
omg i found it, its ServerPlayer#setPose(Pose.CROUCHING)
nice
although, im not sure the server will send the player pose with the PlayerInfo packets
btw if you are looking for MC related work hit me up.
because some properties in ServerPlayer dont get baked into the packets
anyways ill just try it
you can use a metadata packet
im pretty sure
any method here has error: java.lang.NoSuchMethodError: 'void net.minecraft.world.item.ItemStack.resetHoverName()'
kill05, yea, thats what i was asking for before, i was confused what the DataWatcher.watch method is in mojang remapped
yea, but spigot mappings still has a lot of obfuscated stuff
¯_(ツ)_/¯
i might change back to spigot mappings but ill have to rewrite all the code lol
lol
I'm experiencing some problems with md_5's maven plugin to remap mojang mapped plugins to spigot mapped jars
see what i mean lol
and the problems are...?
Failed to parse plugin descriptor for net.md-5:SpecialSource:1.10.0 (C:\Users\loepi\.m2\repository\net\md-5\SpecialSource\1.10.0\SpecialSource-1.10.0.jar): No plugin descriptor found at META-INF/maven/plugin.xml -> [Help 1]
i keep getting this error
wait wrong site
it keeps getting better
public int aE() {
return 3;
}
public boolean aI() {
return false;
}
now ive learnt how to use both mysql and mongodb
ok imma stop
lmao
the wonders of obfuscation
mysql is basically useles nowdays, it's not as secure anymore
so what we usin then
SQLite
yea lemme just construct an Entity and implement the abstract methods
its basically MySQL but its a local .db file
yeah!
cant we use db
create a blank entity just to use the number 3 🤔
mysql is bettter self hosted
its easier to use
nah too confusing
for the Driver.getConnection, the protocol is just sqlite3:jdbc:<path>
or something like that
and the language syntax is the exact same as MySQL
if you want i can send you a library i made for SQLite
lol 🥄
smh
What's the food level of a player?
is there a sane way to keep a wolf angry
I set them to angry but that really does about as much as tickling them
they need a target i'd imagine
if the target goes out of range will they stop being angry?
I'd try listening to EntityTargetEvent for when the wolf's target is set to null and cancel / reset the target back to the old target
most likely yeah
this sort of sucks
list the angry wolves with their player somewhere like a map or smth
player move event
if a wolf is in range
and in the map with the player
angry t hem with player
yeah this is why I said "sane" way
gl
not a happy camper
did you try this?
mojang make wolves less pettable
public class KeepWolvesAngry {
public void showMeYouWarFace(EliteEntity entity){
}
}
this is how you know I am starting to lose my mind
The less pettable wolves are called polar bears
if (cmd.getName().equalsIgnoreCase("funi"))
{
player.sendMessage("you look funi");
}
} else {
sender.sendMessage("okay");
}
return false;
} ```
else without if but there is an if.
(uh, sory, bot deleted my message because website adress)
Hello guys, i have a little problem with spigot 1.18 to write my plugin
previously I was using spigot 1.17 and everything was ok, and now when I wanted to start using spigot 1.18 and I used it in my project structure, it turns out that none of the imports in my code that I had can search
and i see that in spigot-1.18.jar there's just only org.bukkit.craftbukkit.bootstrap.Main, and nothing else :/
use the jar in the spigot-api folder
Yup, the new version's spigot-1.18 file is a bootstrap now
Please!
I would also recommend using a proper build tool like maven, though it can take a little bit of learning
Do you need the .iml file to run your project?
What's your question?
I replied to it
"else without if but there is an if" wut
I have an issue, it says else without an if
how?
After compile you should just have the jar of your plugin
1.18BuildTools\Spigot\Spigot-API\target\
your code is indented improperly
and is hard to read
you have an extra curly bracket after the else
and I don't think you understand how to code
If you're finished with the command you should also return true;
Returning false in a command just makes the command text "/command" appear in chat
I do I just copied my code again to duplicate it, but I have indent errors
ok, so fix the indent errors
@worldly ingot Thoughts on this PR now? I did one similar a few months back but updated it and cleaned it up now: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/980/overview
Sorry for my lack of familiarity, but I still don't understand :/
Use buildtools; barring that use the libraries in the bundler/libraries/ directory. In general I recommend using maven for future projects, if you need a quick tutorial on how to get set up with maven I can pm it to you
oh, thank you, I think I can handle maven already, but I'll write if I need to
this.player.containerMenu instanceof ContainerRecipeBook<?>;
Is this valid? I thought you couldn't check for generics in an instanceof.
Only other comments are on the Bukkit side. Missing Javadocs for everything (I don't know what that event is - presumably when someone clicks a Recipe in their recipe book?) and indentation in Bukkit is 4 spaces, not 2
I don't think you can do that
I think it's a Java 14+ thing?
Actually wait
Is it? o.O They're erased at runtime, no?
Yo ucan do instanceof Thing<?>
Or was that introduced with pattern matching?
You can't use an actual type though
Lemme check, IntelliJ was screaming at me to fix it
Oh, yeah, I guess <?> would make sense because it's equivalent to just the type
Yeah
Dunno, looks weird lol
But yeah, only comments on the Bukkit side, really
Until very recently I didn't even realize you can get the generic type of a field
It's only objects that you can't get the generic type of
For parameters and fields you can
Like if a method takes a List<String> you can actually get that component type
Okay cool, will make them now
But only if it is known at compiletime
If i'm going to be using one method for almost all the files to get the chat prefix for the plugin, is it then respectable to use static?
I left my Bukkit comments in the PR so they're not lost here/repeated by another contributor
Use static if you want
A major reason people bemoan it is because it makes unit testing extremely difficult
But almost nobody unit tests their plugins anyways
It can be difficult to test some things. Unless it's data driven, really
yea thats true, won't be unit testing it either way
I mostly just use constructions but yeah for utilities, maybe better to just use static on some stuff
Having a PR accepted with 0 comments is truly a victory
Never mind that it was 3 lines
You do not have permission to access Bitbucket.
Make sure you're logged in, MSWS. Though PRs are restricted to those that have signed the CLA, unfortunately, because BitBucket doesn't separate the read and write permissions for some weird reason
Did you approve a PR from MD XD
how do i sign the CLA
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
They're processed manually though so it will take a few days or so to get you in there
Man bukkit has gotten a lot less PRs than I imagined
Well it's API changes, right? So generally CB gets more patches (almost 1,000 now I believe) because implementation and server patches are more common to fix bugs with API or server internals
Mmh true
Bear in mind that this is also Spigot's maintenance of Bukkit. There were also PRs pre-Spigot
A lot of PRs just sitting open
Yeah, either not finished, changes unsuitable for Bukkit, author disappeared after requested changes, or better API was introduced
Ohh choco, could you check, I think I signed the cla, but somehow im not able to login 👀
I would expect the unsuited or obsolete ones to be closed at least
IIRC only MD can see those
Ah ic
ngl I've no idea if Cindy's still around. I've not heard from her in years
Cindy?
What's the best way to provide an API entrypoint for Spigot?
I don't want to make API users dependent on the plugin class as I deem it kind of gross.
Is there any other method?
Yeah. Cindy was an IRC staff member and she handled the Spigot emails and CLA signings, etc.
Then again, I don't hear from dmck at all but he's still chugging along every single day
Dedicated man he is lol
Alright, resetting the jira pass worked ig 👀
Oh nice
May have been accepted already
got a weird email from resetting it at hub.spigotmc.org that it was a managed account or sth
can anyone walk me through the steps of setting up a plugin in kotlin
in intellij btw
its the shainy PR xd
What's the best way to stop a player from moving?
Quick Question, does PlayerMoveEvent really does have a serious impact on memory?
depends what u do with it
Store the players movement location everytime they move 🧠
It really does depend if I use in-memory info against file info or database info huh
@worldly ingot I just noticed the patch was corrupted so I reapplied it and committed, my diff seems to be swapping around this teleport function though, it produces the same code just the patch is different. https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/980/diff#nms-patches/net/minecraft/server/network/PlayerConnection.patch
Is that okay?
Your CB might be out of date. I would say pull, copy the code that you've edited in that patch, run applyPatches again (so as to update your files to the latest version of CB), then re-paste in your edited code
If that snippet still shows, you're probably fine, might just be weirdness with Git's patches
Is moss being bonemealed not caught by Bukkit?
I see no patch in the block and it looks to me like a BlockFormEvent isn't called (just based on source code, I've not tested that)
can i copy and past pom.xml dependencies and repositories from java projects over to my kotlin project?
im extremely new to kotlin so im not 100% sure how compatible it is
Is there a way to get a player from the EntityDamgeEvent? I tried casting player but that doesn't seem to work
it'd either be the entity or the attacker
Depends on your context. You probably want to listen to an EntityDamageByEntityEvent and check the getDamager()
you what the entity that's being attacked?
yes
it's probably getVictim() or getDamaged()
No, getEntity() is fine, just check if it's a player before you cast it
.
ah
thats what I did wrong your right choco
I was casting the player before checking
Yeah you can afaik, Wally. Kotlin can interact with Java libraries, to my knowledge
Though I'm no Kotlin aficionado, that's for sure
From EntityDamageEvent? o.O #getEntity() will never be null
code?
yes
I'd also be interested to see. You have to be doing something wrong 
you're probably using gradle if you're using kotlin though
@EventHandler
public void onEntityDamageEvent(EntityDamageEvent e) {
PlayerData user = StuntCore.getInstance().getUser(e.getEntity().getName());
if (e.getEntity() instanceof Player && user != null && (user.isFrozen()))
e.setCancelled(true);
}
No reason to use their uuid
my guess is getUser is returning null
absolutely not :)
no it works
Usernames can change, UUID doesn't. Storing data under username means when they change the name, now they've lost their old data
Yeah, the only thing that can do wrong there is the user being null (or isFrozen() not being accurate, one of two)
The code works fine guys dw
👀 but it doesn't. It's not cancelling
it is
Oh, so what was the issue? 
I'm not storing it perm
That works then
fwiw, a UUID is slightly faster than comparing a String though
That adds up 👀
no
just do String - 1 then boom its faster
if you want I can compare their uuid
I do have a method
using UUID is more conventional and standardized
there's no harm in using it afaik
it's more of a "why not"
can't be bothered to change it all
@worldly ingot for some reason CheckStyle doesn't pick up the indent formatting issue, it seems to be okay with 2 space indents 🤷♂️
james I don't think there is a need to always take him
for those that know about Gradle: is there a way I can copy the generated jar to another directory on build?
Really? o.O Bukkit's Checkstyle should have a 4 space clause in there last I recall
I had to make a batch file to do that ^
I mean either way it should be 4 spaces to conform with the rest of the project, but I figured CS would catch it
it doesnt check nms changes
It's a new event I added to Bukkit, IntelliJ defaulted to 2 space indents when creating the class but CheckStyle doesn't seem to pick it up?
So it's not NMS code
There's no 'IndentationCheck' in the CheckStyle config for Bukkit
Can someone send their source code for their plugin
whats the best kotlin tut around
That one
I've got a bunch at https://github.com/2008Choco
Alchema is probably the more interesting one tbh
oh no way choco you made the veinminer plugin?
(RE: oofergang, not Wally, lol sorry)
Yeah
Long while ago. Needs some refactoring. The code isn't super pretty
i use that all the time on my smp lol
Seems like this would work for the checkstyle: <module name="Indentation"> <property name="basicOffset" value="4"/> <property name="lineWrappingIndentation" value="4"/> <property name="arrayInitIndent" value="4"/> </module>
i guess you're to blame for my constant in game hunger
I'd say just the first one would be fine, james. Not sure the line wrap or array init are super necessary because Bukkit avoids both of those wherever possible
Either md can add that one to the checkstyle or you can PR it I guess
Yeah I was just thinking that, it seems to work with just the first line
Ah, it doesn't like the switch statement style used in a lot of classes:
switch expression broooo
?
switch (face) {
case Monkey -> SHOUT SHOUT MORE;
}```
it should be like that
idk the arrow is correct or not
Oh, this is just a Bukkit class, most of Bukkit is still just Java 8 I assume
oh i remember something, even after updated to java 16, then java 17, but the readme in both bukkit and craftbukkit (maybe including spigot idk) still havent change their contents lol
As in, Java 8 style with none of the new language features
like they say they still using java 8, etc.
Oh really, I may have used a 'var' in CraftBukkit 🤔
Are we supposed to be sticking to Java 8 lang features then in CraftBukkit/Bukkit?
dunno
No not really
Gotcha, the readme does still say Although the minimum requirement for compilation & usage is Java 8, we prefer all contributions to be written in Java 7 style code unless there is a compelling reason otherwise. Though tbf 😛
Isn’t that 8
Minimum is 8
"J7 style"
you really searched it lul
Gotcha, so var should be fine then 😛
Maybe functional interfaces are a compelling enough reason
Java 14+ features are really nice tbf, the new switch statements are really nice
like I guess in a twr block smtng like try (var reader = …) {} is fine
Where the type inferred is conspicuous
Yeah
I used it in PlayerConnection.java instead of writing out the fully qualified package name: var event = new org.bukkit.event.inventory.InventoryRecipeBookEvent(this.player.containerMenu.getBukkitView(), irecipe.toBukkitRecipe(), packetplayinautorecipe.isShiftDown());
Like people use it for anonymous derivatives type exposure
But thats scarcely needed
I'm adding attributes to items using attribute modifiers, but how can I make it so that the attribute simply sets the value, instead of modifying it with a operation? (this would be similar to the default attributes, examples being tools (attack speed of 1, not +1))
oh right
It just saves the line being the width of my monitor, and saves having to add an import into that patch 😄
I mean you could extract some more explanatory variables also there
boolean isShift = packetplayinautorecipe.isShiftDown();
Then just pass isShift
¯_(ツ)_/¯
I seem to remember choco saying not to do that when the call is only used once
Idk, I usually do it regardless (not that I have ever prd spigot) but it does make the code a bit more readable like well written prose (:
NMS patches should be minimal diff
Yeah, at work we would probably do it like that, but I suppose in Spigot you want to minimise the amount of patching
Yeah
how to check if ice becomes water?
Also, does anyone else get a crash when debugging CraftBukkit, at this method? Bukkit.getConsoleSender() is annotated with @NotNull but it returns null when run in Intellij, if you remove the annotation it works fine?
Hi there, I'm looking to upgrade my plugin to be 1.18, however when compiling I'm presented this error. Any suggestions?
Required by:
project : > org.spigotmc:spigot:1.18-R0.1-SNAPSHOT:20211130.174052-1
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html``` I can provide the build.gradle if needed
how can I add a suffix to a player's name?
note that, afaik, setDisplayName does not work with Player
at least, not for nametags
in fact actually I kind of need it to be nametag only
I'd use scoreboard objectives to display text under the player's name
but unfortunately, that doesn't give me enough customization
can I use teams to display the suffix only on a player's nameplate/nametag?
y'know, the text that hovers above them
yes
if so, I'd like some example code
oh good
the scoreboard APIs are a bit hard to understand so yeah I need an example, thanks
currently on my phone so i don’t have one
i’m sure there are a lot of examples on google
as thats where i probably yoinked it from when i made it
a lot of them are for 1.8 :p
oh huh
there's a wiki entry
nice
ah apparently there's a length limit?
I can work with that ig
16 pre-1.13
64 post-1.13
there's also an interesting trick you can do to get 32 but it's not applicable to my situation
i tried to update my plugin to 1.18 and I had a thing before to chect nbt but now it doesnt work, is there a new way or am i doing something wrong
net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
NBTTagCompound compound = (nmsItem.hasTag()) ? nmsItem.getTag() : new NBTTagCompound();
Hi, is there an event for when an Arrow entity dies (not despawns)? It is not in EntityDeathEvent. Thank you in advance
Dies as in what
Under what circumstances would you consider an arrow to have died
item.getItemMeta().getCustomModelData();
lol
I don't think you can really test for that
Hmm... it's weird, I think Arrows are the only entity you can't test for. You can test for boats, item frames, minecarts, armor stands, etc. They all work with EntityDeathEvent or their own events
is the entity of an EntityDamageEvent always a LivingEntity?
Yes, I believe so
or, EntityDeathEvent at least is
I just checked -- killing an arrow isn't detected by EntityDamageEvent, sadly.
that's okay
I only really need to target mobs and players
so entities like arrows or paintings are not what I wanna target
I need to access some plugins API which is only available for java 17. I need my .jar to be compiled with 1.8 though. ANY WAY I can achieve this without reflection? :/
take advantage of classloading
you can use a small amount of reflection to
reflectively run a method that sets up that newer plugin API if the MC version matches
the overhead will be minimum
of course I can, just wondering whether I could do it otherwise
but yeah will be reflection then, it's just one method call anyway
I thought maybe there is some magic trick
I don't think there is anything you could do otherwise
that works?
I didnt even know that was possible
warning: source release 17 requires target release 17
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
At least that doesn't work :/
Put source as 8 too
do I need to use async to teleport a player to another location?
no?
no but it would be not bad
maybe you need it only when teleport too much players
if you can, tp async
PaperLib has a method that falls back to synced TPing when running Spigot
I want to develop a warp system, would it be necessary to use async?
I would say absolutely yes
otherwise you can get lag spikes from chunk loading
as said, PaperLib will try to load chunks async if possible, then teleport the player. When you just use Player.teleport, the chunk gets instantly loaded IIRC
player.teleport(getLocation("cabin"));
});```
Would that solve my problem?
A friend suggested this.
normal teleports?
without that async task
Wouldn't that slow down the server?
it will either not work properly because you access the world api async / outside of the main thread, or it load the chunks on the main thread anyway
the opposite is the case
you slow it down by instantly loading chunks from disk
So will I use player.teleport that will be enough?
PaperLib is probably better
But trying to do an async tp without it will probably just throw an exception
no as said
PaperLib falls back to normal teleportig / chunk loading when not running paper
PaperLib is a tiny lib that must be shaded
so it will always work 🙂 on paper async, on spigot sync
anyone here knows how I can remove furniture I placed with oraxen? I can place it fine but there doesn't seem to be any method to remove it again 😄
I want to develop a simple warp system for my server. Would it be better to do in file or in mysql?
simple /warp <local> and go to local.
yes yes
then do it however you like. People will claim YAML files aren't meant for storage but you don't have to save that file every second, just load it on startup and save it on shutdown
unless you want to use SQL 😄
Hence the without it
I am pretty sure it always has to be shaded, even when using paper
Yes
What would you say is the point where it'd be more efficient to use SQL vs storing the <name, location> maps in memory while running? I can't see this becoming a big issue until you have a particularly large server
Persistent storage
Eh? Not really the question I was asking there haha
is there a way in spigot
to make
a custom shield which can:
- gets broken by other weapons, not just an axe
- customizable cooldown for how long until it reloads
yes
Then it’s pretty much never more efficient
You generally cache sql to memory anyway
Hmm right
how would i go about making custom drops from an entity?
mysql or interbase >
check the death event and edit the drops
thanks
Runtime library
Runtime.getRuntime().usedMemory()
You'll need to convert to GB/MB as needed
Thanks a lot!
Is it Possible to Change user's name only server?
I mean like what I see when I press tab
I want to make anonymous user plugin
Player.setPlayerListName
could anyone tell me what the shaded version of the jar with maven is/the difference?
how do I get the value of a name tag (referring to the item Name Tag, I want to get the name embedded in the tag)
I haven't seen a TagMeta or anythin'
Afaik it's just the items display name
(!craftTippedArrow.isVisualFire() || !craftTippedArrow.hasCustomEffects()) should tell me if an arrow is 'not' on fire or enchanted correct?
Not on fire or has a potion effect
May still be enchanted
Also I think it uses the actual fire ticks, not visual fire
cant find a bool to test for this driving me nutz
Im trying to make sure its not, not allowing anything but just a plain arrow be touched
does someone knows how to use the PacketPlayOutWorldParticles package, i try to spawn a large explosion particle
What version
1.17.1
Use the API
which api
ye, that dint work well
i try to summon with this package a sizeble particle, wgich is not possible with the spawnParticle() argument
:/
false
every single thing you can do with a packet you can do with spawnParticle
because spawnParticle just makes a packet
but i can only edit the speed and not the size, i tried it out, or i am wrong?
its not an dust particle so you cant use DustOptions
https://wiki.vg/Protocol#Particle
most particles don't support a scale, so it makes sense that spigot would also not support a scale for most particles
ok 😦
Send the particle to 1 user only? Lol
no you can do a for loop for every online player
Yes….
That's not what I said.
When was that added? Cause any time I used the api to spawn a particle anyone can see it
Literally since the api has existed
The methods are in World and Player
Take a guess which does what
I've used both lol.
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) args can be used to pass arguments and make decisions based on that right ?
Yes
Like I am currently making a kit command from the tutorial and am thinking of allowing the player to make choices based on existing kits
right thanks
Getting Cannot resolve org.spigotmc:spigot:1.18-R0.1-SNAPSHOT when I try to get the nms depencencies through maven. My pom.xml https://www.toptal.com/developers/hastebin/jojecinaje.xml
Hace you run BuildTools
oh
crap
forgot about that part
LMFAO
sorry man
wait hangon I think i maybe have?
will run again to double check
Also remove the spigot api for 1.18.1
Also you don't need both spigot-api and spigot in dependencies, spigot contains spigot-api
Recommend updating to 1.18.1 in general, to fix the log4j issue
It should be fixed in 1.18 as well
buenas un developer q me pieda ayudar en mi server pago por configurar
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Well, a developer who can help me with my server, I pay to configure
This then
Still getting there same error
Are you running buildtools to get 1.18.1? Your references in pom are for 1.18
Hi guys, does anyone know an annotation processor for brigadier? I've created a lib that exposes brigadier and know I need to build my command
😭
probably that
bruh
welp there we go
oh now theres a new error
New error: Could not find artifact org.spigotmc:spigot:jar:remapped-mojang:1.18.1-R0.1-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
Run buildtools with the --remapped flag
so java -jar BuildTools.jar --rev 1.18.1 --remapped
Here's the command I used to do it a while ago
So yes
A note for the new version - naming scheme for NMS entities has changed somewhat from "EntityWolf" to "Wolf" just make sure you're importing the right thing
ah right ty
dont think i've messed with any entities in this specific plugin im trying to update
but good to know
dev are who make plugins, you only want configer to config those plugins right?
btw when you want to offer any service dont advertise it here
there is a datawatcher.watch method in 1.8
but wath is it in 1.9+ ?
getDataWatcher().watch(10, (byte) 127); is in 1.8
is getDataWatcher().set(DataWatcherRegistry.a.a(10), (byte) 127); correct in 1.9+ ?
did that, still has a red line under it
but not saying an error anymore
just says 'Synced' or wtever'
Can you refresh maven now without errors?
Let's see the pom then
Cool
the red line was just chilling there cos it can
restarted intellij and it went away lmao
p
Enjoy the new version, make some cool stuff
Is there a way to safe a String Array in a persistent data container just as an NBT-Array with NBT-Strings or do I have to have a custom container for every element in the array? (like lores are stored in NBT?)
Just a string
What?
You can save it as Persistent datatype.String[] iirc
Sure? I couldn't find a type like that in the PersistentDataTypes class
Hmm i don't have my ide
Maybe only primitive arrays
Or do something like Arrays.tostring
I don't want to use some sort of hack to save it in a way it shouldn't be saved. That will make it harder in case I want to manually edit it
Well, a List of elements should probably be saved in a list, not just a string with some separator character.
I was hoping it can be done the way Lore is saved in an Item somehow
But that data type doesn't seem to be available
Arrays.toString makes sense to me, the only difference is really how it's stored until ready to be used
You Cant save non primitives into the PDC except for string
Yeah, it is possible. It's just not a great solution
Lists with String-Elements exist in normal NBT, but I don't think they are possible to represent with the PersistentDataContainer-API
Unless you can somehow take over the serialization of the entire data structure instead of just the value
Then i would consider using a database or something
I mean just implement PersistentDataType?
Even data structures are considered values
What would that look like?
Extending persistent datatype class prob
Let me take a peek mcmdev
And writing An implementation
Yeah thats obvious, but how would I serialize custom data structure instead of just a value
Smh stupid autocorrection
But it’s definitely possible, maybe through having a PersistentDataType<String[],List<String>>
well figured out a way to know if an arrow is on fire or enchanted. dances
I’ll hop on pc soon (can help more thoroughly then)
Conclure why not just a flat file or database?
That’s up to him

That would presume that String[] exists a primitive data type
Yeah
Else go with simply byte[]
I actually don’t remember all the types
But ye str arr type might not be valid
I'm saving information on blocks at specific coordinates in the chunk.
I don’t know how well it scales so yeah might be true
I'll give serializing my custom data structure into a byte array and saving that a shot, although I'd imagine it will get escaped
what does serializing mean?
Hmm yeah, well you could always peek at how its done in nms
with configuration
I don’t know the exact definition
But basically that you turn something into another form
what does Desterilizing and serializing do?
For instance this other form can merely be representing the former form
But still enough representation such that you can turn the latter form back to the former form
In context of Java, you might have objects from classes like an instance of ConclureBabyFactoryImplementationBase
then we might want to save it down to a file
However the file does not on its own know anything about my object which lives on the heap
so we have to serialize it to a format such that it can be written into the file
b a b y f a c t o r y
does it have a parent class?
👀
And then deserialization is essentially the reverse of that, taking that format and reading it into an instance.
declaration: package: org.bukkit.configuration.serialization, interface: ConfigurationSerializable

To describe it in the simplest way possible.
Serialization/deserialization is just converting between in-heap objects and other formats.
Ah yeah that's part of Bukkit's serialization API. I honestly don't know enough about it to say anything.
Yeah basically any class which implements it serializes complex objects into a Map<String,Object>
Where Object must be another Map<String,Object> or a boxed primitive or String iirc
it was made me wonder what it mean back then i started coding
Serializing my custom NBT into a byte array and saving that didn't work. It got escaped. (as I would have guessed)
I’ll give it a try mcmdev
someone explained it like a balloon with hot air and you release some of the hot air from the balloon

that made actually made me think like wtf did it even mean
pettable?
@lavish hemlock is Rust a Programming language? XD
this is basically like
C
but nothing like C
but also better than C or C++
i still wanna figure out what this means and etc
going to learn about deserialization
in some video or website
it can be about as fast or even faster than C (an already incredibly fast language)
it has a lot of QoL features for developers so you don't have to spend so much time writing code
(e.g. macros, proc macros)
it gives you the ability to be safe or unsafe with your code via the Safe/Unsafe Rust principles
Just for fun
Part 2, with -O1
https://youtu.be/mrxXJKffsKA
ConclureBaby 😳 👀
I seriously doubt this is an accurate benchmark
BabyFac...
ah
🥶
there was no optimization applied to the compilation
that's why it's slower than C#
why choosing Rust?
since C# JITs to low-level, which is automatically optimized
This is not how you benchmark a program that runs in a just-in-time compiled environment. You first have to warmup the C# application to get real results.
You also did not turn on optimizations for the native code.
These are very misleading and meaingless results.
i heard the compiler can make a difference
commenter summed it up
[11:39:33] [Server thread/ERROR]: Error occurred while enabling LostKingdomDSRV v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.branchyz.LostKingdomDSRV.LostKingdomDSRV.getCommand(String)" is null
name: LostKingdomDSRV
version: '${project.version}'
main: me.branchyz.LostKingdomDSRV.LostKingdomDSRV
api-version: 1.17
depend: [PlaceholderAPI, KingdomCraft, DiscordSRV]
authors: [LostKingdom, Branchyz]
description: LostKingdomDSRV
commands:
lock:
description: Met deze command kan je je trust lijst beheren!
setupkingdomdsrv:
description: Temp Command
Why does it give this error?
getCommand("setupkingdomdsrv ").setExecutor(new SetupKingdomDSRVCommand());
In onEnable();
wait there is a space
ah so basically
ye
remove the space, if this dosent show me the SetupKingdomDSRVCommand() class
English 1+ xD
Hey all, I'm trying to make spawners drop when they are broken, the issue I'm running into is that the spawner is always stripped of its mob type (i.e. Zombie spawner will drop a pig spawner)
i dont know if you can set the spawner type with nbt data
you can set nbt data and on place event
you can changed placed spawner
All i know it is possible to set Data and on blocks and Items
So I just set (custom?) nbt data and check for that data once its placed? Haven't worked much with nbt data before
i love to use Persistent Data Containers
yes that
i forgot what it was called
you could
Alrighties! I'll give it a go, thanks
wait would be a great idea to save the data and put it on the Spawner?
then set data on placement
i never realy worked with block
i never done it myself
Is handling configs with a plugin a good idea?
wym by handling configs?
Modifying configs of plugins using a plugin
Well
do you mean something like settings
get should still work
yes
without any change
then its no modification
Use the plugins API if it has one, before going for its data files.
wut about the set?
Can you just get comments using the Spigot API?
no
because yaml specs sucks
or well
snakeyaml and eo yaml do have some support for comments
altho limited
Idk if spigot uses a version of snake yaml where comments are supported for nodes tho
Or else I assume you could loop through a config line by line store the lines starting with # and store it somewhere else then after modification put it back where it's supposed to be
not always
You can, btu its not easy
because the order of which the nodes are can change
and any node could be removed from said document at any given point of time
it is even stated by the spec that comments are merely there to explain the node structure
nothing else
Seems promising
then thats not following the specs
no its definately not
yoinks the code
it actually saves the yaml twice
first time with no comments, then it parses it and adds back comments
hey everyone
i have an issue running an mc server on google colab
how can i set up ngrok?
just to demonstrate how messy it is:
#valid comment
--- #valid comment
#valid comment
Time: 2001-11-23 15:01:42 -5 #valid comment
#valid comment
User: ed #valid comment
#valid comment
Warning: #valid comment
#valid comment
This is an error message #valid comment
#valid comment
for the log file #valid comment
#valid comment
--- #valid comment
#valid comment
Time: 2001-11-23 15:02:31 -5 #valid comment
#valid comment
User: ed #valid comment
#valid comment
Warning: #valid comment
A slightly different error #valid comment
#valid comment
message. #valid comment
#valid comment
--- #valid comment
#valid comment
Date: 2001-11-23 15:03:17 -5 #valid comment
#valid comment
User: ed #valid comment
#valid comment
Fatal: #valid comment
#valid comment
Unknown variable "bar" #valid comment
#valid comment
Stack: #valid comment
#valid comment
- file: TopClass.py #valid comment
#valid comment
line: 23 #valid comment
#valid comment
code: | #valid comment
#valid comment
x = MoreObject("345\n") #valid comment
#valid comment
- file: MoreClass.py #valid comment
#valid comment
line: 58 #valid comment
#valid comment
code: |- #valid comment
#valid comment
foo = bar #valid comment
#valid comment
is google colab linux based?
idk it uses python
Google Colab runs on a Linux-based hosted machine. So we can run Linux commands on it directly. It is easy and throttles download speeds
yeah it does
./ngrok tcp -region eu 25565
uh
wait how do i run ngrok in it?
well
NameError Traceback (most recent call last)
<ipython-input-15-652ba67a9216> in <module>()
----> 1 ngrok(tcp, -region, eu, 25565)
NameError: name 'ngrok' is not defined
Looks like I am better off creating a API devs can use for their plugin which describes what every line does and then fetching that information and putting it in my plugin
it seems to be only working on python @round finch
you use the command on the ngrok program
first register token ./ngrok authtoken (token)
did you make it work?
nope
is there any reliable way to check if player is on ground?
than can't i calculate like how client do it?
You could, test for a block under the player, or the player is crouched and has no Y component to their velocity
on ground detection can be pretty finicky
you could also check if the client is obviously lying
like if the client says they’re on the ground but they’re also flying, falling, swimming, etc.
Dutch brrr
why does this even compile
Hello, is there a way to have server.properties file without opening it manually ?
I'm trying to read the world name
To read it without opening it manually? Yes
because the compiler is stupid
oh no because I am stupid lmao
yess
Hem im too
Nice
and how? I don't see any way
so you DO open it manually
they probably looked for a way to avoid reading the file yourself
You understand what I mean...
Ah not really
like you can get spigot's configuration with Bukkit.spigot().getConfig(), they asked for a similar way for the server.properties file
so
without loading that file on your own but using a built in spigot way
Ah idk if there is
there is probably using NMS but at that point, of course reading the file again is ofc easier 😄
Hi, im coding using intellij and maven, but i have one problem. When i'm debugging the stacktrace is not parse to my code. Is it possible to match this?
How to set or remove and add players to the tablist. I've figured out how to add them, just not how to remove them
I know. I actually wanted to call the second one but forgot I renamed it lol
what?
send a packet to all players that the fake player was removed
for example at net.minecraft.world.entity.ai.attributes.AttributeMapBase.a(SourceFile:48), when i click it it show me that, why?
anyone have a hypixel friends plug-in? that works?
lines and methods from the console do not match those in the code, the spigot code and mine do not match the error @tender shard
with console, do you mean the intellij console output or the ingame console?
I guess it doesn't matter, because in both cases I have the same console when debugging
but currently i'm working on intellij console
then you run a different .jar than the one you're compiling against
in what sense another jar?
nvm im dumb. I need to refresh their displayname, not the entire game profile
the .jar you are running your server with (spigot.jar) doesn't seem to be the same version you use in your pom.xml
otherwise you would have matching stacktraces
How could I do a random selection of a variable in lua?
lua??
Nevermind
I found it
local randomNumber1 = math.random(1, 10) --Returns a number between 1 and 10.
local randomNumber2 = math.random(10) --Also returns a number between 1 and 10.
print(randomNumber1, randomNumber2) --OUTPUT EXAMPLE: "6, 8"
Yes
I make spigot plugins in java.
Nevermind I didn't find what I needed
😠
how can i compare these versions?
private static boolean isInAABB(Vector vector, Vector min, Vector max) {
boolean x = vector.getX() >= min.getX() && vector.getX() <= max.getX();
boolean y = vector.getY() >= min.getY() && vector.getY() <= max.getY();
boolean z = vector.getZ() >= min.getZ() && vector.getZ() <= max.getZ();
System.out.println(x + " " + y + " " + z);
return x && y && z;
}``` help!
Its a cube right?
looks like its not properly min/max'ed
Thank you for the info 😄
Hey there, trying to load a config file which contains a Location object with the world of "spawn" (This is a world created with MultiverseCore), although I keep getting this error log.
java.lang.IllegalArgumentException: unknown world
https://pastebin.com/kRUtDNhU
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
World is not loaded by spigot
I figured that because it's a Multiverse world, I'm not sure how to load the config file though.
EDIT : Solved, made Multiverse a depend allowing it to load first.
i ran the spigot build tool
but then put the jar into my library on eclipse it keep being red all the spigot stuff
why are you not using maven?
thats the wrong spigot jar for importing
in your BT folder, somewhere like spigot/target/libs or soemthing
Spigot build tool\Spigot\Spigot-API\target
Thank you!!
wow i can even look though the .java files
for the server jar Spigot\Spigot-Server\target
teh spigot-1.18 jar is a boot loader now
what do they mean with this?
for hikaricp
i'm guessing i have to use HikariDatasource#setJdbcUrl()
instead of setDatsourceClassName
Do you know how to check the spigot version I have in maven and the server version where I debug the plugin? The spigot code in the compiler and the line and method numbers in errors do not match the code.
server version and maven version will not affect a stacktrace from your plugin
if the stacktrace is saying an incorrect line number in your plugin then you didn;t update the plugin jar on your server
plugin updates every build / debug (localhost)
If the stacktrace is saying an incorrect line number in your plugin then you didn't update the plugin jar on your server
wait, stacktrace matches my code but not spigot api code. A plugin jar on the server is updated.
then you are comparing the wrong spigot code
I click on debugging console links in intellij idea and it refers me to good class but bad line.
I made an mobspawnevent for summoning my custom mob, the code for my Entity Spawn event is:
System.out.print("debug");
if (!(event.getEntity() instanceof Animals)) {
System.out.print("no aniaml");
return;
}
if (event.getLocation().getBlock().isLiquid()) {
System.out.print("water");
return;
}
Random rand = new Random();
int n = rand.nextInt(2);
if (n == 1) {
event.setCancelled(true);
soulsheep sheep = new soulsheep(event.getLocation());
WorldServer world = ((CraftWorld)event.getLocation().getWorld()).getHandle();
world.addEntity(sheep);
System.out.println(event.getLocation());
}else {Bukkit.broadcastMessage("no");
System.out.print("wrong number" + n);}
}```
but the event only workes when i do /summon an animal, not an hostile mob. And then it repeats all the mobs it missed which got natural spawned
how can i fix this
the System.out.print are for debuging
when its not an animal, you return
here ```
if (!(event.getEntity() instanceof Animals)) {
System.out.print("no aniaml");
return;
}
ye, i wanna that my custom mob have a chance to spawn insted of an animal
i see
but it dosent work with natural generated animals, the arent detectet untill i summon with the command one
ok
nope it only activates if i do /summon and then it repeats all natural summoned cratures which are spawnt since the last /summon command
Chunk gen mobs don’t trigger the event anymore
why?
Because of how chunk generation works
well there is a chunkloadevent
but you arent able to filter the new generated mobs
if new Chunk generated then by Logic
no player yet been there
u can get the chunk
which u can use to get the entities
they should exist already in there
not sure though
you can check if this chunk is a new chunk with event.isNewChunk()
sooooooo
i hope this thing will work
but the entityspawnevent dosent get the new spawned mobs
nope
so weard
ur just gonna need to see if the chunk has entities when generated
print it or something
the entitys come in a list an i can make the randomisor thing with the .forEach() thing sooo i hope this will work
ye ik
yeah randomization
ohh i guess i learn something new today
Entities are loaded in chunks asynchronously from chunk loads so it needs its own separate event
Alternatives were to add callbacks to ChunkLoadEvent but it's not really as flexible
eh Choco on anther topic, do you happen to be good at Math?
I mean I'm not bad at it but I'm no genius
i mean if you https://hub.spigotmc.org/javadocs/
The SpigotMC Developer Hub, home to the continued development of Bukkit, CraftBukkit, Spigot, and a variety of other open source projects.
well if ur willing to give my problem a shot take a look here https://www.spigotmc.org/threads/math.539054/
EntitiesLoadEvent sounds weird
Oh that sounds like a fun little math problem lol
ye it does doesnt it haha
org.bukkit.event.Event -org.bukkit.event.world.WorldEvent --org.bukkit.event.world.ChunkEvent ---org.bukkit.event.world.EntitiesLoadEvent
Do you want a linear increase in price? Or one that gets increasingly more difficult? More exponential?
well exponentional would be perfect, but thats even more difficult than linear
Could you perhaps use a quadratic bezier curve? You know points A and B, where A would be (0, 100), and B would be (1,000, 3,000,000), no?
Or I guess B would be C, B would actually be (0, 3,000,000)
t being your progress, x / 1000
I downloaded intellij and the plugin for Minecraft and it says "cannot resolve org.spigotmc-api:1.18.1-R0.1-SNAPSHOT"
this looks like it might be able to work, but my grasp of math is too shitty to be able to actually take this and implement it in java
that does like it would give me a nice curve though looking at the visualization
tbh it's not bad at all. You can run that equation three times, once for each axis
Oh wait it's one axis lmao ignore me
I'm thinking 3D space
so t is my current upgrade level then
Yeah it's your progress towards it, so x/1000
Oh I guess you'd be able to just use x
If your other values aren't 0.0 - 1.0, then yeah
purchase _times
purchase _times * 100 = price?
but what would 0 < t < 1 even mean at the end of that formula
ahh you looking for nice curve my bad
That's the range, from 0.0 to 1.0, so I guess it does require it to be /1000
Can anyone help
would you be able to implement this formula in an example using my example values?
@swift adder , using maven?
I'm gonna give it a shot, hold on
aight thanks
Did you try to install the dependencies?
It tries to automatically
send me your pom.xml
guys i make progress
