#help-development
1 messages · Page 210 of 1

Garbage collection noted
i wanna improve as a self-learning hobby "programmer" or what you say
gc
just systems speaks to me
jvm program
I'm crippling autism
loops through memory parts and erases everything which has no pointers
with perks
Nuke i have find that the problem is with: new ArrayList<>(document.getList("uuid", String.class))
🤡
{
"_id": ObjectId("63655dee415c19460105e4d8"),
"name" : "test",
"cuboid" : {
"x1" : 0,
"y1" : 0,
"z1" : 0,
"x2" : 0,
"y2" : 0,
"z2" : 0 },
"users" : [
"fe7abd91-bf6d-3e87-b1fd-b1f4156ed180"
]
}```
Where is null?
OH SHIT
I realize im an idiot
Im trying to get as uuid
tho it's users
Not as "users"
relatable
Guys i have a prublem (:
I created a scoreboard, then i set the setting Team#setCanSeeFriendlyInvisibles() to true.
I added the player to the teams with Team#addEntry(Player#GetName())
BUT
i cant see my invisible frienz :< pls help me
?paste
You have to add your friends to the team as well.
Otherwise they're not seen as "Friendly"
My Debug: Logger#info(Team#getEntries().toString());
Hi, how can you make an enderman aggressive right when it spawns?
You create eventlistener for the spawn of entities with EntitySpawnEvent and then u check with instanceof if its an enderman and then u do Enderman#setTarget(Player);
Basically this and u replace Player with your player
I run a debug and the debug says that we are both in the team
im having some error when trying to do a gui with command, can i send the error and source code here ?
click on the link, paste your code and send us the link back
the error or the code? bc the code is 9 files
if you have a photo of your error you can send it here of course
ye wait
Well this should be a vanilla thing, so if you're 100% sure you're both on the same team and that team has the seeFriendlyInvisibles set to true then... 
im sad now :C
Should be working. Maybe check the vanilla /team command to see if everything is right.
the point is i cant see scoreboards created wiht plugins and teams not with the vanilla commands
idk if its a bug or not
It's not, it's because you're creating the teams on a getNewScoreboard and not getMainScoreboard
Maybe see if you change it to getMainScoreboard if it works
I'm very new to Spigot and Java, could someone help me out with this?
No errors, just doesn't broadcast the "Test" message at all when joining. Not sure what to do.
Did you register the listener
yes
Also your plugin is null, you never initialized it
How would I do that?
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Like that ^
pretty much anything you need to make a plugin is written about on the wiki
i would say it was something like plugin = this in onEnable but yeh
private final BossFights plugin;
public DamageListenerXP(BossFights plugin) {
this.plugin = plugin;
}
and when you register the listener new DamageListenerXP(this)
^ has to be in the main class, the one that extends JavaPlugin
just good java programming practice
just throws an error
If you didn't make constructor yet, it will be red
Because final must be initialized in constructir
variable plugin might not have been initialized
.
.
I can't figure out where to put it
In the class
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
What is causing this error:
org.bukkit.command.CommandException: Unhandled exception executing command 'company' in plugin CompanyCore v1.0
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[patched_1.12.2.jar:git-Paper-1620]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152) ~[patched_1.12.2.jar:git-Paper-1620]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:685) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1492) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1297) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:14) ~[patched_1.12.2.jar:git-Paper-1620]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:850) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774) ~[patched_1.12.2.jar:git-Paper-1620]```
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666) ~[patched_1.12.2.jar:git-Paper-1620]
at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.NullPointerException
at me.companycore.CompanyCore.checkIfCompanyExist(CompanyCore.java:73) ~[?:?]
at me.companycore.commands.CCGCommands.onCommand(CCGCommands.java:25) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[patched_1.12.2.jar:git-Paper-1620]
... 15 more```
Here is the line 73
```public boolean checkIfCompanyExist(String companyName) {
if (getCompanyData().isSet(".Aziende." + companyName)) {
return true;
}
return false;
}```
checkIfCompanyExists is throwing a NPE
whats on line 73
So getCompanyData() is probs null
Does anyone know how to make armor durability way better?
expand on that?
How can I suggest something to be added to the API?
limt
Still can't figure out why this isn't working. No errors, nothing is being broadcasted.
I want it to work better not just set it to a million, I want it to actually just lose less
Make a Custom System
fx a config
I guess it didn't compile correctly? I just now realized that nothing else is working.
I do the same process I did before and it worked fine
its intellij
sadly idk the propper way of doing it!
@wind blaze
you could just display your custom Durablity
Ahhh there has to be a more simple way
Storing Durability
Every time it goes down you go -1
hey, does someone know how to get the nearest stronghold location based on the players location?
what you're thinking about maybe is to change the java number type
java short is max at 32,767
Bro
Then dura will be fucked
I want the basic system to work I just want it to lose less in total
It is set it to -1 per loss then I can spam click you down to armor break within seconds
I wabt basic dura to work just more strong
And that’s so god damn difficult for some reason
ye right
i meant to take you take the damage
attract it
in your own custom system
either you do this or you change spigotmc code smh more pain and more pain
Im too noob to add that custom system. I’ve tried a ton of times and spent hours before. I don’t just come here whenever I want code like Fr
because Minecraft has java short durablity
I come here whenever I’m completely lost
I tried to make some chance to lose dura at like
Custom System i recommend
How would I acquire such a system tho
spigot documentation
Thats what I did 😦
declaration: package: org.bukkit.event.player, class: PlayerItemDamageEvent
@wind blaze
I know bro I’ve tried for hours
It’s not like I came here instantly after wanting to do it as I said
what you need help fixing?
I really appreciate your help bro but I already seen all of that
I am physically not able to do it in any way. I’ve tried system, setting the dura loss per random chances etc etc
But everything always was cheesable or didn’t work in the end
u got this :>
don't lose hope 
Yeah it’s definitely a me issue lol
That’s why I asked
Ive seen server w sets tanking s50 for hours
Or s30 I forgot
my suggestion was to
Store Costume number in a Config and then attrach
getDamage()
how do i make a daya.yml? playerlisteners
if it goes below short max then setDurablity
Why I have a ClassNotFoundException with a maven dependency when I did everything right in the pom.xml I put in shaded and everything
or Display damage
Tried that but technically that makes every incoming damage the same, no? Spam click = armor Insta break
My system was: get a random then do „if random <= damagerhitcd*% u want“
But that was weird too
Well yeah the armor has to have less chance to break I want it be tanky so sharpness 30 works against it etc Yk
so certein items have more chance..
to do more damage?
Damager Item and Damaged Item?
ah
why not make it do less damage then
exactly
it bascially minecraft damage
denying minecraft itself
you can't blindly guess a non incoming damage source
pain
similer to how do i connect to facebook without wifi?
exactly
more perfect phrase
the person needs to take the input people are saying
or it won't go anywhere
hello, is there an event to check if an entity gets angered at player?
arena:
permission: box.arena
permission-message: §cYou cannot do that.
usage:
- "§c/arena pos1-2"
- "§c/arena create <name> <resetseconds>"
- "§c/arena remove <name>"``` good?
thats how i add lines to usage yes
LMAO i received a comission from a client, which his project/custom plugin done by another developer is like 5gb weight
I assume 5gb jar file
includes every spigot jar to ever be compiled
Anyone know the "event" that is fired through the tebex api when someone makes a purchase?
How can I set an items durability using ItemMeta? I'm having trouble figuring it out.
(specifically I want to subtract one from its durability every time the event is called)
@boreal python
you get ItemMeta From the Item
set the ItemMeta on the Item done
this
declaration: package: org.bukkit.inventory, class: ItemStack
ItemMeta ItemMeta = Youritem...getItemMeta();
ItemMeta.setDurability
Youritem.setItemMeta(ItemMeta);
Guys why when i use Block Action packets to send open Chest Animation its work fine but close Animation don't work There is no errors ):
using (ProtocolLib)
Show your code
?paste
protected void addArena(Arena arena) {
arenaList.add(arena);
try (PreparedStatement ps = c.prepareStatement("INSERT INTO arenas VALUES (?, ?, ?, ?, ?);")) {
ps.setString(1, arena.getName());
ps.setString(2, arena.getWorld().toString());
ps.setString(3, arena.getCube().toString());
ps.setString(4, arena.getMaterial().toString());
ps.setInt(5, arena.getSeconds());
ps.executeQuery();
} catch (SQLException e){
Bukkit.getLogger().info(e.getClass().getName() + ": " + e.getMessage());
}
}``` error: `java.sql.SQLException: Query does not return results`
use executeUpdate instead of executeQuery when inserting values
magic
Don't detect inventories by their name. Use the Inventory instance or create your own InventoryHolder
Also what's the point of casting an int to a byte and then back to an int again
also also you should stop that static abuse
ok i will just type 0 to close chest
but the close sound work fine Animation don't working (: open Anim work fine It's weird
What's 54 in this packet?
chest id (item ID)
Number ids aren't used anymore
what recommend for sql software for developement on private desktop?
broh i use it to open Anim and its work
So I believe you're sending it as the action param
Which is the amount of viewers
You're telling it that there's always 54 viewers in the chest
I use XAMPP and HeidiSQL
i can send just 3 section i have (block position , Action ID (1 to open 0 to close) , Item ID 54 is the chest id)
Again Minecraft doesn't use item ids anymore
there is a way to create a skull with custom texture more easier and faster than gameprofile etc ?
no
okay
textures lookups come from Microsoft/Mojang
ok do you know how can i send the item ID ?
He said "faster"
run
I assume he's annoyed by the couple of seconds to lookup the texture
and write
You don't need to lookup the texture server side. It's sent as a link to the client
Yeah
are you trying to do an animated skull texture or something?
what oracle sql for then?
set durability is depreciated
oh no
you could specify that in the check
how might I set explosive damage to certain players or groups
from a certain weapon
for example I explode tnt
but it doesn't damage you, or your teammates
but only the other team
This displays your health with a .0 at the end of your health value. How could I get rid of that?
Math#round would do the trick i guess
You mean math.round?
ask away
Your pfp is a sin to humanity
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
how might I set explosive damage to certain players or groups
from a certain weapon
for example I explode tnt
but it doesn't damage you, or your teammates
but only the other team
@tall dragon
Dont tag ppl please
Oh my bad
but you can answer my question too?
I dont really know sorry tho
💀
I was going to tell him to use PDC but i wasnt sure if tnt allow it
?pdc
already know that
the pdc part
cast to integer (change datatype of playerScaledHealth to integer)
@echo basalt how was named the thread we were talking? Weeks/months ago - About menus/inventories
How do I set how fast an arrow flies from #launchProjectile?
i get why pp use remapped for 1.17+ 🙂
Why does this keep erroring?
if (shopData.get("general.npcIdentifier") instanceof Integer) {
npc = CitizensAPI.getNPCRegistry().getById((Integer) shopData.get("general.npcIdentifier"));
} else if (args.length >= 2) {
npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, args[2]);
} else {
ErrorHandler.npcMissing(player, "shops." + args[1] + ".yml");
}
java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
Its making me feel rlly stupid lmao
array index start at 0
ik
length 2 = array[0] and array[1]
gets everyone at the start
💀
Entity#setVelocity()
Help: Falling blocks(chest) doesn't appear in my eye
If I see it transform into a block when it falls on the floor, it is true that a falling block has been spawned, but the falling block is not visible to me.
this is my code
@EventHandler
public void onDrop(PlayerDropItemEvent event) {
new BukkitRunnable() {
public void run() {
item.getWorld().spawnFallingBlock(item.getLocation().add(0, 2, 0), Material.CHEST.createBlockData());
item.remove();
}
}.runTaskLater(Main.getInstance(), 10);
}
how can I create a sign gui to get player's input
you are first spawning the item and then removing it right away
public void onDrop(PlayerDropItemEvent event) {
item.getWorld().spawnFallingBlock(item.getLocation().add(0, 2, 0), Material.CHEST.createBlockData());
new BukkitRunnable() {
public void run() {
item.remove();
}
}.runTaskLater(Main.getInstance(), 10);
}```
Sign Gui
Error: Could not find or load main class net.md_5.specialsource.SpecialSource
Has any one found a fix for this?
show your pom
and in what context
java -cp C:/users/jeremy/.m2/repository/net/md-5/SpecialSource/1.11.0/SpecialSource-1.11.0-shaded.jar:C:/users/jeremy/.m2/repository/org/spigotmc/spigot/1.18-R0.1-SNAPSHOT/spigot-1.18-R0.1-SNAPSHOT-remapped-mojang.jar net.md_5.specialsource.SpecialSource --live -i testmobs2.jar -o testmobs2-obf.jar -m C:/users/jeremy/.m2/repository/org/spigotmc/minecraft-server/1.18-R0.1-SNAPSHOT/minecraft-server-1.18-R0.1-SNAPSHOT-maps-mojang.txt --reverse```
ran in powershell cmd and git bash same result
are you using maven?
I am
I don't use md5's plugin
the one time i did it asked me to use sdk of 1.5... I run 17
There is always a chance I set up the pom wrong
show it bruh
dont have a current pom with the plugin
give me a minute
the porn you requested
does anybody know how to get a DimensionType off of a ServerLevel? (nms with Mojang mappings)
nmsLevel.dimensionTypeId()
well it doesnt work
also Someone said non-solid blocks arent rendered if theyre a falling block
(I no longer need help)
pom*
How can i check if a argument of a command equals to a string in a yaml file?
for example
Clans:
TestClan: <- This should be the argument
Leader: UserUUID
if (arg[1].equals(config.get("path")
It doesn' t work
I already tried it
that wont work
you just made my brain realise it wont lol
u should check if the configuration section contains the path
can't u just check if the file contains the path?
if (config.contains(arg[1])){
ConfigurationSection section = config.getConfigurationSection(arg[1]);
//get ur data
}
Hello elgar
how can i remove this little icon that tells me that i edited the message?
you'd have to use the preview to edit the message
what is a preview
declaration: package: org.bukkit.event.player, class: AsyncPlayerChatPreviewEvent
did i miss somethnig
presumably
Snapshot 22w19a is here with a new chat preview system, lots of warden fixes and improvements to the locate and place commands! Check out the details here! #minecraftemployee
slicedlime works as a Tech Lead for Minecraft at Mojang, but the YouTube and Twitch channels are personal projects run entirely in his spare time. This is an unofficial up...
allows servers to modify a message without breaking signatures
why is it deprecated
that is spigots fun way of saying "this is draft API and might change"
xd
Snapshot 22w42a actually removed chat preview altogether, so who knows if it'll actually come back in later snapshots.
True, but they also made some decent changes to the chat system over these last three snapshots.
microsofts brain in a nutshell: 🗑️
You can install FreedomChat.
what is that lol
Or you can wait for 1.20. lol
thats better
It works great.
i think i will program it myself but great idea
If you don't do it right, you'll break your chat plugin.
i take the risk because i program everything by myself
that would be in 1.19.3 iirc
FreedomChat reconstructs player chat as if it were coming from the server itself, which is never signed
Idk, they've been going back and forth about what features are going to come in what version, so I'm still assuming that everything will come in 1.20 and they will do more minor revisions like they said.
this feels illegal but i do this LMFAO
Helmets without armor propeties
yea their development is a bit of a mess with what is in what version
iirc the new blocks, entities and that type of stuff will ship with 1.19.3 in the datapack but will release in 1.20 the rest is all coming in 1.19.3
Yea that is my current understanding too
mostly because all of the network changes are not behind a flag
so you cannot really enable/disable them
So more or less, early release that can be toggled with datapacks? Kinda like the oldschool hidden textures or the bundle. (1.17)
in the snapshots and 1.19.3 will have a datapack for 1.20 stuff and another datapack for the bundle
Yea, release 1.19.3 and have camels and signs and shit hidden behind a datapack flag
Hey guys! I have a plugin with helmets. but you shouldn't be able to put them on. so no longer have the property of armor. how do I do that?
You're gonna have to listen for a few events and just cancel them. Alternatively, you can use the resource called ArmorEquipEvent found here: https://www.spigotmc.org/threads/arnuhs-armorequipevent.545188/
How do I make a dolphin target a different block as its treasure when giving it a fish?
Changing the Treasure Position does not work
isnt chat preview gone in new update
yes as discussed like five messages above lol
is there a reason why
Nothing listed in the changelogs
presumably rn adoption is just low ( that at least is my take)
as the preview system (while powerful) had some drawbacks
Well, it has its issues in regards to usage
1.19.3 looks rather promising
as modification seems to be more encouraged
(the gui message tag is grey instead of yellow, the icons are not there unless you hover the message)
well spigot trashed them in there
why bruh
because they break signatures ?
i can regex the links and format the message
actually nah 1.19.3 would not fix that
yes
which is so trivial, I am surprised there is no plugin for it
there is
thank god
not popular (150 downloads) but it exists
who maintains it
its just regex xD
Pattern.compile(regexHere)
No Chat Reports apparently reintroduces it
it doesn't have a source linked 
it is open src tho
is it ?
https://www.spigotmc.org/resources/no-chat-reports.102990/ has its source linked
isn't that the project that has emojis in its commit messages ?
i use that to automate releases yes
lol xD
super handy, i just have to click publish
its meant to be like that, i had to publish it because otherwise testers couldnt download
there u go fixed XD
blocks your ray should pass through
like liquids
or glass if you wanna ignore glass blocks for example
Weird Bug when adding Points to a player
y2k commons
anyone know if protocollib supports listening to any packet sent
without specifying PacketType nothin happpens
you can just specify all packets
PacketType.values();
how might I cancel knockback for the player who swung the axe to create the explosion? Also cancel damage for the player and his team
hello does anyone know how to get the nearest stronghold pased on players location
particle effect instead of actual explosion, get players in radius of where you spawned the particle, damage needed
Do you guys know how to handle big threads
does anyone know a scoreboard library for 1.19?
What
when the
would anyone here have a suggestion of how i would best find a safe location?, like i have a spawnpoint. buy say that point has been blocked off with blocks. what would be the most efficient way of finding a location as closest as possible to the original point that is safe
remove the blocks
thats not an option -,-
or just pick a random location and check until theres a safe onme
seems very inefficient
Hi, how do you guys deal with custom config reloads? I don't want to disable/enable the plugin every time to reload the files :/
set the values in the plugin?
have a variable that is assigned to the config path
and update that variable with a commando r osmething
i know. but i need to keep everything as high performance as i can
u want the closest block to the spawn
that is safe yea
the only way is to iterate through every block around the location like thats the most efficinet ur gonna get it
another idea is to just get the top block. but that might bring issues
I've made a little map that track the configs, tried to reload the config and update the map, the map does get updated, but if I were to use the map value in a variable, the variable is not getting updated, I though that the variable would point to the references of the map value :/
for locations in a cave for example
getHighestBlock()
why is ur spawnpoint in a cave
doesnt the default minecraft respawn stuff have that sorta feature
i guess i could also just go in 4 directions and get the the closest safe point or somethging
and if it cannot find just disband the spawn
aight thanks for ur insight anyway. i will try some ways and just benchmark for the most performant way i guess
honestly if the player died in a spot it's extremely likely that spot was air
if it wasn't, your server isn't going to combust with a hundred block iterations
its just that im working on a "minigame" plugin. and each team has a set of spawns
and players could block those off
some of my physics plugins do hundreds of block checks and raycasts per second
with negligible performance change
yea i will check how performant it is. im very often over optimizing haha
im always afraid stuff will lagg like shit
just dont allow them to place directly on the spawn, and allow them to place around
that would be an option as well
it's much simpler. If the other team block off your spawn and you just spawn outside the blockage theres a bit a of a flaw there
there would be no gain in doing the blocking in the first place
yea might just do that tbh
👍
is there any way to register an event within scheduleSyncDelayedTask
why would you want to do that
idk because this legay code does it so im doing it too
just have a check in the listener that updates as a variable in your runnable
why not runTaskLater
idfk
or that
Bukkit.getScheduler().scheduleSyncDelayedTask(UltraPrisonCore.getInstance(), new Runnable() {
public void run() {
Events.subscribe(PlayerJoinEvent.class)
.handler(e -> {
if (UltraPrisonCore.getInstance().getPluginDatabase().getPlayerLanguage(e.getPlayer()) != null) {
if (!(playerLanguages.containsKey(e.getPlayer())) || !(playerLanguages.get(e.getPlayer()).equals(getPluginDatabase().getPlayerLanguage(e.getPlayer())))) {
playerLanguages.put(e.getPlayer(), String.valueOf(addonsAPI.getPlayerLanguage(e.getPlayer())));
}
}
}).bindWith(UltraPrisonCore.getInstance());
return;
}
}, 0 L);```
any dev thats wants to make a simple plugin, and il pay for your time?:)
brr
this is the old code and I need to replace it with @EventListener
?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/
thats not a bukkit event
not sure how to
its a bukkit event library
im trying to convert it to @EventHandler but idk how
events.subscribe will add the player to that event map i presume
the event will only affect players in that map
ehm no
when what
Events.subscribe is the equivalent of @EventListener
prolly just an easy way to listen to events
it's literally running the code immediately i just realised
instead of java @EventHandler public void useless(EventType e) its just Events.subscribe(EventType.class)
why is it a delayed task with delay 0
yeah idk why its doing that tbh lol
oh wait maybe I can just register listeners in there
smort
or just register the listener after?
getServer().getpluginManager blah blah .registerEvents() after ur code is done
the Events.register internal code i'm 80% sure just registers the listener
How can i add permissions to a player?
I'm trying with the VaultAPI but it isn't working i don't know why
How would I make a plugin that adds a new placeholder called %player_enderdragon_kills%? I want the placeholder to show how many times a player has killed the ender dragon and I would like to use it with a leaderboard plugin so that it displays the top 10 ender dragon kills for each top player.
perms.playerAdd(newViceDir, "test.permission");
hmm is this outdated or what is this? https://www.baeldung.com/java-mongodb
😉
How would I make a plugin that adds a new placeholder called %player_enderdragon_kills%? I want the placeholder to show how many times a player has killed the ender dragon and I would like to use it with a leaderboard plugin so that it displays the top 10 ender dragon kills for each top player.
nice naming smh
create extension for placeholderapi
baeldung looks outdated asf
this site seems to fuck with me too
ok artifact id is different
isnt this the dependency?
can anyone help me with the right dependency for mongodb? also when trying to do MongoClients.create("mongodb://localhost:27017") i get some exception which leads to java.net.ConnectException: Connection refused: no further information
hi guys im trying to recreate this and i have made gui but im not sure how to do this when player adds item it changes gui
this exception can be tons of things since it is the same as with sockets it might be because your host is not listening for connections 🤷🏻♂️
i tried InventoryDragEvent but it doesnt really work as i tought it should
try InventoryClickEvent
idk this is the whole thing https://paste.md-5.net/ibajaqilex.cs
yeah and how would i then update repair gui with that item person placed before
just trying to do some basic stuff
wiat 1 tick and call some method witch will update the eventinventory for player
this tutorial using old stuff too 🥺
use the papi expansion statistic
Why Im getting false from this method some time? I run this method in onInventoryClickEvnet after one tick.
prevThiefGUI is inventory saved onOpenInventoryEvent.
inv is event inventory.
boolean output = false;
for(int i = 0; i < 36; i++) {
if ( InventoryEvent.prevThiefGUI.get(player).getItem(i) == null
&& inv.getItem(i) == null ) continue;
if ( InventoryEvent.prevThiefGUI.get(player).getItem(i) == null) {
updateThiefedPinv(player, i, inv.getItem(i));
output = true;
continue;
}
else if ( inv.getItem(i) == null ) {
updateThiefedPinv(player, i, null);
output = true;
continue;
}
else if ( !( InventoryEvent.prevThiefGUI.get(player).getItem(i).equals(inv.getItem(i) ) )) {
updateThiefedPinv(player, i, inv.getItem(i));
output = true;
continue;
}
if ( InventoryEvent.prevThiefGUI.get(player).getItem(i).equals(inv.getItem(i))) continue;
return false;
}
return output;
}```
The mongo docs use the same dependency you are
saw this so tried this one
only getting a timeout exception
im wondering why there seem to be two dependencies
ig
No I’m wrong
Sync is for synchronous applications. The other Java driver uses reactive streams. Heard them mentioned before but haven’t looked into them (because kotlin has its own implementation which is better:)))
dont really care about the dependency, as long as it works :)
Only other thing I can think of is make sure MongoDB is actually running.
Only thing that could cause that otherwise is a firewall issue but it’s localhost so that shouldn’t be a problem
am i supposed to download smth or what? i see people downloading the jar instead
just using maven and not shading or anything
to get entities in a radius, would it be more efficient to get the entities in a chunk and then check the distance between the entity and the starting point compared to using bukkit's method?
Thanks!!
Either wrong port nor address
I had that exception yesterday and was cause because i was using wrong mongo address/mongo ip
wdym
I mean mongo-java-driver cannot connect an offline mongo sever
^ he's right you can't exactly connect to a non-existant mongo-db
If that is what u are meaning
uh idk i thought that dependency would host the thing itself or smth
never used that stuff
Oh no
💀 sql
mongo drivers will make you hate every time you have to use sql ever again just be warned
tread carefully
Agree, since i use mongo never want to touch fucked sql again
sql is a fking mess
im not
windows, found the installer anyways
dang
Compass is the mongo recreation of PhpMyAdmin from Mysql
idk it asked to install that too and i was silly to opt out
when working over Linux interfaces fucks a lot, just use terminal when using Linux
In my case most of that interfaces get broken
Idk I'm working on Windows or console Linux
I would use just 1 word
oh ok
I understand im really bad with maths tho
Why dont take a look on others plugins, there is no need to reivent the wheel
Creating and deleting worlds is very resource intensive
That why
So 1 world/island could be very overkill
Multiply that by a promedium of 150 users daily
😬
are you kiddin me
You don’t actually need it
Leave some space between them
What’s class Main line 23?
hypixel makes custom plugins
just me doing smth silly but damn that format looks cursed
You cannot save none primitve objects
I mean mongo only accept saving string, int, double, boolean, byte (primitive java types)
Is there a way to spawn this head with Spigot plugin?
/setblock ~1 ~ ~ minecraft:player_head[rotation=0]{SkullOwner:{Id:[I;-812178264,1520781489,-2119637620,284666857],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTcyNmQ5ZDA2MzJlNDBiZGE1YmNmNjU4MzliYTJjYzk4YTg3YmQ2MTljNTNhZGYwMDMxMGQ2ZmM3MWYwNDJiNSJ9fX0="}]}}} replace
```If yes how?
For sever help please use the #help-server channel
Its not for server
Spigot Plugins
Oh ok
makes sense as its just json
You want to do that with spigot api
Yeah
So you cannot save Location obj, etc
To spawn the
Player head from the command
^^
already regretting the many Document instances smh
couldnt they just give it another name
rename document?
that class name just sounds stupid
Document is not from Mongo tho, its from Bson
mye
Also that is how mongo call them. Document is a key-value storage, and collections are a set of documents
Its doesnt sound stupid
You because use shity sql
document is just a record and collection a table
Yeah
dont dare to call it shitty
true
I used to be hours trying to link 2 tables togethers
you could also technically make an SQL implementation for mongoDB
with some limitations
me trying to write a pojo mapper for sql using reflections
its a pain in the ass
ill probably throw it away smh
saw that
But i never could use them successfully
i was talking bout annotations
dont you like annotations?
@DB
class Database {
@Table(type = Amogus.class, name = "amogus")
Table<Amogus> amoguses;
}
@Row
class Amogus {
@Column
String id;
}
``` i want to make smth like this
fourten was doing that
for shity sql
sql isn't that bad, but it definitly isn't the pinicle of human achievement
it is way to rigid imo json datastructure is much more appealing to me
Why amogus💀
also they are called "Amongous"
ok i broke it
probably cuz i added a try with resources around the client
MongoClient client = MongoClients.create("Mongo.Uri");
MongoCollection<Document> test = client.getDatabase("test").getCollection("name");
ah ye ij being shitty
Hibernate be like, am I a joke to you?
i dont want to talk about that 🥲
making a library yourself is more fun
you dont want to see my reflections code lol, its a mess
Sure, but its easier and might be enforced to use sth like hibernate in the world of enterprise industrially speaking
are you caching the fields?
yeah right
80 lines of horror to setup a table
cuz getField(String) is slow as fuck
when saving that doesnt matter
for the lovers: https://paste.md-5.net/ewugomayox.cs
its so limited that ill probably abandon it
shouldve put in on gh just to see the reactions
Fourten
I need your recommendations
ImIlussio have his own menu api, so im recreating from what he has show/some snippets of his code
So he has something like a MenuManager#getChain()
imilussio sounds like a spanish dictator
Why!
Fourten, any idea how orks that ?
Because i was thinking about using smth like LinkedList<UUID, List<Menu>>
chain probably refers to the fact that the inventories are linked (think of a menu with pages)
Yeah
He told me that
But i dont know how to create it tho
😬
I mean im copying it because i like the way the code is written
Mainly because the impl is pretty familiar
that chain thing just being a inv linked to another one ig
anyways can i change my gh account in ij cuz now im committing thro the wrong gh account?
ill totally blame college
Best thing you can do is @echo basalt
Theres a setting somewhere
?
i mean would setting an author here help?
what you want
I need your help!
can i have money? 
i would do the same
I can give you $40 that were given back when i bought smth on a site
you know when to stop
what is the easiest way to create a Sign Gui to get a player's input?
ill probably create a new plugin with the content of my old, just to get rid of the whole mess i made lol
now my college gh account is fucking up with the one i use for other stuff 🐼
Why Im getting false from this method some time? I run this method in onInventoryClickEvnet after one tick.
prevThiefGUI is inventory saved onOpenInventoryEvent.
inv is event inventory.
boolean output = false;
for(int i = 0; i < 36; i++) {
if ( InventoryEvent.prevThiefGUI.get(player).getItem(i) == null
&& inv.getItem(i) == null ) continue;
if ( InventoryEvent.prevThiefGUI.get(player).getItem(i) == null) {
updateThiefedPinv(player, i, inv.getItem(i));
output = true;
continue;
}
else if ( inv.getItem(i) == null ) {
updateThiefedPinv(player, i, null);
output = true;
continue;
}
else if ( !( InventoryEvent.prevThiefGUI.get(player).getItem(i).equals(inv.getItem(i) ) )) {
updateThiefedPinv(player, i, inv.getItem(i));
output = true;
continue;
}
if ( InventoryEvent.prevThiefGUI.get(player).getItem(i).equals(inv.getItem(i))) continue;
return false;
}
return output;
}```
What the fuck!
how do i prevent a player from getting things from a GUI?
what do you mean? 😄
I can paste here whole class but, It will be long message
Cancel click event
@EventHandler
public void onClick(InventoryClickEvent e){
PlayerData data = PlayerDataManager.getData((Player)e.getWhoClicked());
if(data != null && data.getOpenGui() != null){
if(e.getCurrentItem()!=null){
data.getOpenGui().handleButton(e.getCurrentItem());
e.setCancelled(true);
}
}
}
like this? isnt working
registered it? otherwise your condition is false
if(something != null { if (something != null {} }. Damn
ye i did
i forgot u can put 2 && in one if lol
should i give link to the source code? since theres more code in the other classes
hmm? Is something wrong or its not readable that code or I dont know what do you mean, Im sorry 😄 or can I somehow give link to full file?
Check if data and getOpenGui are really not null
am i not already doing that?
ah
how might I run a runnable every 1 second?
would it be java Bukkit.getScheduler().runTaskTimer(plugin, () -> { if (event.getItem().getItemMeta().equals(ItemManager.GravHammer.getItemMeta())) { Player player = event.getPlayer(); Location loc = player.getLocation(); player.getWorld().createExplosion(loc.getX() + 2, loc.getY(), loc.getZ(), 20f); System.out.println("I work"); } }, 0, 1000);
both numbers are in ticks, there are 20 ticks in a second in the best situation
so 20 would do it
0 is the initial delay, tthat should stay 0 if you want to schedule it immediately
so 0, 20
also
player.addPotionEffect(PotionEffectType.ABSORPTION);
Im getting an error here
anything wrong?
player being null? what error?
can someone help me with Sign Gui
says its required type is potion effect
but I used potioneffecttype
So use position effect
ah compilation error, give it a new potioneffect
??
new PotionEffect
check what constructors there are lol
player.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION));
oh wait
🤦♂️
what are both the ints for?
the duration and level?
what abott he 3 booleans @tardy delta
Boyz
why does buildtools not go from 1.12 onwards?
exit me this error:
Attempting to build Minecraft with details: VersionInfo(minecraftVersion=1.8, accessTransforms=bukkit-1.8.at, classMappings=bukkit-1.8-cl.csrg, memberMappings=bukkit-1.8-members.csrg, packageMappings=package.srg, minecraftHash=null, classMapCommand=null, memberMapCommand=null, finalMapCommand=null, decompileCommand=null, serverUrl=null, mappingsUrl=null, spigotVersion=null, toolsVersion=0)
Starting download of https://s3.amazonaws.com/Minecraft.Download/versions/1.8/minecraft_server.1.8.jar
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: https://s3.amazonaws.com/Minecraft.Download/versions/1.8/minecraft_server.1.8.jar
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at com.google.common.io.Resources$UrlByteSource.openStream(Resources.java:72)
at com.google.common.io.ByteSource.read(ByteSource.java:296)
at com.google.common.io.Resources.toByteArray(Resources.java:98)
at org.spigotmc.builder.Builder.download(Builder.java:1083)
at org.spigotmc.builder.Builder.main(Builder.java:416)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
Someone already confirmed that there is problem with 1.8
when will it be fixed?
¯_(ツ)_/¯
but this comes with 1.8, 1.9, 1.10, 1.11
i need nms for my plugin
how i can do?
hem...?
how might I set an event to happen only after an axe has fully chargted up for an attack?
i need 1.8, 1.9, 1.10, 1.11 nms for my plugin
how i can do without BuildTools?
since InventoryClickEvent is deprecated, what should i use instead?
can anyone help me?
patience, its been 1 min lol
Is there a way to change the AI between two Entities?
brr what a mess
yo how might I set an event to happen only if an axe has completely charged up
anyone?
check that axe and if your conditions arent met, cancel the event?
may I have an example?
here lemme show cod
public class Event implements Listener {
@EventHandler
public static void onRightClick(PlayerInteractEvent event) {
if (event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK) {
if (event.getItem() != null) {
if (event.getItem().getItemMeta().equals(ItemManager.GravHammer.getItemMeta())) {
Player player = event.getPlayer();
Location loc = player.getLocation();
player.getWorld().createExplosion(loc.getX() + 2, loc.getY(), loc.getZ(), 20f);
player.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION, 1, 200, false, false, false));
System.out.println("I work");
}
}
}
}
}```
this makes it every time you click
it makes an explosion
doesnt need to be static
idk check if the axe in the players mainhand is ready to attack in someway
idk
help
java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
Why... WHY?! WILL YOU FUCKING WHY?!
will you fucking why
absolutely
this crap made me mad
I mean
I used
the same fucking method
and now
it just doesn't works?!
average day of a developer
public static void LoadDriver() {
try {
Class.forName("com.mysql.cj.jdbc.Driver").newInstance();
} catch (Exception ex) {
ex.printStackTrace();
}
}
Honestly this code is correct, right? .-.
assuming spigot has that included ig
-the game is over-
another fun fact: I've added the lib from Spigot
like in my other plugin
dammit
fun fact: im doing mongodb and this shit is fucking up with me
is that a required line to register the driver?
bitch
Java itself is a weird shit
im feeling like im using gson
adding typeadapters everywhere
why isnt it using reflections under the hood
this is the same as why isnt my plugin actually loading the driver
while the coding is the fucking correct one
D:
aah i hate frameworks where you need to have a default constructor for a pojo
how I can disable when holding shift in IntelliJ IDEA and then placing one "{" it doesn't open the method it skips the brackets
no, seriously, can somebody help me with this please?
im wondering if Class::newInstance can be used when there no def constructor?
thats a good question
thinking about Unsafe::allocateInstance now smh
like mine
lets not get into unsafe
