#help-development
1 messages Β· Page 163 of 1
use packets if that's the only solution
basically google achievement packet
for your version
hello again, another problem appeared, how to work with NBT tags?
Does anyone know how to fix this error?
java.lang.NullPointerException: Cannot invoke "me.GROUP_ID.plugin_name.PLUGIN_NAME.getDatabase()" because the return value of "me.GROUP_ID.plugin_name.PLUGIN_NAME.getPlugin()" is null
You would have to use NMS to interact with NBT tags.
(NMS is short for net.minecraft.server btw)
There's some good tutorials online for figuring out how to use NMS with the right obfuscation mappings.
Ok, the class is already connected
do you really need it
what mc version
I need to set an Entity tag
1.19.2
PersistentDataContainer (pdc) is plugin related.
he needs a tag on entity
If they want to interact with vanilla NBT data, they'll most likely need NMS.
this can mean literally any tag
that is what i am thinking too
They might want to do what I did with interacting with vanilla tags so that it's easier to work with in-game using commands.
i used to work with old NBT tags on items
but never used it since
also with old playerdata in world folder
PDC is more towards custom plugin NBT-style tags.
The way I interact with vanilla NBT tags is through NMS.
I need to change the villager's profession and biome
can't you change it with spigot api
NMS is probably your best bet.
idk though but that's what I'd do personally.
Just get the CompoundTag/NBTTagCompound and get the profession and biome tags and then set the values using code.
you can literally spawn own villager with what you need on old villager location
But how to do it?
Example from my own code:
ahh ok
or change profession of existing villager
That works too.
ok thanks i will try
I mean, general rule of thumb is "Is it a minecraft nbt tag? Try to use the API. Is it not, just custom data? Use PDC"
obvs exceptions exist as they do anywhere
π
about what?
the folders being combined
ok I'm back home time to debug shitty code
it only does it for nested folders within your java package, yes
check flatten packages and uncheck compact middle ones
your welcome
myes
im talking about catching outofmemory errors
just done 1 catch with all exceptions
I mean you have the same message that why
once had a stackoverflow cuz my typeadapter sucked
and it was doing some circular stuff idk why
?jd-s
declaration: package: org.bukkit.entity, interface: Player
anyways can a stackoverflow lead to an oom?
stackframes mem cannot occupy all of the jvm mem right?
Maybe? Idk I'd fix the reason, not catching it to "fix" it
ye lol
I'm trying to get an SQLite table with my UUID but it keeps trying to search with just the first part of my UUID.
What
Hello , so i have this method when player die , spawn him , set health , etc , but there is a bug with the firetick
sqlite doesnt support uuid, so i guess youre using a blob?
I'm using a string value
i tried it and nothing happens , i killed the player with a fire aspect sword , and fire still there after he respawned .
dont save an uuid as string to a db
Isn't that a visual bug on the client?
But it's only searching with the first part of that string
?not working
Are you making a table per player?
The table contains specific info such as ban information
And the primary key is meant to be the player's UUID as a string. (Key type is varchar(36) )
this is my stuff to convert an uuid to and from a byte[] https://github.com/FourteenBrush/xKingdoms/blob/0d6d98880a20ee7adf4c7f96cc58be0f86bd2f39/src/main/java/me/fourteendoggo/xkingdoms/storage/persistence/Database.java#L130
as i said dont use a varchar
is your uuid a primary key?
Yes.
That's okay. You're learning
π
Anyways seeing the code/SQL code would help
Is there a way to convert a UUID into a long or an int?
Oh nooo for me sql is hsit
I dont like losting time doing relations neither joinings
π
ohh good
class com.google.gson.internal.LinkedTreeMap cannot be cast to class me.illusion.university.module.impl.school.data.data.MemberData
thanks gson
amazing
I like how I have nested data packages
gson usually gives me errors in the way of that it doesnt know what to do with certain types
stopped using gson lol
I mean
gson is useful because I really don't want to make my own impl to store stuff into mongo
so I just let gson do its thing
i needed three typeadapters to seriliaze my player wrapper π
but deserializing with gson is... odd..
mye
Because I also don't know my own structure
The problem I have is that it's searching with the first part of the UUID string and nothing else.
dunno what thenCompose does
Without the code we can't help
it allows easy future nesting
hmm
So like
how do I set a permisson on luck perms
future1.thenCompose(returnedValue -> somethingThatReturnsAnotherFuture(returnedValue)).thenApply((secondValue) -> {
...
});
like /lp group (group) permssion set?
It's meant to take the UUID in as a string and it should work but it's not, it's just searching with the first part.
[INFO]: getPlayerDataByUUID: uuid string: 846e2b9e-46d9-4c90-b78f-a85038c779df
[ERROR]: Failed to get player data by UUID: [SQLITE_ERROR] SQL error or missing database (unrecognized token: "*846e2b9e*")
I'm still confused, I use a prepared statement but I don't know how to use it here.
And I don't know how that's meant to fix my issue.
dont use statement please, used prepared statement instead
I mean its a recommendation
Because if it's not working as intended and it's only searching with a part of it you can assume you're quite literally injecting wrong code
Oh
You're not wrapping the UUID in quotes
Ahh
That's why
is there a method that tells your exception in a nutshell not blast out a 100 line message about that the 1953th line at String.java is at a small fault?
just use a byte array instead of uuid
It's unrecognized token meaning that you're attempting to use the UUID as a variable
fore some reason when i mention "craftPlayer.handle" it gives me an error. i'm literally checking if it's not null and it's giving me an error when i run it.
ty
I'll try to use a prepared statement later on too.
Yeah, that's fixed it.
Thanks @vocal cloud and @tardy delta. π
UUID uuid;
PreparedStatatement statement = getConnection().getPreparedStatement();
statement.setString(0, uuid.toString());
ResultSet result = statement.executeQuery("SELECT * FROM playerData WHERE uuid=?");
nobody listening to me.. anyways
Thank you. π
open a thred
i think its not so diff
Just a simple google research
I've taken more time copying pasting the code that looking for the solution
π π π π
I just don't know how to use byte arrays at all, I'll look into it though.
did the code work?
i sent you a github link above ^^
instead of setString just call setBytes with the return value of that method
I haven't tried it yet, I'm just trying to get data to be initialized correctly.
you also tell him to use statement when its the worst thing you can do
The GitHub link is helpful, It's just that I have no idea what a byte array does or how to properly use one. (I'll use the link when I get around to looking into byte arrays)
Did you learnt java before starting coding?
I just used statement by default, Definitely switching to PreparedStatement later.
Because its the worst thing you can do
I've never had a reason to look into byte arrays in general.
Definitely going to look at it in the future though.
Oh no
Just figured learnt java before coding
That is not how the things works
But i dont care do what your a** signs
what more i can say - hahahahaah
I'm kind of learning as I go atm
that why
First learn the vanilla lang
Then touch libraries
what?
Oh ok i catch it
why?
stringify it
oh yeah you cannot save values which includes the .
because its only mean for path/s
What's the point of this?
@vocal cloud
oh no
You can
You absolutely can lol
Sfraino why are you over complicating your self
Users:
uuid-1:
alts: ["184.181.14.1", "182.15.155.1"]
List<String> address = getConfig().getStringList("Users.<uuid>.alts");
just make government-issued ID verification
lol
Plus people's IPs change
@wind blaze
LOOK what i writen
Bruh
But why? If it changes then you ban them?
LMFAO i have spoofed full code
Why would you need to save it since IPs can change?
grr I'm struggling with gson
he is definitly trolling us i think
I just don't think what you're doing is a solution to the problem
minimessages?
You should Google what Arrays are
I don't?
i thought spigot or bungee chat color implemented a way to send hex codes
you just colour the component ?
Chatcolor.of hex
Component.text("This is in like a lime green", TextColor.color(32, 221, 65));
or just use MiniMessage
on spigot you need to use the platform
Anyone know if theres a way for me to change the default group name on luckperms, while it still being the default group
For this reason, we made it so that the default group is not configurable. It makes things much easier for everyone, honestly! However, we understand this can sometimes be annoying to work with.
You can however change the display name:
/lp group default setdisplayname <name>
Source:
https://luckperms.net/wiki/Default-Groups
Yeah
would have guessed that was the next option
For non coding support please, the correct channels
and why are you pinging me
i never ping you?
You did
where
.
I cannot see the "@oliv"
π€
oh
that why
that is really annoying to disable on each replying
its not possible to disable it globally? so i dont need to disavle it everytime
sit discord
sometimes discord sucks a lot
You donβt need components just for hex
they were replying to me
yes
Theirs no point if you just need it for hex
^
discord text component sucks a lot too
it is a lot of baggage for just hex
its pretty damn nice if you develop against paper-api only
but a lot of peeps cannot afford that
peeps?
people
I want to make a creeper spawn on a player and have it be charged as a command but i dont know how to get the creeper as a entity any help
Creeper creeper = (Creeper) EntityType.CREEPER;
for some reason when i call getHandle() from a craft player it gives me a null error (it also gie my friend one so i think it's a problem with nms or craftbukkit)
grab the world from the player using player.getWorld
and then on the world you can call player.getWorld().spawn(player.getLocation(), Creeper.class)
to spawn a creeper
the method returns you the creeper
yea but i want to spawn the creeper charged
you can set the creeper to charged
declaration: package: org.bukkit.entity, interface: Creeper
^
yea i know that
so what is the issue
player.getWorld().spawn(player.getLocation(), Creeper.class) returns you a creeper
so store it in a variable
and then call the setPowered method on it
iaght
got it to work like this Creeper creeper = (Creeper) player.getWorld().spawn(locationp,Creeper.class);
ok i really did not understand
you only need to cast when you use the EntityType
oh so i dont need the (Creeper) part
wait i need the creeper variable to be Entity type
im using world.SpawnEntity()
nvm
didnt see the boolean at the end
version?
nms mojang mappings 1.19.2
w.spawnEntity(locationp,creeper,false);when i do this it gives me a error 'spawnEntity(org.bukkit.Location, org.bukkit.entity.EntityType, boolean)' in 'org.bukkit.RegionAccessor' cannot be applied to '(org.bukkit.Location, org.bukkit.entity.Creeper, boolean)'
Creeper creeper = player.getWorld().spawn(locationp,Creeper.class);
creeper.setPowered(true);
creeper.setFuseTicks(0);
creeper.setExplosionRadius(25);
locationp.add(0,5,0);
w.spawnEntity(locationp,creeper,false);
}
return true;
}
}```
what? im not
ohhhhhhh
Creeper creeper = w.spawn(locationp,Creeper.class);
creeper.setPowered(true);
creeper.setFuseTicks(0);
creeper.setExplosionRadius(25);```
this would work tho
iaght
another problem i have is
im trying to make a custom enchantment and
public static final CustomEnchantment BOW = new bowEnchant();
this no work because
'bowEnchant(org.bukkit.NamespacedKey)' in 'me.adeptvail.idrk.bowEnchant' cannot be applied to '()'
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.enchantments.EnchantmentTarget;
import org.bukkit.inventory.ItemStack;
public class bowEnchant extends CustomEnchantment {
public bowEnchant(NamespacedKey key) {
super(key);
}
@Override
public String getName() {
return "Bow";
}
@Override
public int getMaxLevel() {
return 1;
}
@Override
public int getStartLevel() {
return 1;
}
@Override
public EnchantmentTarget getItemTarget() {
return EnchantmentTarget.BOW;
}
@Override
public boolean isTreasure() {
return false;
}
@Override
public boolean isCursed() {
return false;
}
@Override
public boolean conflictsWith(Enchantment other) {
return false;
}
@Override
public boolean canEnchantItem(ItemStack item) {
return item.getType().equals(Material.BOW);
}
}
import org.bukkit.NamespacedKey;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.enchantments.EnchantmentTarget;
import org.bukkit.inventory.ItemStack;
public class CustomEnchantment extends Enchantment {
public CustomEnchantment(NamespacedKey key) {
super(key);
}
@Override
public String getName() {
return null;
}
@Override
public int getMaxLevel() {
return 0;
}
@Override
public int getStartLevel() {
return 0;
}
@Override
public EnchantmentTarget getItemTarget() {
return null;
}
@Override
public boolean isTreasure() {
return false;
}
@Override
public boolean isCursed() {
return false;
}
@Override
public boolean conflictsWith(Enchantment other) {
return false;
}
@Override
public boolean canEnchantItem(ItemStack item) {
return false;
}
}
π use a pastebin for code
?paste
haven't been on this server in ages
do i just make a variable in the class for a key
I'm doing a plugin that is a little bit like SilkSpawners, if someone breaks a spawner with some special item it should give the spawner to the player but when I give event.getBlock().getType() it gives normal spawner (Pig) what can I do to give the exact type of spawner
how would i fix this?
com.mongodb.MongoWriteException: Write operation error on server ac-itkzscn-shard-00-02.gdgktnz.mongodb.net:27017. Write error: WriteError{code=66, message='After applying the update, the (immutable) field '_id' was found to have been altered to _id: ObjectId('6337dc3a6671b225ff494f59')', details={}}.
was working earlier
Well, without code we can't really help.
var document = collection.find(new Document(plr.getUniqueId().toString(), plr.getName())).first();
if (document == null) return;
if (map == null) return;
for (Map.Entry<String, Object> entry : map.entrySet()) {
var key = entry.getKey();
var value = entry.getValue();
document.put(key, value);
}
collection.replaceOne(Filters.empty(), document);```
none of them should be
Hello, I have a question: Do I always have to rebuild the project before packaging for the api to work?
Alt + F10
Is PlayerAdvancementDoneEvent the only advancement related event?
@vocal cloud
Nothing happens
Does a server have a total tick count (like system millis)? I want to store that to a hashmap and later check if the time difference is more than a certain amount of ticks.
I don't really want to use millis, because tps can fluctuate
System.currentTimeMillis();```
The API then no longer workstxt package com.intellectualcrafters.plot.api does not exist
So I have a config with 12 different locations saved. How would I teleport 1 player to every location?
is it a dependency?
I know, but I need to do something if something happens exactly one tick after the other
https://paste.md-5.net/kasokuseju.cs < code snippet
https://paste.md-5.net/juzopamivo.makefile < config snippet
how come only 2 spawn areas (out of 4) have mobs spawn at them?
no errors, just doesn't work
it says all 6 entities have been spawned, so it definitely knows that the custom entity exists
How much would this impact performance if I am creating a new scheduler frequently
I would prefer to just have a method like getCurrentTickCount() or something along the lines of that
it wouldn't effect performance at all
only if the runnable is running something intensive
It will be adding/removing a key from a hashmap
should be fine
that does not work ```txt
Could not find artifact com.plotsquared:Plotsquared-Core:pom:unknown in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
Could not find artifact com.plotsquared:Plotsquared-Core:pom:unknown in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
are you even looking at the docs π
maybe someone could help to update https://github.com/montlikadani/SetTheSpawn for version 1.19.2? π₯Ί
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
wtf is that

not that language here thanks
b) why homophobic insults
sorry
c) best conclure
Not really spigot related but I pulled my code from github and in the gitignore I added my target folder. Now I can't compile with maven because of this:
java.io.FileNotFoundException: C:\Users\wdrot\IdeaProjects\PvPMechanics\target\classes (Access is denied)
What should I do?
Run it again
I ran mvn install multiple times
Location location = new Location(clicked.getWorld(), new BlockVector(), 0, 0);```
i need a blockvector3
a location does not take a block vector π€
plotsquared does
because bad
yes then you need to convert it to the plot squared one
usually through the adapter
i am
come on, can anyone help? i've been asking for 12 hours
at least some acknowledgement pls
exclude that I guess ?
you did not specify the version btw
i just copied it π€·ββοΈ
no?
you also added all the repos ye ?
i did all this
yeah
Welp I guess, add their repo too ?
the core works, but the bukkit doesn't
in one class i have a namespacedkey and when it asksfor it in another class i do not know what to put for it
like the engine hub repo
where would that be located?
https://paste.md-5.net/kasokuseju.cs < code snippet
https://paste.md-5.net/juzopamivo.makefile < config snippet
how come only 2 spawn areas (out of 4) have mobs spawn at them?
no errors, just doesn't work
it says all 6 entities have been spawned, so it definitely knows that the custom entity exists
someone help please i've been asking for 12 hours
<repository>
<id>enginehub-repo</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
das the repo
sweet
pass it through the constructor
for some reason after deleting target folders it worked again
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Sounds like it's time to cleanup that code instead of repeating your question for that long
well how?
i dont know what that means
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
the problem is that it doesn't want to spawn on the -axis
either x or z
for whatever reasosn
i've found
but it prints that it is spawning there
and the location that it will spawn at
one more question
this time about mongo
how would i fix this?
com.mongodb.MongoWriteException: Write operation error on server ac-itkzscn-shard-00-02.gdgktnz.mongodb.net:27017. Write error: WriteError{code=66, message='After applying the update, the (immutable) field '_id' was found to have been altered to _id: ObjectId('6337dc3a6671b225ff494f59')', details={}}.
im so confused
ik the error
but how would i fix it
still makes no sence to me
var document = collection.find(new Document(plr.getUniqueId().toString(), plr.getName())).first();
if (document == null) return;
if (map == null) return;
for (Map.Entry<String, Object> entry : map.entrySet()) {
var key = entry.getKey();
var value = entry.getValue();
document.append(key, value);
}
collection.replaceOne(Filters.empty(), document);```
tried append and put
and updateOne instead of replaceOne
someone could help me? you can find the whole problem here
https://www.spigotmc.org/threads/placeholderapi-only-works-in-my-plugin.574992/
how am i meant to cleanup that code?..
Start by not abusing streams
Stop copy pasting code
and structure the code so it's clear what each part is doing
how else am i meant to convert a set to a list
locationp.add(0,5,0);
Creeper creeper = w.spawn(locationp,Creeper.class);
creeper.setPowered(true);
creeper.setFuseTicks(1);
creeper.setExplosionRadius(25);
}```
when i use the command i get unexpected error and for some reason it returns null. anyone know why?
Is there a reason you need to
order
.get(int)
Arrays.stream(EntityType.values()).anyMatch(m -> m.toString().equalsIgnoreCase(type))```
and how else am i meant to do that?
arrays.aslist().contains() won't work
can't convert a String to EntityType
EntityType.valueOf(String)
that just getss it
that doesn't check if it is a thing
...
does it not?
That will get the value if it exists
yes but
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
Yeah
That would be one way to do it yes
Make sure to cache your values somewhere so you don't end up wasting resources checking things over and over again
You could also make use of Guava's Enums class
Or, the better option (imo), Registry.ENTITY_TYPE.get(NamespacedKey.fromString("zombie"))
Also I don't see why you need this
That way you could do things like minecraft:zombie, or zombie based on in-game ids
anyone??
i iterate over the spawn areas
You don't need to use a for i loop
so they are all equal
oh wait
yeah
i'm stupid
wait
yes i do
lol
i don't iterate over them
every fori thingy i do selectedspawn++ but if it's over the max i set it back to 0
it selects the spawns fine and in order
the entities just do not spawn on negative axis
Error 66 appears to be ImmutableField
So you're modifying something you cannot
any help
var document = collection.find(new Document(plr.getUniqueId().toString(), plr.getName())).first();
if (document == null) return;
if (map == null) return;
for (Map.Entry<String, Object> entry : map.entrySet()) {
var key = entry.getKey();
var value = entry.getValue();
document.put(key, value);
}
collection.replaceOne(Filters.empty(), document);```
which should only be the multi
i dont have anything in the map
except multi atm
Did you define the command in your plugin.yml
yeah it is this
i set it super close
and it worked
thoughts
but why??
i rlly wanna get this fixed
The error appear to say you're modifying the id
so do i
Yeah
Create a new entry
yea its when i run the command
?paste
how do i increase despawn distance?
so append?
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
//locationp.add(0,5,0);
Creeper creeper = w.spawn(locationp,Creeper.class);
creeper.setPowered(true);
//creeper.setFuseTicks(1);
creeper.setExplosionRadius(25);
}```
That error has nothing to do with the code you sent
its set to 1
java.lang.IllegalArgumentException: Invalid BSON field name _id got this now
oh
with just updateOne(filter, doc)
This is why we ask people to send the entire code
It's better to send too much than too little
?paste
@tardy delta I got it worky
Check if the arg exists before using it
only took me like 9 hours
how
Is this your first Java project?
?learnjava You really should go through basics so you know how arrays work
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.
What did you do
mysql better?
i just get the document
this is everything
var map = data.get(plr);
var collection = CharmGenz.getCollection();
var document = collection.find(new Document(plr.getUniqueId().toString(), plr.getName())).first();
if (document == null) return;
if (map == null) return;
for (Map.Entry<String, Object> entry : map.entrySet()) {
var key = entry.getKey();
var value = entry.getValue();
document.append(key, value);
}
collection.updateOne(Filters.empty(), document);
if (delete) map.remove(plr);```
What line of code causes your error
what does your map look like
doesn't say
im guessing
collection.updateOne(Filters.empty(), document);
this is the json
{"_id": {"$oid": "6337dc3a6671b225ff494f59"}, "ed24a190-c1f2-41ab-948d-80a42104914d": "Outspending", "multi": "1"}
the id of the document inside of mongo is 6337dc3a6671b225ff494f59
which is the same
this is after i edit it
So what exactly are you trying to do with your code
just update the document
so i can retrieve the data later
which it was working fine earlier and now it doesn't
We don't really have enough information to help you
all im doing is looping through a map, which contains all the player's variables Map<Player, Map<String, Object>>. Then putting the values into the document then saving them to the database
but for some reason its editing the _id too.
which it wasn't earlier
is there something that immediatly makes a creeper explode on spawn
Is there like a snippet or smth out there to automatically get a jar file from github and put it in the plugins folder and delete the old one, kinda like an auto plugin updater
wdym with update folder?
Create a directory called "update" in your plugins directory.
Download the plugin that you wish to update.
Place ONLY the .JAR file into the update directory.
As for downloading files there are guides online
Make sure to do it safely so you don't cause a security problem with your plugin
what's a good blood particle?
cracked redstone block
restone
ok cool
however Particle.REDSTONE seems to throw an error
says it needs data
what data does it need
w.spawnParticle(Particle.REDSTONE, locationp, 2003);
sadly im not finding anything useful
this works
I got a private github release and wanna download the jar from there
orplayer.getWorld().spawnParticle(Particle.REDSTONE,locationp,1);
whenever i see one letter variable i wanna cry
if you are using the spawnParticle thingymabober
good cry
that worksas well
all good tho it should work now
killed.getWorld().spawnParticle(Particle.REDSTONE, killed.getLocation(), 200, options);
World world = Bukkit.getWorld("world");happy now
You're going to have to make a public release
Isnt there like a way to login with a account which has access and download it from there?
That's a real bad idea if you want to publish your plugin
dont wanna publish it anyway
Particle.DustOptions options = new Particle.DustOptions(Color.RED, 1.0F);
killed.getWorld().spawnParticle(Particle.REDSTONE, killed.getLocation(), 200, options);```
what to do
to make it look like blood
i feel like redstone isn't the right particle either
Then you could probably use https://github.com/hub4j/github-api
make it look better
ive seen people make it look amazing
you though
how can i download it then, didnt find anything on the docs
The docs show how to login and get the repository
From the the repository you can get the releases
so just the redstone particle?
ah
It's... a cracked... redstone... block
i didn't understand what u meant
playing apex wait a bit
You are likely going to have an issue using a numeric key. Yaml doesn't like that. You need to wrap the key to ensure its a string.
so instead of 1:, use "1": or something?
or am i stupid
use single ' to wrap
yes
So I need like a personal access token, which scopes do I need for the release? Like read:packages?
π€·ββοΈ
oh yeah, i have my void chunk generator
but how do i ensure the biome is always plains
public class VoidChunkGenerator extends ChunkGenerator {
@Override
@NotNull
public ChunkData generateChunkData(@NotNull World world, @NotNull Random random, int x, int z, @NotNull BiomeGrid biome) {
return createChunkData(world);
}
}
also it's deprecated
so if anyone has a better way then pls let me know
gotta try that, thank you very much
thats cool as hell
Is there a way to get the player's movement velocity that they had before the PlayerVelocityEvent was called?
how would i so that if i put something like /time adpetvail 10 make 10 into a variable
The event should be called before the velocity is applied
Which means you can just get it directly from the player
10 would be the 2nd (1st index) argument in the arg array. You can just assign a variable to that
But player and event velocity are the exact same:
event.player.sendMessage("e: " + event.velocity.y.toString())
event.player.sendMessage("p: " + event.player.velocity.y.toString())
Generation of chunks is separated into multiple methods now. Noise, surface, bedrock, and caves. See the docs for ChunkGenerator https://hub.spigotmc.org/javadocs/spigot/org/bukkit/generator/ChunkGenerator.html
You're going to need to include that lib in your plugin
like this int idk = args[3];
There isnt an jar file on their github, but i added the repo they listed in the docs and dependency in the pom.xml
i dont have that
amythyst_block.hit
ok so i cant do this int idk = args[1]; because it has to be a string but i want it to be a int so that i can use it elsewhere
?learnjava tbh
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.
You have to parse it
i tried but the creeper does not spawn
Your question rn have nothing to do with creeper spawning
It's about parsing string into integer
yes it does
int idk = Integer.parseInt(args[1]);
locationp.add(0, 5, 0);
Creeper creeper = world.spawn(locationt, Creeper.class);
creeper.setPowered(true);
creeper.setFuseTicks(0);
creeper.setExplosionRadius(idk);
creeper.setVisualFire(true);
How can I get the original player's movement velocity that they had before the player has taken velocity inside the PlayerVelocityEvent?
both player and event velocity are the same for me
Using player.getWorld().getBlockAt(player.getLocation().clone().add(1, 0, 0)).equals(Material.AIR):
How would I check for multiple materials at the same block at once? I need to check for 16 different materials for the 9 blocks that directly surround the player. I really don't want to have to copy/paste this 144 times, so could I instead just do 9 different statements for each blocks where each statement checks for all 16 materials at once?
You could make a method that loops through all locations and materials, then return false once it does not equal the material, otherwise return true
Alrighty.
What I need to do is to test if only 4 of the 9 blocks are one of those materials
Iterate over each block with a for loop, store material, match it to an immutable set, done
And if needed keep a list of the matching locations
hey fellas. so have this "proccessor" that is behaving very weirdly.
private final Deque<ProcessingPacket> deque = new ArrayDeque<>();
@Override
public void run() {
while (running) {
if (deque.peek() == null) continue;
ProcessingPacket pp = deque.poll();
byte[] decoded = Base64.getDecoder().decode(pp.getRaw());
Packet packet = consume(decoded);
server.getPacketReceiver().receive(pp.getChannelIn(), packet);
}
}
this is the setup. but for some reason the deque fills up. and they are not getting proccessed, now the weird part: when i add a break point at deque.poll(); and send another packet through the system it will proccess packets as long as my breakpoint is there and i click "resume program"
any1 any ideas?
also got a method to queue packets
public void queue(String channel, String raw) {
queue(new ProcessingPacket(channel, raw));
}
when i put a breakpoint in there you can see that its building up and that deque#peek() is in fact not null
im really stumped here...
hi I want edit blocks in PacketPlayOutMapChunk with palette but I have problem with understand how palette work. Anyone can send links what can help me understand it? π
generally with NMS you won't have any guides or links
honestly you just kinda need to figure it out you could try asking a more direct question as well maybe someone knows about that specifically
Really I try but it is harder than I think
I'd just say to remove the scope
compile using mvn package
Not on my pc anymore, ping me in uhhhh 18 hours?
If you're still struggling
^ ayeee its the NMS guy
Is it though
π€·ββοΈ probably know more than a lot of people here xD close enough for me
wdym "still"? did you compile it differently before?
Is there a way I can get all NamespacedKey associated with my plugin ?
no
ty
yap, will make kind of map
you run mvn package to compile your .jar. it will be at <project folder>/target/YourPluginName-1.0.jar
and that will include all the shaded classes
I just happen to know how to read someone else's code quite well
Do you use intellij?
In the top right corner, theres a maven tab
Go to βlifecycleβ there, then double click on βpackageβ
Then your compiled jar is in the βtargetβ folder
Any1? 
Thats maven π
If you have a pom.xml, you should always use the maven tab to compile
If you use intellij build artifacts to build, it ignores your pom
So yeah, βpackageβ is the way to go
In 99% of cases at least π
Np!
If you want to change the location where maven puts the jar file, just read this: https://blog.jeff-media.com/common-maven-questions/
why am i getting this error?
@tender shard any clue?
im usin 1.18.2
Then you need to compile against java 8
Ok then what version is your server running on
same
What java version
should i use 17 instead to fix the error?
1.8
Is your project version 17?
And make sure source and project are 17 too
by not working I mean not updating the config file
where do i edit the project version?
my JAVA version is set to 17
and so is source & target.
What version is your maven compiler set to?
where is that at? lol
In your pom.xml
these are the lines producing the error:
<goals>
<goal>shade</goal>
</goals>
Unsupported class isn't that
if i remove it, it fixes
Whats the maven compiler version?
3.2.4 i believe
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>```
Change it too 3.4.0, 3.2.4 doesn't support 17
It does exist
Reload maven
It'll download it
can someone tell me why set defaults doesn't?
I know that line of code gets executed
line 47
How do I turn on economy mode
theres no such thing
there are no modes for spigot outside of I guess gamemode but thats a minecraft thing
wtf is economy mode?
also nvm I'm not going to help you broski you really felt the need to ask that in every damn channel
jesus christ
When you do /qa shop you can not buy anything cause it says u have to enable economy mode
do you even know where you are
lmao
this aint the plugins help discord
this is the official spigot discord
how to turn on baby mode for xql v4 sx9?
oh thats easy /as9df9askd -43883fkfk --Arg10282 --ZBabyoff
if that doesn't fix it just ping me
forgot you can also just start your jar with --onBabyMode
ah yes thx
π
Man literally said it in every channel
how do I turn off cave gen?
absolute value
One easy way to think of absolute value is the distance it is from zero. To do that, a number line comes in handy. Watch and learn.
Practice this lesson yourself on KhanAcademy.org right now: https://www.khanacademy.org/math/arithmetic/absolute-value/abs_value_tutorial/e/absolute_value?utm_source=YT&utm_medium=Desc&utm_campaign=PreAlgebra
Watc...
Ty
can someone explain how multi version plugin work ?
if your not using NMS you just use the lowest version of spigot you want to support
and ur done
if you want to use features from newer versions you just need to use reflection and make sure there is proper abstraction in place
So java Math.abs(x1 - x2) + Math.abs(y1 - y2) + Math.abs(z1 - z2);?
Trying to do taxicab distance
?tas
So I'm trying to make a simple Skript-type plugin, but I'm not entirely sure what to do next.
I'm trying to work on some simple "event" system, but...
(Ok, I know I'm probably static abusing, I'll look into that later)
RaftParser (all the effects): https://paste.md-5.net/agipicorif.java
RaftEvents (what I need help on to run the effects after): https://paste.md-5.net/unalinijey.java
events.BlockBreak (the test event): https://paste.md-5.net/evepuqazij.java
Ew skript
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
how do i add an api?
Depends on what api and which build system you're using
actionbarapi and maven
actually its fine
Hello why people prefer to use particle packets over World#Playeffect?
I know using packets i would be able to sent it to who ever i want and as well its not gonna be server sided(not sure about this) any other benefits in packets over playeffect
the play effect method literally just calls the packet
its the same thing pretty much
as you said, only upside is making certain players see certain particles but thats about it
thanks gonna try some shape math formulas today i guess
gonna be fun
@warm flume you are pretty much correct. The upside of using the packet yourself is that the server will not process the particles and it will be only just client side
since the server would be unaware of the particles since you send the packet yourself as opposed to having the server do it
is there even serverside processing for particles
if it does sent a packet does it sent to a an radius of player from the location since you sent it to a location? or how does it decide who achieves the packet and who doesnt
uuh its either radius or just blind send
you can check the src on spigot hub, i cbf rn lol
cbf.equals(?)
oh thanks no its okay you not begin fucked
in non australian
but theres no harm in sending a packet to hte player if they're not in the radius
the client just doesn't act upon it
but at the same time, you don't want to be sending useless packets
i dont want to flood user connection with many useless packets, so i guess i will use packets and send it to radius like X blocks! thanks.
nws
ig
anyone know why this is happening ^ ?
possibly not thread safe?
i assume you are running it on different threads
run and push
put a
synchronized (deque) {
}
``` around the code using it
Some of you may remember that I write a little library which includes nms. I use mojang-mapping and the reobfuscating works perfectly. But I also work on an plugin which uses nms, and ther, my code just doesn't get reobfuscated!
My pom
Stacktrace
Bruh work sdk
*wrong
I mean you could use a LBD and use ::take which is blocking
you fucked it up with the maven-shade configuration
you should never change the output file in the shade plugin
remove that and itll work
wdym wrong jdk? if that would have been the problem, then the log would have shown BUILD FAILURE instead of SUCCESS
Yeah but with 17 it worked
1.19 requres jdk 17
no
java 16+
spigot-api is compiled against java 8
1.19 requires java 17+ to run, but you can compile stuff against bukkit 1.19 just fine using java 8
i guess i missunderstood is question
if you couldnt use java 8 for 1.19 plugins, then there'd be no way to have a .jar working on 1.16-1.19
i was thinking he tries to run 1.19 on java<17
maybe someone could help to update https://github.com/montlikadani/SetTheSpawn for version 1.19.2? π₯Ί
we're not your personal slaves
Either commission it off of someone or make your own improvements
I thought I only need to add the api in the pom.xml
but there are also people who like to help and do not give weird answers
Yes asking such a thing here is still off topic
?services would be your place in this case
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/
Hi don't someone what is the issue?
Loading libraries, please wait...
[11:45:35 WARN]: [oshi.util.platform.windows.PerfDataUtil] Failed to add PDH Counter: \Paging File(_Total)\% Usage, Error code: 0xC0000BB8
[11:45:35 WARN]: [oshi.util.platform.windows.PerfCounterQueryHandler] Failed to add counter for PDH counter: \Paging File(_Total)\% Usage
[11:45:35 WARN]: [oshi.util.platform.windows.PerfCounterQuery] Disabling further attempts to query Paging File.
[11:45:38 WARN]: [oshi.util.platform.windows.WmiQueryHandler] COM exception: Invalid Query: SELECT PERCENTUSAGE FROM Win32_PerfRawData_PerfOS_PagingFile
What version are you using?
1.19.2
currently fixed, the error was inside a Windows 10/11 performance monitor, in
"Unable to add these counters:
\Memory\Available MBytes
\Memory\% Committed Bytes In Use
\Memory\Cache Faults/sec
\Memory\Cache Faults/sec
\PhysicalDisk(*)\%Idle Time
\PhysicalDisk(*)\Avg. Disk Queue Length
\Network Interface(*)\Bytes Total/sec"
** FIX: https://social.technet.microsoft.com/wiki/contents/articles/19374.windows-performance-monitor-unable-to-add-these-counters.aspx **
if the you got Error: Unable to rebuild performance counter setting from system backup store, error code is 2
change the cwd to SysWOW64 and run the command lodctr /R again
its just an API too
not even an plugin
oh thanks for this info, i would have the jar to decompile it
32-47 has just racially insulted me (in a private message)
block em
I have, just wanted to write it here so that he might be banned
This is the wrong channel use #general
@warm flume based
Hi, does anybody know how CafeBabe actually sends private messages via SpigotMc? I already saw the cloud bot repo (https://github.com/CloudBotIRC/CloudBot) which was mentioned once here (https://www.spigotmc.org/threads/cafebabe-source.27783/) in 2014 but I'm a bit confused how IRC actually work for private messaging.
don't know if this is the correct channel tho
You gotta use the xenforo rest api
So you mean I can start a conversation with a simple HTTP request?
And is there a way to get these? Probably not right?
yeah... that would be so nice. I wanna write a discord bot that can verify spigot resource purchases and give those users a premium role to access premium dev builds but it's just hard to accomplish without using selenium π
yeah would be nice if spigot had an api for that
what about using paypal's api to detect purchases associated with their spigot id
but then it breaks spigot <-> discord linkin
"hi yes pls send a screenshot of the resource page download button so ik you own it" - 2022
we in 2022 and this is a standard thing for purchase verification, spigot add something already
I already use the paypal api. I'm already able to get to know which users bought a resource but I'm not able to verify that discord users really own a specific spigot user.
All I could use would be the email that was used for the transaction but then I would go against data privacy rules since I'm using the email address for other purposes.
exactly π
But I won't start and train a machine learning classifier to detect those images to verify users xD
Shaded it, and added it into the libraries of my plugin, still the error
are you verifying it's shaded?
decompile and see if its there
ngl would be pretty bitchin if spigot allowed did something similar to google oauths callback in a sense; where when you buy something from x page; the owner of x page can set a REST Redirect URL to theyre own servers from spigots when someone buys theyre plugin; so the Keys stay between you and spigot
Can allow some simple things like when someone purchases my plugin "SuperStars" i get a request to https://supercoolwebsiiiiiiiiiite.com/purchaseRequest?api_token=blah&purchased=SpigotUserID
Ofc more complex that that; but basic functionality is there
From there for linking you can just have them upload a code to theyre status and then Scrape theyre HTML page for that code (probably sent by a discord bot)
that way you can simply verify who owns your stuff by having theyre user id (last digits at the end of theyre spigot url), and youll have those saved with your linking system from the scraper
yeah seconded
wdym, i compiled it with the goal shade in pom.xml
rn premium plugins are in a shitty spot tbh
yes but is it in the jar
And overall most of that is rly simple
all spigot has to do is save an API key and a URL
and send a requesto your own servers on purchase
if it fails; manual verification is your fallback or there could be some kind of re-verify option
but; thats all in a dream
if that ever gets added ill shit myself
same
googles is quite difficult to setup; but once its up its sooo nice
prolly done google oauth 5ish times now and its rly nice once you get it working
like in my plugin? I added the shaded version into my libraries
I mean if SpigotMc uses xenforo, they could just easy use the user keys to let me access all I could already do in the browser... That's an option in their admin panel... Maybe I'm gonna contact them and ask patiently to create me a key xD
(spigot im hiring btw)
but at the same time im not sure what limitations md faces with xenforo
does he have full source control?
(btw theyre saved as cookies, the API keys for your acc)
but
they change very x hours
and api isnt rly publicly documented
wdym
just use a decompiler and see if the class is in the jar
fr? Gonna check that
alotta sites do that
not uncommon
i think user is what can double as the key; but like said it will reset on you in 5 minutes, 5 hours, or 5 days
not sure on that time
i was helping someone a while back with an auto updater or something like that; and this was aboutas far as we got with the XF API on spigot
so like the shaded jar from the github api should be in my compiled plugin?
yes
The question is what version of XenForo does Spigot use?
sent
im sure theres a way to check for a user
uh your pom looks fine
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.
pom?
pom if anyone else wants to see
pog