#help-development
1 messages · Page 190 of 1
hmm
I did change bungeecord names recently
server names
but that shouldnt do anything
cus its getting the name
well getting the server
this is what it thinks is wrong then
I mean, it should throw if getServer is null
Npe would be thrown then
Oh lol, I was still at the part where he said there is no error
hehe
from what i can see event doesn't provide server player is connecting to
and player doesn't have a server set
so it will always be null
you probably need
ServerConnectedEvent @fresh timber
<groupId>jerefla.com</groupId>
<artifactId>sGUI</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
<systemPath>${project.basedir}/src/main/resources/sGUI-1.0-SNAPSHOT.jar</systemPath>
</dependency>``` ```Cannot resolve jerefla.com:sGUI:1.0-SNAPSHOT ``` why is this happening
scope compile maybe
same error
u sure your plugin is called same way in system path
yea
as in folder
same directory, group id, artifact and everything
hmm
don't use system path
have you tried to use maven update
just install the other plugin into your m2
especially if its your own you'd be silly not to
is there a doc or smthn on how to do that
mvn install or mvn clean install
on the other project
than depend on it following the version and all and your good to go
on the dependency project?
yes
maven documentation in google i guess
ok ty
if you for some reason don't have the source code you'll need to look up the format
this environment variable is needed to run this program. ``` n i c e
i did
maven is broken or smthm...
ive literally had no problems for like a year making plugins but out of nowhere it does this
😕
not mavens fault simp ly your JAVA_HOME env var isn't set
usually if you use intellij it will handle this for you
it is
did you check your environment variables
why is it set to the jre?
i tried the jdk as well
🤷🏽♂️ idk then prob just a windows issue
who knows windows is wack make sure its setup in intellij or whatever if ur using that
Caused by: java.lang.ClassNotFoundException: jerefla.com.smgui.GUI
<dependency> <groupId>jerefla.com</groupId> <artifactId>sGUI</artifactId> <version>1.0-SNAPSHOT</version> <scope>provided</scope> </dependency>
your marking it as provided
thus not shading your dependency
your jar has to be in the server or shaded
the dependency is just a library its not a plugin so i assumed provided would work alone
do you know what provided does?
kind of
provided means your telling maven its going to be there
so maven doesn't add the classes to your jar when you run mvn package
you need to shade the dependency you can do this with maven shade plugin
Java installer stopped setting that variable since java 11. Unfortunately if you install maven yourself it still looks for that variable instead of using the new symlink java uses
Take a look at your variable and ensure it is pointing to the right place
Would you guys recommend a for loop or a .forEach() method? and why?
It should be set to the bin directory and not the exe itself
Depends what it is for
Foreach uses iterator and a for loop doesnt
If you don't need an iterator or need to iterate go with for loop
Also foreach works with using lambda more easily. Not that should mean it is better in your case
going through each of the worlds in Bukkit.getWorlds() and unloading them
I use forEach just cuz its easier to read in some cases imo though thats not really a good reason as forEach has more overhead as far as Im aware
Well in offline mode there is no security since the server doesnt bother to verify players. That is what happens in prelogin. Login happens after that and that is where they finally start joining the server
I'm curious what is the overhead of forEach like idk why but I often find myself using it where I could use a for loop also curious when you'd use forEach versus for loop
Iterating is slower usually. But you get more you can do in foreach
You should use foreach where you need an iterator instance
ok I'm stupid but where would you use an iterator I don't think i've found myself ever neading to use one outside of file IO on non spigot related projects
For instance if you want a set.
Some collections only have iterating
When you want to manipulate maps sometimes as well
Think of it like this. Foreach thing I want to do this other thing as well
No, but client does cache some stuff from last login. Not sure if coords is one of those
curious on another random thing as well I know java streams has an initial overhead, but I often use it for sorting and filtering my lists is there any reason I should just not switch to normal for loop with a sort algo. TBH every time I think of anything java streams and end up using it there is always the thought in the back of my mind wondering why I use it. One would be convenience as its easier to do, but other than that can't think
Streams are usually just as efficient. Anyways back to work for me. Be back in a couple of hours
👋🏽
Could I execute code once a task ends? I’m thinking of having a runnable/task run itself once it ends, but am worried it may cause some stack overflow if i just put a new runnable in itself. I don’t want it on a timer, because I want a player to be able to end it early if wanted.
schedule repeated tasks can be canceled.
but i don’t want it to quite cancel, i want it to run itself again, just sooner
Is it guaranteed to be run?
You can always schedule them all at once
You can even store them so that they're cancelable
it’s game turns (on a time limit) so i want a player to be able to end their turn early, but also use up their full time - it’ll be completely canceled once the game ends
so it could be run like 2 times, or it could be run like 200 times -
wait no i think i’ve got an idea on how to do it
Just make a class to handle this you'd want a timer class with a cancel method that executes your task on cancel
You could just tik down and if the player decides their turn is over or their turn Is over the cancel would be manually called triggering your function
Implement runnanble so you can customize cancelling and running variables
Then just schedule your runnable
Hi, is there a way to disable / cancel that the elder guardian gives you his lovely Mining Fatigue Effect
You could just detect if the player has the effect and remove it
ye, but still there is this animation, but i found a workaround by extending the EntityGuardianElder class and override the customServerAiStep() function
You could just cancel the EntityPotionEffectEvent
java.lang.RuntimeException: java.io.IOException: Failed to deserialize object
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.io.BukkitObjectInputStream;
import org.bukkit.util.io.BukkitObjectOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
public class _Serializer {
public static byte[] toBytes(ItemStack itemStack) throws IOException {
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
BukkitObjectOutputStream objectOutputStream = new BukkitObjectOutputStream(outputStream)
) {
objectOutputStream.writeObject(itemStack);
return outputStream.toByteArray();
}
}
public static ItemStack fromBytes(byte[] input) throws IOException, ClassNotFoundException {
try (ByteArrayInputStream inputStream = new ByteArrayInputStream(input);
BukkitObjectInputStream objectInputStream = new BukkitObjectInputStream(inputStream)
) {
return (ItemStack) objectInputStream.readObject();
}
}
}
What did I do wrong?
show the full stacktrace
Caused by: java.io.IOException: Failed to deserialize object
at org.bukkit.util.io.BukkitObjectInputStream.newIOException(BukkitObjectInputStream.java:59) ~[purpur-api-1.19.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.util.io.BukkitObjectInputStream.resolveObject(BukkitObjectInputStream.java:51) ~[purpur-api-1.19.1-R0.1-SNAPSHOT.jar:?]
at java.io.ObjectInputStream.checkResolve(ObjectInputStream.java:1795) ~[?:?]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1744) ~[?:?]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:514) ~[?:?]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:472) ~[?:?]
?paste FULL stacktrace
yeah it's annoying when you only always post parts of it
the stacktraces are long for a reason, since every line there has a different information that might be useful
ItemStack testA = new ItemStack(Material.DIAMOND) {{
ItemMeta im = getItemMeta();
assert im != null;
im.setDisplayName(Colorful.convert("#123456testaaaaaa"));
im.setLore(List.of("1", "2"));
setItemMeta(im);
}};
try {
byte[] testAByte = _Serializer.toBytes(testA);
System.out.println(Arrays.toString(testAByte));
String testAString = Base64.encode(testAByte);
System.out.println((testAString));
System.out.println(_Serializer.fromBytes(testAByte));
System.out.println(_Serializer.fromBytes(Base64.decodeToByte(testAString)));
} catch (IOException | ClassNotFoundException e) {
throw new RuntimeException(e);
}
these are my methods btw:
public static byte[] toBytes(final ItemStack itemStack) throws IOException {
try (final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); final ObjectOutput objectOutputStream = new BukkitObjectOutputStream(outputStream)) {
objectOutputStream.writeObject(itemStack);
return outputStream.toByteArray();
}
}
@SneakyThrows
public static ItemStack fromBytes(final byte[] input) {
try (final ByteArrayInputStream inputStream = new ByteArrayInputStream(input); final BukkitObjectInputStream objectInputStream = new BukkitObjectInputStream(inputStream)) {
return (ItemStack) objectInputStream.readObject();
}
}
It's same I think.
what always helps in debugging faulty itemstacks, is to create a new YamlConfiguration, then do set("test",myItemStack), then print it out (saveAsString() or similar)
then see what it says
if that also fails, then your itemstack is somehow broken
or if reading it again fails
i once had this problem while using strings that look like json inside itemstack's PDC
How I create itemstack.
What
why are you suddenly doing base64 stuff there?
I thought you were serializing to byte[] and not to a base64 string?
But yeah you're creating your own item stack class
Uh I'm testing
The problem is in byte deserialize
is your object even a bukkit itemstack?
they're creating their own class by using {{}}
and what's getItemMeta() and setItemMeta() ? How does that compile? those are instance methods
oh bruh
I notice that.
sorry
ooh I haven't seen that part
that explains why they can use getItemMeta() without calling it on an instance lol
Yeah I forgot what that thing is called
it's like
Object object = new Object() {
public String toString() {
return "NO!";
}
}
Yeah I know what it is
inherit
Just forgot the name
Yeah it's correct. Looked it up
k working well, thanks y'all
Any idea how to open a gui on villager right click ? (1.8)
PlayerInteractAtEntityEvent calls before the trade gui so i cannot cancel it
Cancel the event and open your own gui
As i said this doesnt work
You said the event fires beforr the trade gui
Which means you can cancel it
Your statement is a conflicting one
Yeah but idk why its not cancelling it
I'm not sure if that event even exists in 1.8
it does
I don't remember it was 7 years ago
ikr
even with canceling event this god damn gui is opening itself
i might have to set the villager profession to nitwit
oh? didnt knew that let me try
I have to support it version for my plugin since none plays kbffa on 1.19
If you have to support over version, atleast support 1.13+ no lower.
the problem is that knockbackffa gamemode is made for 1.8+ not 1.13+
damn this feature is not supported for 1.8
Does anyone know how to directly unban a player in the same way that you'd ban a player in the first place? (UUID-based)
Just unban them?
I'm trying to make a custom unban command currently but it's not unbanning me properly other than clearing my ban data in my database.
But as far as the server is concerned, I'm still banned from the server.
I've looked into the NMS classes for the player and still haven't found any method to unban them.
handle the banning manually
with a join event
no need to add them to a ban list or whatever
bukkit.getBanList().pardon(<target>)
The database is to store times and information for moderators to see.
It's just not unbanning me properly.
Check if the target is in the banlist, if they are, pardon them.
I'd have to call the unban method from an AsyncPlayerPreLoginEvent.
If they're currently banned, a standard join event will not fire.
cant you not add them to the ban list and then do like
@EventHandler
void onJoin(PlayerJoinEvent e) {
if (checkBannedInDatabase()) {
e.getPlayer().kick(ChatColor.RED + "🚫 Banned!");
}
}
I've tried that.
then theres an issue with your database or ban code
Paste the code you're using to unban
how do I set up the remapped NMS jar with gradle?
It spams the console with duplicate UUID warnings when they join the server as well as the fact that every other player will see them joining and leaving the server.
Because it's just kicking them instead of actually banning them at that rate.
do it in pre login event then
can you send the console log
I'm not sure how I'd target a player in that event since you can't get a username, only a UUID.
I'd have to replicate it but I'm already in the process of changing the code to work with .banPlayer() instead of kicking the player every time they join.
disallow the login
the sync event is deprecated but doesnt mean it wont work
its useful in this case
kinda have to use it if you want to handle bans
I can see why it's deprecated, It was changed to an Async event for stuff such as database lookups to avoid server lag.
Best to avoid depreciated methods though.
yeah but then you gotta halt the player from joining until you did your work in the async event anyways
though thats probably better than server lag
so true
I'm just trying to directly unban them in a similar way to .banPlayer() but I don't know how to do that in a AsyncPlayerPreLoginEvent since I can only use UUIDs in that, unless there's some way of getting the offline player reference from that UUID in my unban function.
@EventHandler
void onJoin(AsyncPlayerPreLoginEvent e) {
if (checkBannedInDatabase()) {
e.disalllow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, ChatColor.RED + "🚫 Banned!");
}
}
I might have just fixed my own issue.
yeah you can get an offline player from uuid ez
Bukkit.getOfflinePlayer iirc
The only issue is that as far as I can see, the pardon function only works with usernames.
bruh wtf
Gets a ban list for the supplied type.
-- Bans by name are no longer supported and this method will return null when trying to request them. The replacement is bans by UUID.```
then do the bans manually i guess
smth like this
Then get the players name from the uuid
also possible though what if they changed their name or smth
Well, if it's by UUID then it wouldn't really be an issue if I was getting the name from their UUID.
Exactly.
its based on a server cache
its not retrieved from the mojang servers
so it might be different
Uuids don't change.
no but names do
and the names are retrieved from the server usercache
so they might not be up to date
with the users recent name changes
Which can be avoided by just storing user data as the uuid and doing everything based off that instead of names
yeah but the bukkit ban list doesnt support that
so you gotta do it manually
which is what i was saying
bukkit ban list supports UUID
it just a badly named enum
?
So do everything via uuid an not playernames and won't have an issue
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/BanList.Type.html badly named. use NAME but it takes UUID
I raised a ticket for it, but it's not been fixed as it's quite a mess in that part of the docs
I agree that is confusing.
So basically just use the bukkit banlist an use the player uuids not names
I have a method to find a players group
public static String getPlayerGroup(Player player, List<String> possibleGroups) {
for (String group : possibleGroups) {
group.toLowerCase();
if (player.hasPermission("group." + group)) {
System.out.println(group);
return group;
}
}
return null;
}```
How would I make it return the players highest group?
hey! how can i make a "local" int for every player? so every player has a different int value (i want to make a leveling system)
?pdc
whoops
that was too long
i'd better use pastebin first
I cannot understand why im getting Caused by: java.lang.NoClassDefFoundError: Could not initialize class me.gameisntover.knockbackffa.util.Items
Here's my whole class :
https://pastebin.com/NqJ7RQsr
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.
would i need to get the highest index?
and then return list.get max index
Why not cache the groups and a list of groups the player is in inside of an ordered list so you can get the first element or last?
I have the lists in an ordered list
List<> groups
list.add("group1")
list.add("group2")
list.add("group3")
list.add("group4")
then i call
getPlayerGroup(player, groups)
Then you proceed to check the whole list
I'm saying you cache what groups a players in. Then you just cache.get(player).first()
Ok makes sense
You can even then quickly rule out needing to check all the groups with a cache.get.isempty
but i don't understand how cacheing works
You use a hashmap or similar
Ok welp for now ill just run through the list till i find the players highest rank index then get it
W/e works for you
how i save a inventory player?
has been for a while, also UUID's do change just not for online mode is where they won't change 😉
idk, what is the best method?
What are you trying to accomplish??
staff mode
good luck 🙂
Elaborate dude
I cant read your mind
Give me some details
so, I do the command / staffmode, and it has to save me the inventory so what it does / staffmode restores it
Well if you dont need to persist over restarts just hold an ItemStack[] of the contents
And armour contents
thanksssssssssss
Hashmap
And then on enable/disable of staff mode add and remove the inventory, this is how i did it anyway
okok, tysm
No problem mate if you get stuck let me know 🙂
🙂
how do I use the remapped NMS stuff with gradle?
paperweight
do I need to remake the project?
nah
what's that? I just started using spigot a few days ago so I'm new to all this
Why do you want or possibly need NMS with a few days of experience
good question
Spigot uses Maven not Gradle so it has no suppport for Gradle
it seems to be the best way to add noclip to an armor stand
Why do you need to noclip an armorstand
but an easier way to do what I want is to check if my armor stand's hitbox is in / touching a block
What is noclipping an armorstand?
he wants to push a stand through blocks using velocity
Like no clip on cod bops 2?😂
you could just setGravity false and teleport it instead
I just need to know if it's touching a block
noclip is a game engine thing, not from call of duty but ok
there is a noclip setting but its not exposed in the API. There is also no collition event
is there an easier way to do that?
no, NMS is your only way if you really need noclip
I don't really need it
I just need to know if my armor stand is touching a block and remove it if it is
then you could check its bounding box on a schedule
I already have a schedule thing checking if the block it's in is air, but idk how to check the bounding box
get it's boundingbox and check for an overlap of teh blocks N/E/S/W two high
ok thanks
equals on my course
you can get teh bounding box of each block to check for an overlap
No clipping like you cant collide with the environment i was referring to call of duty as it was a hack in call of duty
It was actually named after the effect of noclip from Quake
I don;t remember it before Quake though. I believe it originated there
actually, does the "Entity#getLocation location store the coordinates as integers? because if it's in doubles or floats, couldn't I just add like .1 for every direction and check if there's a block there?
declaration: package: org.bukkit.util, interface: VoxelShape
just to inform you there is easier ways to check for overlap
^
I think it stores it as doubles but you can always add numbers to those
all you have to do it use the overlaps in teh BoundingBox class
oh ok I'll try that thanks
Ahh interesting
no you need to use the BoundingBox as it's an area not an absolute value. you can;t just add 0.1
Note that the collision shape isn't accurate. It's always a 1x1x1 cube
So for things like slabs it's not correct
how i create a ENDERCHEST gui?
enderchest is just a regular chest
but the inventory instance never gets wiped, just recycled
just half the size
currently I have this (code deleted to save space) but it still doesn't work, even if the armor stand is inside a block
sorry for the code taking up a big space, ill delete it after
ok lemme try that then
stand.getBoundingBox().overlaps(stand.getLocation().getBlock().getRelative(BLOCKFACE_NORTH).getBoundingBox())
or somethign close
for each cardinal direction
I just added 1 in every direction for each different block
should I do that instead? since it seems like it does the same thing
yeah nope this still doesn't work
you check the boundingbox of the stand for overlaps with the boundingbox of each block N/E/S/W
and down right?
if you want to check down
in case it's touching a block like that
you need to check the cardinal blocks, and the block the stand is on, to see if any are not AIR
Hello, friends! Could I possibly have some insights why all the set<armor>(ItemStack)s of class PlayerInventory are not working (at least for me)? Here is my code:
PlayerInventory inv = pl.getInventory();
inv.clear();
inv.setHelmet(kit.getHelmet());
inv.setChestplate(kit.getChestplate());
inv.setLeggings(kit.getLeggings());
inv.setBoots(kit.getBoots());
inv.setContents(kit.getInventory());
I am sure the getters themselves aren't null as I've tested here:
public ItemStack getHelmet() {
System.out.println("Helmet is not null: " + (helmet != null));
return helmet;
}
// Returns true
It seems that setContents() works, but not the individual armor pieces itself. setArmorContents(ItemStack[]) also doesn't work. Any idea why?
Some background info, I am currently migrating my plugin's mc version compatibility from 1.8 to 1.19.2. This worked in the former version, but for some reason it doesn't in the latter.
public Location getCagePosition1(String color){
ConfigurationSection section = getConfig().getConfigurationSection("cages");
String key = "_cage_pos1";
Location loc = section.getLocation(color.toLowerCase() + key);
System.out.println(color.toLowerCase()+key);
if (loc == null){
Event.getPlugin().getLogger().severe(color + " Position 1 == null!");
return null;
}
return loc;
}
Any clues why?
if any of the blocks are not AIR, check for an overlap
should I check if they aren't air, or just go check anyways? because air doesn't have a boundingbox right?
you only need to check non AIR blocks as thats the only way you will have a possible collision
okay
I tried it without checking if it was air or not but it still doesn't do anything
(code deleted again to not spam chat)
does anything immediately appear wrong with this?
I'll delete the code after to not spam chat
no need to check down, but your code looks fine
it will only detect blocks around the stands base, not its head
yeah I'l work that out later
I just want to be able to detect things first
is there a way to check if the entities bounding box is overlapping with anything at all?
Welp. Apparently setContents(ItemStack[]) in later versions also include the armor, so me placing it at the very bottom effectively emptied out the armor slots cuz I didn't put any in the content stack. Nvm this lol
I don;lt see how your code is not working. check the javadoc on overlaps. Make sure it detects partial overlaps
I tried this using
public static String getPlayerGroup(Player player, List<String> possibleGroups) {
int max = 0;
for (String group : possibleGroups) {
group.toLowerCase();
if (player.hasPermission("group." + group)) {
max = possibleGroups.indexOf(group);
}
}
System.out.println(max);
System.out.println(possibleGroups.get(max));
return possibleGroups.get(max);
}```But its returning the highest group in the list not the highest group the player has
is it because i am op?
bump
"Checks if the given bounding box intersects this block shape."
intersects would be partial overlaps right?
no, well the intersection IS the overlap
overlaps is teh correct one
check the box you get from teh blocks is a unit in size
also, if I wanted to make this work for entities as well, is there a way I could just make the armor stand check if it overlaps with anything at all?
there is a method for getNearbyEntities
Because the yml needs to be formatted correctly
It cant just interpret your config and do it
and how shall I format it?
Just make your own interpreter
never worked/created one
so idk where to start with that
if (stand.getNearbyEntities(stand.getBoundingBox().getWidthX() / 2, stand.getBoundingBox().getHeight() / 2, stand.getBoundingBox().getWidthZ()).size() > 0) overlaps = true;
would that work for checking all entities touching it?
you know what lemme try it and I'll see what happens
I believe there is a nearby method that takes a location and a size
use a size of 1.1 for touching
ok I'll try that
if this doesn't work
oh wait
this works I think
it just explodes instantly since it technically spawns in the player
although its making an error in the log thing
How can I store data on players past server reboot? Maybe even past getting a new .jar file for the plugin? I tried doing stuff with config.yml but it resets when I reboot the server
?pdc
🙂
?pdc again
how did u get a photo of me?
it is not a photo
Photo to gif 💀
what do i need to import/add to the dependencies to use this?
PacketPlayOutCustomPayload packet = new PacketPlayOutCustomPayload(new MinecraftKey("minecraft:book_open"), new PacketDataSerializer(buf));
You need to import NMS
what is the pathfinder so i can make zombies run away from players
and how can i clear goals in 1.17
thx
Is there a way to save a custom value into an ItemStack? In my case I want to save an id from the database
?pdc
ty
this.bP.a(3, new PathfinderGoalAvoidTarget(this, EntityCat.class, 6.0F, 1.0, 1.2));
soo
I'm making a plugin which once finished can also be a dependency aswell. How do I it up to get a instance of the main class. And access it inside the other plugins
I've tried multiple times ways I thought would work but they didnt
You probably don't want a dependency where you're getting the main class if by main class you mean the plugin itself
Do I setup the NamespacedKey once or at operation in the PersistentDataHolder?
You can create a constants section and create it there
okay
So if I needed to use a function do Dependancy.function(whatever)
You'd make an object that your plugin would have a method to fetch usually. You can also just implement static, singleton methods since your plugin will always be loaded after the dependencies
i done this to the zombie but its doing its own thing why
wym "doing it's own thing"
initPathfinder and n
n() is the method
i overrided it and made it empty
btw what is the difference of goalSelector and targetSelector
oh target is the attacking nvm
What version are you on?
?paste your whole class
target goals select the target/victim
and the normal goal selector usually selects other behavior
and the override
Because you're probably doing something wrong somewhere else 😛
should i call the method ?
You're not calling initPathfinder?
changed to villager, fixed
You shouldn't have to call it if you're calling super() in the constructor, which I think it makes you
wat
ok 
it shows as a player anyways
im cancelling the spawn packet and sending a namedentityspawn with the id
I have a problem.
I was about to make a localhost minecraft server with bungeecord on version 1.19.2. I started the first server and everything worked. when I wanted to start the second server afterwards it didn't work and in the crashreports it said java.lang.IllegalStateException: Failed to initialize server.
Does anyone have a solution. Thanks
How can i block a player from jumping?
In the statisitic event if it's for jumping set Y velocity to 0
Please tell me how to make sure that the condition is met. It is necessary that the player is sent either a message from the mes1 variable or from the mes2 variable when entering
Where private
I look like this and I understand that it looks stupid somehow 🙂
if (something.equals("somethiing")) { /* do something */ }
hey! i want to develop a custom world generator, is it possible to only "replace" some of the biomes?
so i dont want to rewrite the whole minecraft world generator, just some biomes
How can I hide that stuf?
I need to hide it for weapons and armor too
So hide every vanilla lore
ITEM_FLAG
HIDE_STUFF
declaration: package: org.bukkit.inventory, enum: ItemFlag
on ItemMeta
thx
how do u send subtitles in spigot?
player.spigot().sendMessage
using the chat message type https://javadoc.io/doc/net.md-5/bungeecord-chat/latest/net/md_5/bungee/api/ChatMessageType.html#ACTION_BAR
i cant do ChatMessageType
why not ?
declaration: package: org.bukkit.entity, interface: Player, class: Spigot
certainly takes that as a parameter
if you want to send Title with Subtitle you just do player.sendTitle()
if you want ActionBar
you need player.spigot().sendMessage() where you set type to ACTION_BAR
Ehh, that field stores the additional properties in an optional
Why is nothing except for the button click being cancelled?
?
Anyone know an easy way to determine what and especially how many items have been crafted?
?? xd
?
So not CraftItemEvent but when the item is actually taken out
inventoryClickEvent
Any easier way than InventoryClickEvent
idk
you tried clicking flower pot and it didn't work?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/inventory/PrepareItemCraftEvent.html this maybe?
declaration: package: org.bukkit.event.inventory, class: PrepareItemCraftEvent
declaration: package: org.bukkit.event.player, class: PlayerHarvestBlockEvent
thx xd
i guess you need to check this even instead
this is how I did it
but I guess thats paper
so if youre using paper instead of spigot, go for it
flying backward and still fast?
thats an ender dragon
packets to show player is rotated
but its a player
Wtf
yeah cancelled the spawn packet
sent a namedentityspawn with the dragon's id
and set the state to circling
phase*
now use a packet to make player lie on the back
while walking or flying
dig a hole and make player fly up from it
would look like resurrection
no they are paying me to code a plugin so a girl npc runs from the players
i needed pathfinders so i did villagers
not me
Same same
we had a year together on 9th oct
Bro still remembers
hehe
I wait for mine to be like "babe our anniversary is coming up" and my mind is like FUCK which day
pov you are minecraft player
And i check the calendar before opening her texts to make sure she hasn't asked me which day is it
girls running away
lol
I know it's may but idk which day exactly
sad
It's between 10 and 29
Actually the real anniversary is a bit before
I broke up with her for a week and then we dated again
mans playing hard to get eh
No actually my ex came back crying so I broke up with my gf and dealt with my ex then told her to fuck off and dated my gf again
Having a girlfriend hinders your ability to learn exotic methods to solve complex problems
And my face wants me to solve all my problems
Not having a girlfriend hinders yout ability of getting head
So it does all the hard work
having a gf also hinders your ability of having money
having a gf which gives you money
Bruh she babysits and makes racks and I go to uni and become an alcoholic
❤️
This kid at the gym just cleaned his phone by spitting at it wtf
yeah she does she just invests it all in genshin impact lol
he is russian
no worries
Looks like it
true business woman
I'd do that if I got into a cat crash
genshin investment pakt
spits on their car and rubs with sleeve good as new
I mean she has every character in the game except 2
So I guess she actually has a high worth account
there is a famous russian proverb
I never understood spending mad money on games
Крякнуть, плюнуть и надёжно склеить скотчем
Sure I drop 5 bucks here and there
I have 3 five stars and I've been playing for 1 year and she has 24 and every 4 star
Flextape advertisement
BAN
instead of grunt should say kick
Moan
Spit
Glue 😉
With adhesive protection
Use flexseal Because It Works.
Durex on their way to hire me rn
Personally I never broke something that needed tape
Like last time i broke my chair the back of the chair just snapped off I'd need a lot of tape for that and it wouldnt support me
What to return when creating a new class which is extending BukkitRunnable and then overriding the method runTaskLater the method needs to return a BukkitTask but I don't know how to get it
you override the run() method and call runTaskLater on the class
you dont override runTaskLater
eeh I use a class just to edit variables
?
if I need Anonymous and wanna edit variables I would need to use an array but this will be a shortcut task so I don't wanna create everytime a new array
Anonymous Inner Classes can only have final variables
and final variables cannot be changed
BukkitRunnable runnable = new BukkitRunnable() {
// here you declare and initialize fields
public void run() {
// here you work with them
}
};
runnable.runTaskLater(...);```
scheduler > BukkitRunnable
I wanna edit variables outer of the Anonymous Inner Class
Why?
Thanks!
i really see no cases where this is needed
ChatMessageType.
the enum doesnt exist
you imported right version?
sometimes is needed in which case you create a new class which extends BukkitRunnable or use a trick which is to use arrays
still not there
ima try using the shaded jar
spigot-api-1.19-R0.1-20220710.051022-43-shaded.jar
ik but i hate both of them
bro it takes like 15 seconds
to setup maven project
and include spigot api
and one command to build
do i have to make a new project or can i convent it?
IntelliJ can convert it I believe
you can convert it
It's not really better for someone who hasn't ever used Maven or Gradle before.
Both would do a sloppy job converting it but atleast the IDE won't ask a million questions 
i have a guide here
literally takes less than a minute
😮
dang server on pi still alive after i bombed it with tnt
82 days...
Hi, anyone know if I can set in authors (.setAuthor()) in 2 Lines?
Ex.
"\nAnd: " + player2);```
i don't rlly think so
You could try it, but if it doesn't work then I'm afraid not
nop, It isn't possible
Minecraft read \n with a symbol
Original is possible to change? I'd never tryed
sei ita?
kinda need the other stuff to help
Yes
Te sai farlo percaso? L'ho visto su tecno tipo
mi serviva per un server tra amici
Guarda privato
how to check if an end rod is facing up?
ok, sorry
i just wondered if i can find a certain task with a link to it
as timings provide it
how to change the head skin of a player only in the tab
you can get the file from looking at the path
No one knows how to do it?
I love swearing with configuration sections
When ever i write this on a file and then do Configuration#getConfigurationSection() they always are null!
😂
So i know in different plugins they are called prefix, suffix, group etc. But if I wanted more before the message, like in the photo above. What would be the best thing to search up to get info on them?
idk what youd call them xD
I mean they should be this order:
everything before name Prefix
everything after name Suffix
ok
That what i think
thats correct
Also i need help with fucked yaml sections they are all time giving problems
Exactly its telling that its null, when the section is already in the file
Show us the code and the config
ok
?paste
thanks mate but please dont start like people yesterday that they were treating me like an idiot
I mean they were all time saying black, when i was saying white. Also the same with telling me how to paste code
😂
Yaml file:
Regions:
Yaml code:
public void reload() {
FileHandler data = new FileHandler(this.plugin, "data/regions.yml");
ConfigurationSection section = data.getConfigurationSection("Regions");
this.plugin.getLogger().info("Regions section is null");
}
Just send it on chat, becaue its short code
So where is the null check
in my code is written
Send all your code
ok
And all of the config
there isnt a null check in that code
public void reload() {
FileHandler data = new FileHandler(this.plugin, "data/regions.yml");
ConfigurationSection section = data.getConfigurationSection("Regions");
if (section == null) this.plugin.getLogger().info("Regions section is null");
for (String path : section.getKeys(false)) {
this.regions.put(path, section.getObject(section.getCurrentPath() + "." + path, Region.class));
}
}```
I copy-paste wrong code
I mean its really weird the isues
Because section should not be null
Because the file contains it
Section is not null!
I mean should be happening smth else
What you want to do?
You check if it’s null and just print it out in the console
Right now
im doping that
And its printing null
Basically its laugthing at me because the section in the file is not null, while code tell me that is null
🤡
iirc That file would return null because it has nothing below/in it. Just itself
what?
I mean the section is empty, but it cannot say me that section is null because its there
🤔
If i remember correct that file would return null on a null check because it has no follow up sections
he?
Regions:
notnull: I would no longer return null
Hmn, that wont work, because its a storage file
Which would contain content once sever goes down
use spigots config system and custom config and #saveConfig()
Try print out what this file has inside and check if it contain section
ca** what?
He was check section is null.
yeah
So why is null?
Doesnt make sense
And my FileHandler is not the problem - answering to epicepic
are you just trying to say the spigot config system is shit?
thats what im thinking
i just dont like it, i prefer using my own impl of YamlConfiguration
but that not the point
The point is that the section is being null, when in the file itself is not null
does it even get the file, i have a feeling it doesnt
No, you are wrong
I know what i code
I have say it many times i could be dumb, but not idiot🧐
So dont treat me in that way
add an extra section inside of it eg:
Regions:
testregion:
true: false
``` and just System.out it to check it can actually get sections
it seems dumb but just try it
Relax, he never implied that you were dumb he is just asking you a question no need to get defensive about your code, they are trying to help
The section is null is because your if statement literally is not checking the section you think you are checking
No lmao
Yes lmao
I think the problem is that your file is empty
The file is not empty the section is there
what?
Did you save file
I mean, the filehandler just create a file with the content from the one inside resources folder
I see
The only way i can guess that ConfigurationSection section = data.getConfigurationSection("Regions"); can be null if its not getting the section
That is returning null
Which doesnt make sense
iirc the only way for that to return null is because it cant get the config section
why?
could be that its not getting the file or cant access the file
i have try that and file is loaded correctly
if its not the file being null, i dont have a clue why that would return null
I think empty section return null
iirc it would still get the section so wouldnt be null, the File would be null prob
i mean if the message is shown the file is not null
Check if file is null
ok
Java doc should tell you what behaviour it should expect.
I use json for flat file storage and yaml for flat file configuration :3
No, file is not null
ah ok
sry for late reply I had to go
Amazing bruh
fucked spigot file system
And the ** section is not null
Really LMFAO im getting mad right now
You probably made a mistake
^ thats very often the root of the problem when something does not work 
What could be=?
I have been looking the code 100th times
And i still cannot find what is the reason
Well maybe take a break and come back. Or send the code in a paste
did you try putting data in the section
Do you have your source code on git?
I did this and it still does not work... there is an error but it is different this time.
oh wait
.getserver still null;
pretty much the same
I ill try that
I have find that the error only happens the first time
But then if the file already exists then i dont have any issues
Well if you don't save the config of course you'll have an error lol
How do I get the name of the server that I put in the BungeeCord config.yml in a spigot plugin on a paper server on a subserver of a bungeecord (waterfall) network?
you need event.getServer()
ohhh ok
what?
why would isave it=
I mean that "Regions" comes by default
i mean my filehandler does a JavaPlugin#saveResource() and the YamlConfiguration#load()
So the section is not null
saveResource saves file from jar's resource folder to plugin's folder
I mean saveResource, take a resource fom resource folder
And put it inside the data folder
well what is your config in ide
Yes, the config is inside the resource folder
and when do you use saveResource
i mean how does it look like
bro inside
and what is the problem
config section is being null
show your config loading code
this section gives null
💀
💀
uh yeah no
so much this's
this's everywhere
I should be the one who sais that
Didn't you claim it doesn't work why would someone use it
hee?
No no, the Filehandler works perfect
It should be something else
if has no params
How i can do it so?
even here it switches to {}
Because by default should be empty
Because the content will be saved once sever goes down
you can just not use this section
and only create it when using .set
as a part of path
ok, so, just keep the file empty?
ok
ayyy it works, thx <3
LMAo pretty thanks
i'm smort
I have been all day with that
:|
nuke
Can u explain that what people can join inside another player?
Someone told me about that happening on 1.19
wait what
"yk in mc u can run into someone's character and they move
in the newer versions
it is very annoying
u can push afk ppl into things where they die
"
i can join my pen is to some typical minecraft player's butt
umm that's just collision
you can 100% disable per-player collision in some bukkit/spigot config
oh ok
in the server.properties?
either there, spigot.yml, etc
ah its in paper-global.yml
lol
paper🤢
i mean i have some personal with them hahaha
yeah that's only in paper
ill just stick to spigot plugin
I got it
its literally one line of code
if u have ur listener made
Bukkit site 🤢
you should spend more time on bukkit
bukkit still looking like it was made in 2010
it's really different
Shit i have started to smoke again and its affecting me again
Kids smoking 
When I set the minimum permission for my command in plugin.yml the command still works and it correctly doesn't display in /help for people without the permission but now regardless of player permission I get this when I start typing the command:
This is in my plugin.yml:
commands:
setrank:
description: Sets a player's rank.
permission: ml.setrank
I also tried adding the permission to plugin.yml like this:
permissions:
ml.setrank:
description: Allows you to use /setrank.
default: false
But it didn't do anything.
are you setting executor
Yeah my command and tab completer worked perfectly before I set the command's permission.
The command still runs but the tab completion is completely broken.
do you have the permission
Yup.
is the command op only?
No, it checks for ml.setrank.
if it is try changing default to op instead of false
I just tried that and there's no change.
Can you use tabcomplete when op?
Of course
Yeah it works when I'm op.
luckperms im guessing?
But it doesn't work without op. I definitely have the permission that I set.
No I'm granting player permissions manually in my plugin via PermissionAttachment.
oh no
