#help-development
1 messages Β· Page 1034 of 1
I'd probably just want a general QuestListener which listens to every relevant event, then through some sort of event/listener system on top of that that's better suited for the task than bukkit's system
Hello guys, how to create inventory with component title?
something like
Quest#subscribe(channel)
Quest#receive(channel, Object)
SomeClass#subscribe(channel, subscriber)
SomeClass#unsubscribe(channel, subscriber)
SomeClass#publish(channel, Object)
Then each event just publishes relevant data to a specific channel, or a generic channel and each quest handles relevant data. Still has looping, but less so
then each quest can just have something like Map<String, QuestTask> tasks where string is a specific channel or something like that
That should work, yea @pseudo hazel ?
generic pub/sub channels, then splitting tasks per channel to limit how many times things get looped over.
Overkill, but it also makes achievements and stuff easy to support too
nms
I use nms but nms doesn't support font
yeah that sounds good
and you;d still have looping
but its necessary
but less, over all
like its all mandatory looping
you have to loop through all quests that should receive an event anyways
aye, but it's also not doing a "should receive check" and such, since it's just stored in a map or something
but by spefically subcribing to a channel you only get the events you asked for
Exactly, cutting down on unncessary calls. Same w/ tasks
like the channel itself calls the actual quest handle methods
you subscribe to a channel
the channel knows what tasks it has
Still looping, but less loops over all since it's not forced to loop through everything which is the important part
so its only looping through the ones that want that event
yeah its the minimal loops required
Exactly, and we're only dealing w/ the bukkit event system the minimal amount of times too (i.e. once)
yes
Over kill? Probably, but probably the best way to do this in general, especially if wanting to throw extra stuff on top of it too
Does .damage deal true damage?
its not overkill
especially if you planned for those other custom things too that will use the same system
ye. cause achievements and stuff just have to sub to a quest_completed and stuff
If not how can i deal true damage ignoring armor?
also supports data-driven quests too, since you can just have a
{
"name": "10 Kills",
"data": {
"channel", "kills"
"amount": 10
}
}
or something
which is less messier than some of the impl's I've seen <.<
Decent component system should also make the actual task stuff less of a bitch to handle too
@Override
public void receive(String channel, QuestProgressUpdateMessage message) {
boolean areAnyIncomplete = false;
for (QuestComponent component : tasks.get(channel)) {
if (!component.check(message.getPlayer(), message)) {
areAnyIncomplete = true;
break;
}
}
isComplete = !areAnyIncomplete;
}
being a rough idea on how it would be handled in the quest itself
I'm use serializer but doesn't work. I send it to the chat, it works, but inventory as a resource pack does not work either.
This is where I'm at currently @pseudo hazel https://paste.md-5.net/cuyacotejo.java.
Just need to think of a good way to handle the QuestComponent class and it's fine lol
The messages will likely just extend a Message class or something
currently they're implemented as such:
public class KillQuestComponent implements QuestComponent {
private final EntityType targetType;
private int currentKills;
private final int targetKills;
public KillQuestComponent(EntityType targetType, int targetKills) {
this.targetType = targetType;
this.targetKills = targetKills;
}
@Override
public void update(Object data) {
if (data instanceof EntityType && data == targetType) {currentKills++;}
}
@Override
public boolean isCompleted() {return currentKills >= targetKills;}
}
Which, isn't necessarily a bad way of doing it
Hey everyone.
If I try to join I get the "failed to connect to a default or fallback Server" Incorrectly Firewall bla bla...
(Cant send screenshots here)
hi , i have a problem with player join before the data is loaded
how i get the used item for click on inventoryclickevent?
i have this load method :
not sure if this is the best way to do it :
before it send me to lobby i was in sw-0 server , and i had 2 kills , 2 wins ..
but i went back to lobby server
it say 1 kills , 1 wins ..
its saved in database π
Actually. No. It falls apart for stuff like brewing π€
show your method where you update value
what message?
"If I try to join I get the "failed to connect to a default or fallback Server" Incorrectly Firewall bla bla..." that message
Can I use PrepareItemCraftEvent to change the item displayed as the result?
Would it maybe fix the problem if we deactivate the firewall?
yes
well you need to figure out what you configured wrong. The IP? the servers up? the port?
Also #help-server
All i see is getRecipie and getInventory, which should I use?
getInventory.setResult presumably
Would I just set the slot to the item, and then use the other event to give it?
sure
Any ideas on how to impl this to make supporting things like brewing possible π€
kills, blocked mined, currency, stuff like that's easy to implement...
Not so much something like Brewing where multiple things are involved e.g. potion type, amount of potions, etc
I would probably pass something other than an object
Some sort of data holder class that contains whatever you need
Yea, the issue is cleanly implementing the data holder class though to support every possible event π
or doing it in a way to allow extends or implements
Make an interface and have them all implement it
Failed to transform vineyard-core-1.0.0-SNAPSHOT.jar to match attributes {artifactType=classpath-entry-snapshot, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for ClasspathEntrySnapshotTransform: /run/media/miles/bca4a4ee-9b9b-4a0b-8cf1-4244950351a6/Coding/CabernetMC/Vineyard/vineyard-core/build/libs/vineyard-core-1.0.0-SNAPSHOT.jar.
> Check failed```
Wtf did I do
not being good enough
clearly
duh
get good
You know the even funner part @young knoll? More concerned about actually getting it to work that I forgot to take into account per-player stuff KEK
Guess <player_name>-<something> for each channel name is an option, or I shove the player name somewhere else lol
maybe Player#getPubSubSystem, but that's got its own issues e.g. quests
Would help if I had source code to look at as a reference for this lmfao
sorry about that, wrong chat
I'll have to re-visit this at a later point, it seems π
hey! ive just updated my spigot version to 1.21 and now all my enums through bukkit arent working (specifically material, chatcolour and entity type), is there something obvious that i missed that couldve made this happen?
Update your intellij
Is it possible to combine ItemsAdder and Oraxen?
Is it possible to not cross post??? So many questions but not many answers :*(
Anyone able to help me out? I am having troubles with data being deleted from an onInventoryClick event
or well I am not to sure why it is happening
?nocode
Itβs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
not sure what to give
I'll give what classes are probably causing the problem
https://paste.md-5.net/magowilosa.java
Alright so I am having the problem where when I collect the coins being saved it deletes data in my players.yml
The only way to prevent it, is if I reload the plugin after redeeming the generator
Youβre gonna have to pinpoint it and break down the issue more programmatically for us
What coins are you collecting, what data is being deleted?
Give some context on the plugin
any why are you doing it all in one class-
Hes not
oh it was just merged
into 1 file
i see it now
while im here is it possible to get an unloaded world using bukkit api? I know i can check if a directory exists but i was wondering if it was doable with bukkit
Like get data from it?
no just see if it exists
Or just see if it exists
Alright so, the coin generation class is generating coins off of my config.yml which has the tiers data. So it gets put into the collectoritem to save/store it for the player to collect when they want to. So after a player clicks on the collectors item from the GUI it deletes
generators:
tierMythic: 1
and replaces it with
coins: 51000
coins:
tiers: # You can add as many tiers as you'd like!
Common:
interval: 1 # seconds
coins: 1000
name: "&a&lCOMMON &2&lCOIN &a&lGENERATOR &7(Redeem)"
slot: 10
lore:
No dont think so
i will stick to if (!new File(folder).exists()) then
surely new File in a condition doesnt actually make the file (i forget)
No it doesnt
ok cool beans
I hope what I gave you helps
painful
yay it works
context: im making a 'ready out of the box' bedwars plugin and to do that im creating and deleting worlds for the maps because its more efficient than using subservers, so i just wanna make sure i dont delete maps that dont exist
Where are you setting the coins in config
You mean how many coins are to be generated?
or what are you talking about
public void setCoins(Player player, long amount) {
String uuid = player.getUniqueId().toString();
long maxCoins = 1_000_000_000_000L; // 1 trillion
// Cap the amount to 1 trillion
amount = Math.min(amount, maxCoins);
playerStorageConfig.set("players." + uuid + ".coins", amount);
savePlayerData();
}
public void addCoins(Player player, int amount) {
int currentCoins = getCoins(player);
int newCoins = currentCoins + amount;
int maxCoins = 1_000_000_000; // 1 billion
// Cap the new amount to 1 billion
newCoins = Math.min(newCoins, maxCoins);
setCoins(player, newCoins);
plugin.getServer().getPluginManager().callEvent(new GivePlayerCoins(player, amount));
}
it does
there is a wrapper for inventories
Is there a workaround for InventoryAction.MOVE_TO_OTHER_INVENTORY event.getCurrentItem() returning Air and not the clicked Item
If theres a bug, why not open a bug report
Not sure if it is a bug or me using the wrong method lol
someone can help me? i want to get the helmetmeta attribute and add to the hatmeta? java if (helmetMeta != null && helmetMeta.hasAttributeModifiers()) { helmetMeta.getAttributeModifiers().forEach((attribute, modifier) -> { hatMeta.addAttributeModifier(attribute, new AttributeModifier(modifier.getName(), modifier.getAmount(), modifier.getOperation())); }); } ERROR: Required type:
net.minecraft.world.entity.ai.attributes.AttributeModifier.Operation
Provided:
org.bukkit.attribute.AttributeModifier.Operation
so what can i do?
i imported this: import net.minecraft.world.entity.ai.attributes.AttributeModifier;
Yeah that's the wrong import
Why did you import that
whats the import?
oh i got it
thank you!
waite
why this it not working? ```java
ItemStack customHat = new ItemStack(Material.PAPER);
ItemMeta hatMeta = customHat.getItemMeta();
hatMeta.setDisplayName(displayName);
if (helmetMeta != null && helmetMeta.hasAttributeModifiers()) {
helmetMeta.getAttributeModifiers().forEach((attribute, modifier) -> {
hatMeta.addAttributeModifier(attribute, new AttributeModifier(modifier.getName(), modifier.getAmount(), modifier.getOperation()));
});
}```
i want to get the helmetmeta attribute and add to the hatmeta
Ok 1) what is helmetmeta; 2) what exactly is not working
if (event.getClick().isLeftClick()) {
ItemStack currentHelmet = player.getInventory().getHelmet();
if (currentHelmet != null && isHelmetType(currentHelmet.getType())) {
Helmet.put(player.getName(), currentHelmet);
ItemMeta helmetMeta = currentHelmet.getItemMeta();
ItemStack customHat = new ItemStack(Material.PAPER);
ItemMeta hatMeta = customHat.getItemMeta();
hatMeta.setDisplayName(displayName);
if (helmetMeta != null && helmetMeta.hasAttributeModifiers()) {
helmetMeta.getAttributeModifiers().forEach((attribute, modifier) -> {
hatMeta.addAttributeModifier(attribute, new AttributeModifier(modifier.getName(), modifier.getAmount(), modifier.getOperation()));
});
}
customHat.setItemMeta(hatMeta);
player.getInventory().setHelmet(customHat);
}```
i want to get the helmet attribute and add it to the hatMeta
GENERIC_ATTRIBUTE_ARMOR
Hi, is there a mΓ©thode to put player in limbo ?
so you can help me please?
can you set the result of a command so it sends the usage message? (using CommandPreprocessEvent)
someone can help me?
No, as the event is fired before the command actually performs
ah
@sullen marlin you can help me?
this is the save method :
this is the load
damn you're reminding me of why i should never use raw sql queries
hi! someone can help me? i want to get the helmet attribute and add it to the hatMeta
GENERIC_ATTRIBUTE_ARMOR ```java
if (event.getClick().isLeftClick()) {
ItemStack currentHelmet = player.getInventory().getHelmet();
if (currentHelmet != null && isHelmetType(currentHelmet.getType())) {
Helmet.put(player.getName(), currentHelmet);
ItemMeta helmetMeta = currentHelmet.getItemMeta();
ItemStack customHat = new ItemStack(Material.PAPER);
ItemMeta hatMeta = customHat.getItemMeta();
hatMeta.setDisplayName(displayName);
if (helmetMeta != null && helmetMeta.hasAttributeModifiers()) {
helmetMeta.getAttributeModifiers().forEach((attribute, modifier) -> {
hatMeta.addAttributeModifier(attribute, new AttributeModifier(modifier.getName(), modifier.getAmount(), modifier.getOperation()));
});
}
customHat.setItemMeta(hatMeta);
player.getInventory().setHelmet(customHat);
}```
what are you using then?
i can use mongodb , but i would love to have another option π
i use supabase which has a kotlin client where i just pass in records / get records from the db as it uses a builtin serialiser
this is my problem ..
does it save , load data?
where does it save it
oh nvm , so how i can fix this?
what is not working
i didnt got GENERATIC_ATTRIBUTE_ARMOR on the paper
put debug
where?
okey
Hi, is possible to put client un loading screen. (And client can again send packet like break block or it will be blocked?)
so this? if (helmetMeta != null && helmetMeta.hasAttributeModifiers()) { helmetMeta.getAttributeModifiers().forEach((attribute, modifier) -> { player.sendMessage("test"); hatMeta.addAttributeModifier(attribute, new AttributeModifier(modifier.getName(), modifier.getAmount(), modifier.getOperation())); }); }
sure, but maybe you could print something useful like the variables
it dont sending me the message
so it seems like helmetMeta has no attribute modifiers then
how did you make the helmet?
if (event.getClick().isLeftClick()) {
ItemStack currentHelmet = player.getInventory().getHelmet();
if (currentHelmet != null && isHelmetType(currentHelmet.getType())) {
Helmet.put(player.getName(), currentHelmet);
ItemMeta helmetMeta = currentHelmet.getItemMeta();```
whats on the players helmet
what attributes did you put on the helmet
i didnt put everyting
well then of course the code won't add anything...
oh how can i do to get the armor on the paper
declaration: package: org.bukkit, enum: Material
currentHelmet.getType().getDefaultAttributeModifiers(EquipmentSlot.HEAD)
go from there
if (helmetMeta != null && helmetMeta.hasAttributeModifiers()) {
currentHelmet.getType().getDefaultAttributeModifiers(EquipmentSlot.HEAD).forEach((attribute, modifier) -> {
player.sendMessage("test");
hatMeta.addAttributeModifier(attribute, new AttributeModifier(modifier.getName(), modifier.getAmount(), modifier.getOperation()));
});
}```
@sullen marlin its not working
why?
set meta back ig?
this is what iam trying to make :
in game server , when a player kill someone for example or win a game .. etc , it will increase the [local stats for the SWUser instane] by 1 , and when a game end before sending the users of the game to the lobby server , the game moudle plugin will save the data to the global stats in mysql server and when a player is loaded in the lobby server moudle plugin , it will load the data with the new kills and other data .
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
i did , but it does not work , the load part in lobby it loads the old data and not the new one
?paste
i didnt got GENERATIC_ATTRIBUTE_ARMOR on the paper
well you should remove the if statement for starters
Well you are not updating the cache, when inserting a new value, and reading from cache when loading, that is why you might get mismatched result
its not inside 1 server , its 2 servers :
- game.jar
- lobby.jar
..
i was able to fix it i guess ,
i created a map with uuid , SkyUser and when a user join a game in the game server it will add him to the map , and when the game end before sending the user i do this :
its saving , loading correctly now π
but iam not sure if this is the best soulation π
also the game server gonna restart after each game ends ..
should BookMeta#getPages() and BookMeta#getPage() return plaintext or text component data?
docs are not very descriptive; docs of setPage() say it expects the data for the page, but the getters do not specify
Strings are text
BaseComponent are components
ok thx then i need to reconsider how to open a "virtual" book for a player
?
trying to have a book open for a player after they ran a command; and the book should contain clickable interactions such as executing internal commands and page changes, kind of like a menu
declaration: package: org.bukkit.inventory.meta, interface: BookMeta, class: Spigot
it seems like this has changed recently, i am targetting spigot 1.18.2 and upwards
and i can only see page related setters and getters that accept or return strings
ohh i think i understand now
I don't think this changed recently
if you say, it didnt, i wouldnt know; i was just a bit dumb. thank you very much, i got the right direction now
Hello, I am completely new to plugin making and I need to update my plugin to 1.21, how do I do this in my IDE? (using Intellij IDEA)
Do I have to create a new project and import my classes into it or do I somehow update the old one?
(Ping if you respond)
Are you using maven or gradle?
How are you importing spigot api
why would you have two storage classes to save user data?
one for solo stats and another for double stats?
ik i can do them both in 1 table
but i wanted to orgnized it π
Can you change the custom name location of an armor stand? Because when I set the marker ON the custom name is below the base plate.
maven
Only with marker
actually; i think i might be doing it wrong still; i'm initializing the book like this ```java
var stack = new ItemStack(Material.WRITTEN_BOOK, 1);
var meta = (BookMeta) stack.getItemMeta();
meta.setTitle("Interactive Book");
meta.setAuthor("kaleidox");
meta.spigot().setPages(...)
opening it with `getServer().getPlayer(playerId).openBook(stack)`
but all thats showing up to me is a book that says nothing but \* invalid book tag *;
Do you put the meta back on the book?
getItemMeta always returns a clone, so you are editing a copy
migrated everything to a new computer and now i am getting this error in my pom
Change the spigot api version to 1.21 and fix errors and warnings
its pulse
Revolutionary
How can i deal true damage (ignoring armor)
set the health
dont set attacker or just remove health
okay, thanks
doesnt portion of harming do true damage?
Is there a simple method to create ItemMeta for an item that doesn't exist yet?
Using a Map<String, ItemMeta>, I want to to apply the meta to a new itemstack whenever I want to give the player a new itemstack.
Or am I overcomplicating things too much and can I just create a new itemstack from another itemstack template?
What exactly are you trying to achieve
sounds like you want an item builder
Consumer<ItemMeta> or something
Yeah, I think that's kind of what I'm after.
Or even better Supplier<ItemStack>
you could try using Bukkit.getItemFactory().getItemMeta(Material mat)
I'm trying to make recipe that require 8 diamond block in one slot for example, how can I do that?
Can I apply my own meta to that? Like custom name, CustomModelData?
I assume so
With a custom crafting table ig
and then set it to a stack
this is from the docs
so you just need to know the material
Alright, thanks!
but there is proably some range as to which stacks you can apply it
What do you mean custom crafting table?
I'm trying to create a recipe
you cant make a recipe where a slot takes multiple items
Apparently RecipeChoice.ExactChoice doesn't count the item amount.
there is no vanilla way this is done either
Oh damn, so I have to listen to the crafting event?
I guess so
Damn, that is hella complicated.
Do you know any library that does that by any chance?
no idk
all I know is that its probably possible
but the way that everyone else has solved it is to create intermediate items
like compressed diamond block for example
...or a custom crafting table
Just to be sure, don't all items have CustomModelData?
Not air
All other items are fine then, right?
Yes
Hi , anyone know how i can do the locked , unlocked , active for cosmetics?
what do i need?
maps ? for CosmeticUser correct? data should be saved somewhere i suppose?
What is this in relation to
A lib?
does anyone know how i can make my maven profile show the console for my server which i am starting in a new cmd window like a normal server would instead of showing it in my terminal
<configuration>
<workingDirectory>${testserver.path}</workingDirectory>
<executable>cmd.exe</executable>
<arguments>
<argument>/C</argument>
<argument>java</argument>
<argument>-Xmx4G</argument>
<argument>-Xms4G</argument>
<argument>-jar</argument>
<argument>server.jar</argument>
<argument>nogui</argument>
</arguments>
</configuration>
run maven from another cmd, not inside of intellij
there is maybe option for ij to open new terminal
no creating my own plugin ..
I have changed plugin.yml
name: OmVeins
version: '${project.version}'
main: me.mmg.omveins.OmVeins
api-version: 1.21
authors: [ MMG ]
description: Plugin for Om Nom Lands SMP
and pom.xml
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
But I dont think the api updated
is there some refresh I need to do<
?
I am not used to working with maven, most of my previous projects were pure java
ah
got it
there was a refresh button
I was blind
maven is just a build system
Yeah I managed to update it
however now I ran into a different problem
if(item.getType() == Material.DIAMOND_PICKAXE)```
Material got deprecated right?
Not yet. You shouldn't worry about it being deprecated
I cant import it tho
If you're using IntelliJ you may just have to refresh your cache
how do I do that?
Unsure. I'm not an IJ user :p I'm sure someone else knows
update IJ
oh that might be it
you are running an old af version taht cannot read java 21 class files
I completely forgot its old
Youve given us close to no context
wft!
choco uses eclipse
I want to switch back to VSC but they really need to mature their java plugin more
vsc ew
just use vim
Does anyone know a easy way for making a creeper fearing you like as a cat + running away?
could anyone help me with a custom inventory
explain what you mean by custom inventory
i want to make a blank slot looked like that
is that kind of custom model data or what?
that's a resource pack
oh... yeah so that stuff is actually pretty easy
its just a resource pack and you insert it as the inventory title
β¨ fonts β¨
you can use negative space fonts to adjust the texture
i just launched https://fonts.radsteve.net, will add custom inventories soonβ’ :D
You could also use an item with a custom texture for the blank slots
That's less ideal though then you'd need to somehow convince the client the item is their but not enough so there is no tooltip. Considering the tooltip is client side I don't think that's even possible
yea
There is an item component for that
to get rid of the hover effect?
yep
since when
wtf what is it
1.20.5
oh
it only exist in 1.20.5 right
thanks for the info, time to update my menus xD
wow that's fucking awesome
yes
It's one of the best components
but how do you hide the highlight from the item when your cursor moves over it
oh custom background is on top of the effect too
yea
nice
Hi, I have a question a bout bungeecord, when you teleport a player to another server, it sends him a pluginmessage telling him to change servor? so a customer can theoretically choose to change server without the proxy having asked him to?
bungee doesn;t send teh client a message, its a proxy so it just moves teh connection
so the client can't change server by himself
Ye, the proxy changes where your connection is going, the client doesnt reconnect to a diff ip or so
Unless, the user can send Messages in a plugin messaging channel no
the client can ask to change but the proxy handles everything
and how does it work that when you try to connect to an ip without going through the proxy, the connection is refused. How does the server detect that the client isn't going through bungeecord?
there shoudl be no direct route to a server
ah the proxy acts as a mirror between client and server?
and redriect all requests
It basically manages your conenctions
to be honest i'm not sure to understand. Is the client directly connected or is it connected to the proxy, which in turn is connected to the server?
client is connected through the proxy
the proxy decides which server your packets go to
ah yes that's why ban ip doesn't work with bungeecord
but why we need plugin messages to interract between proxy/server if the proxy is directly connected on the server, it can't send message directly?
how is it going to "send a message" without plugin messaging?
just sending directly his packets to the server, but with plugin message if I remember, the proxy send packet to the client then the client send it to the server
sorry I probably misunderstood something
what you said makes no sense
teh proxy handles ALL packets between client and servers
plugin messaging allows a server to issue commands to the proxy
The client has no say in any of it.
ah okay
I'd heard that plugin messages were sent via the client (schema: proxy -> client -> server)
but it doesn't make sense
teh client never sees any plugin messaging
its only between the proxy and servers
there IS a client plugin messaging channel
but its only used to send info from the client, like what mods its using
that is not true
plugin message, or rather custom payload packet, goes both ways, C2S and S2C
it was added by mojang for mods to communicate between server and client without breaking the protocol
https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/#what-is-a-plugin-message
says that message plugins go from server to client for mods. I misunderstood this and thought it was also the case for plugins (it don't have sense) sorry
Yes its a simplification but it's accurate for his purposes
the proxy just so happens to be a man in the middle and you can use that to communicate with it
okay thanks
I understand
it also reminds me that to send a message plugin you must have a player connected. why can't we without? (please don't simplify)
there are two ways to send a message. via the server or a player
one has a backing queue
so if no players are online the messages will be kept and sent once a player joins
I do not know how long they will be kept though
to actually send a message it requires a player connection, ask Mojang why they designed it that way
Its probably for simplicity
as requiring a player connection means any authentication has already been performed
Mojang have no proxies so have no need to send a PMC message to/from a server with no players on
we could send messages without the players, but the mojang protocol means that you can't?
If you send a message with no players, where is it going to go? There are no connections to send over
You arent sending the message to the proxy directly.
You are sending it towards the player, and the proxy just happens to sit between the server and the player,
meaning the proxy intercepts the packet and uses it.
I want to quickly help one lucky person out
(I haven't done spigot in over a year)
yes me
I need to confirm that every even number greater than two is the sum of two primes
can you send me like 6000$
(in Minecraft/
can you tell me about the meta theory of symmetric metaprogramming?
is this one of those one million dollar problems
can you find my will to live
:clueless:
Scratch my back
share some with me
now that's a real challenge
clearly somebody has actually proper priorities here
anyway @halcyon hemlock choose one
now thats some reasonable request
these are surely some interesting questions
6000$ you say
I wonder how people with bmi over 30 scratch their backs
Like bears in teh woods π
damn what is happening kekw
whats your internet speed?
deutschland π₯
LMAO
lmao
okay but do an actual speed test
instead of what your adapter can actually do
because my wifi card could also do 1gbit on an ancient laptop
o wait
nice
seoul
ok developed country citizen
i moved to south korea
i don't live there
what
dont live in seoul
yea
Is it possible to check if a placed block is custom using PDCs?
just get it and check it?
I could've sworn I put "placed" in my message, apparently I didn't.
wdym
blocks themselves dont have pdcs
you can save data in the chunk or use a library that implemented this for you
Oh chunks can have this too? That's good to know, thanks!
yes chunks have pdc afaik
everything you see here has pdc
Should I just use the in-chunk coordinates as the key then?
everybody that implements (or extends idk) PersistentDataHolder, can have pdc
basically this
?blockpdc uses chunks' pdc to do what you want
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
interface = implement for classes, extend for interfaces
abstract = always extend
yeahi know that lmao i don't remember if PDH is an interface or class
I currently live in Daegu
it's a pretty good place tbh
safe and people are nice
does this answer my question
my internet is fine but sometimes it decides to suck ass
basically everything bukkit is an interface
if its a class you shouldnt extend it
facts
While the Bukkit API makes every effort to ensure stability, this is not guaranteed, especially across major versions. In particular the following is a (incomplete) list of things that are not API.
Implementing interfaces. The Bukkit API is designed to only be implemented by server software. Unless a class/interface is obviously designed for extension (eg BukkitRunnable), or explicitly marked as such, it should not be implemented by plugins. Although this can sometimes work, it is not guaranteed to do so and resulting bugs will be disregarded.
Constructing inbuilt events. Although backwards compatibility is attempted where possible, it is sometimes not possible to add new fields to events without breaking existing constructors. To ensure that the API continues to evolve, event constructors are therefore not plugin API.
Implementation classes. Concrete implementation classes packaged with Bukkit (eg those beginning with Simple) are not API. You should access them via their interfaces instead.
lmao
pakistan?
yea
i see
is there a way to force a plugin to load classes from its own source over builtin sources?
i'm facing a situation where i'm trying to run antlr 4.13 but minecraft exports 4.9 which fsr gets precedence over the v4.13 classes i include
antlr? I don;t recognise that as a packaged dependency
hmm then it seems like it might be included in the software i use for testing (because i will personally depend on compatibility to it); arclight
Yeah I looked its nothing to do with Spigot
that kinda didnt answer the question though; its there a way to take precedence for a set of classes in the internal classloaders?
if its provided by a lib you use its unlikely
as that lib is written for that version and will be loaded with that lib
i am including the classes in a shadowjar
they are still being overridden by "defaults"
if you are shading then you would have to specifically exclude that older version and include the one you want instead
i dont ship the old version
you do or it would not "override" your version
it looks like it is being included by server.jar and thus takes precedence over the classes i ship
spigot does not ship antlr
re
You can look in your bundler folder (on your server) to see what is shipped with it
sorry, what "bundler folder"?
on your server, spigot creates a bundler folder
well at this point i assume that is something that arclight does not, as i dont see such folder
which takes the problem out of context for this place
still i'm not sure if i could simply create a custom classloader for my plugin for example
Unlikely to work. It will use whatever version is loaded first on teh class path
now for instance; i was able to solve the problem by downgrading hibernate (and affiliates), which on v6 depends on antlr 4.13, to versions that can work with antlr 4.9; ```groovy
implementation 'org.hibernate:hibernate-core:5.6.0.Final'
implementation 'org.jboss:jandex:2.4.5.Final'
implementation 'com.zaxxer:HikariCP:4.0.3'
how long does "Post resource update" take to show up on the plugin page?
if its an existing plugin, instantly
are you logged in with 2fa?
yeah
Hi, I meet all the conditions to post a premium plugin but I can't select premium when adding a resource. I have 200 messages, 20 positive ratings and 3 free resources.
and 2fa is activated
I joined spigot in 2015
oh nvm, it works now
i dont know what i did differently
thanks tho
Internet pixies
yea
also
when i download my own plugin from the page does it count towards downloads?
I should hope not
yeah
i asked because i wanted to know if the number of downloads were 14 different people downloading or just me testing my plugin
If I pass a map to a function as a parameter, it will still reference the same map, right?
yes
Remember java is pass by value
Suppose I want to slow down the growth rate of wheat by 32x, would it be sufficient to simply add a random check each BlockGrowEvent which gives the wheat a 1/(32/getMaximumAge) chance of successfully growing to the next stage?
is there any way to get if the server is connected to a proxy?
use plugin messaging and ask the proxy for server info.
if it responds you are on a proxy
is it possible to get if player is connected?
from a spigot plugin
I've read a resource, but still doubting
you may be better off posting this on the Spigot Plugin Development forum and waiting for help there, this seems like a decently complex problem that many people would just skip and it'd be lost in this chat again
makeSureValueIsntTooLowOrTooHigh
mojank moment
check the switch decompiled for setOwner in arrows... that thing is...
i'm not even gonna look at it
https://prnt.sc/WU3Ue5TfOjxd
https://prnt.sc/Mu_mZDHRTcSU
https://prnt.sc/raJ4jgPd8_bA
What do I do? I would like to go through all the blocks of the plot
but plot.getarea.getregionabs returns null
late
yeah if you pass null crash too :3
ref: https://hub.spigotmc.org/jira/browse/SPIGOT-7751
https://prnt.sc/WU3Ue5TfOjxd
https://prnt.sc/Mu_mZDHRTcSU
https://prnt.sc/raJ4jgPd8_bA
What do I do? I would like to go through all the blocks of the plot
but plot#getarea#getregionabs returns null
i would like to go through all the blocks of the plot
how then?
because this not is the real coordinates of the plot
Any possibility to load plugin which is not extended by JavaPlugin?
Overwrite PluginClassLoader so it dont check if Plugin is instanceof JavaPlugin?
Depends on what the data if it's simple boolean or String, no
If you store objects here that are big and in many PDC, yees
No
Why don't you use Intellij Profiler to check that on your own?
Or simple for loop that does this operation 10000 times XD
And check benchmark
What a stupid question fr
https://paste.md-5.net/yujusebeqi.java Would something like this work?
Hello Im looking for some help on how I would make (As its now classed as) faked custom encahnts
So I want it so when I click say Emerald with the Name "Smelter" on it on too a pickaxe it adds "Smelter I" to the pickaxe
lore and removes the Emerald out the users Invin
You can do that with PDC
Like what would be the best method of going about this ?
isplayerconnected is not a message bungee will understand
however
why?
Uh
are you tryign to check if a player connected via the proxy or direct?
I'm trying to create a placeholder that says if a player is connected
get teh player list
and placeholder can't be used in a proxy so I'm trying to do this in a spigot plugin
Wdym?
either player list of the server
but i need the list of the network
what?
that will tell you ALL online players
This will tell you what server a player is on, IF connected https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/#getserver
oh nvm
!pastbin
?paste
Does this only return one server?
depends, did you ask for ALL or a specific server?
I think i'm doing it wrong
what code did you use to request the list?
also yes you are doing it wrong
That's all xd
I'll read the resources better
?paste
Is there a clean way to convert a pdc to a string for debugging?
https://paste.md-5.net/yijelelihe.java
So, when someone is muted they can bypass the mute for some odd reason and I have no clue why Could someone help me please
I see nothing in there about muting
So I'm a new Plugin Developer, and I have started making new plugins made by me. I made this one earlier, but I want to add colours like &6&lQuickRTP β€ You have been teleported to a random location in the world
However, at the moment it is not showing any colours and is just plain white like this:
Wait I can't even upload files nvm
Alr
I'm sorry, is this the way?
I don't understand it too much mb
oh wait, that's not the correct subchannel
you seem to have lost the plot
Yea, i don't really understand it
you are writing in a read message
@delicate lynx https://pastecode.io/s/w4g4256g
are chunk's plugin tickets persistent?
no
thats sad
and do they only apply to one chunk?
or does it apply to surrounding chunks as well
Can you not add pdc values to a crafting recipe output?
to the recipe itself or the result item
result
How can I check in game if it works?
https://paste.md-5.net/oguhamonun.java @delicate lynx here's a better link
Apparently not.
Guess I'll have to find the source of the issue then.
@wide coyote can you help me sir?
Does the pdc get lost if you use generated from the ItemFactory?
I think i got it now xd
Is that?
does it work, is the answer
I would have to set a bungee server ;-;
I'll try but idk
@robust ginkgo How do I create a .yml file in Intellij?
idk I never used it for non-java stuff
this is for java stuff...
Okay? I don't know?
my bad
people still creating bukkitrunnables instead of using the scheduler π₯Ί
file -> new?
that's... just an icon
dw
bruh
it works :)
anyone know why this is occuring?
intellij could be on mushrooms
how the hell i could understand that bruh
check that the package exists
fr
if it does, invalidate caches and restart
how?
though sometimes you can just erase a character and put it back and it works again
how do i check if it exists π
yes...
lol
for example this DeathEvent is of me.nameless.events.DeathEvent
yeah not gonna glaze it you kinda are
yes
jk you'll get there with experience
It's literally me. not com.
i thought it didnt make a difference
thanks though @icy beacon @rapid vigil @dark moth
@icy beacon
i'd rather you don't do tjhat
can we do animations with plugins ?
idk?
oh
fym by animations
well then
this is a very broad term
If you call removing and item and placing it back using a repeating task an animation then yes
no like
emoting and stuff
you might want to move to forge/fabric
and custommodeldata
oh nah
i actually tried them before
and it was nice
but uhh
so hard to do
Open that project and ctrl c ctrl v :P
XD
alr ima go crazy with armorstands im ngl
ima try to do cutscenes (dont mind if i ask 5000 questions)
its a good boy sigma skibidinalist man faced pou
whats wrong with that
tf is wrong with my pfp
ik lol
anyone having issues importing org.bukkit.Sound and org.bukkit.Material in spigotapi? im using the shaded jar
and the classes are in the archive of the shaded jar
update intellij
didn't work. on most recent update rn, same issue
can i dm u with a screenshot
its so weird
def the strangest bug ive ever seen
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
test
@remote swallow
its specifically enums i think, because SoundCategory works fine
same for SoundGroup
You are on latest IJ?
2024.x=
yep
and your project is configured to use java 21?
java 17
ill change that

hello guys, this is my code and I have the following problem, when I am trying to apply enchants from config.yml file like this
private ItemStack createDropItem(Map<?, ?> dropConfig) {
try {
String itemType = (String) dropConfig.get("item");
Material material = Material.valueOf(itemType.toUpperCase());
ItemStack item = new ItemStack(material);
String itemName = (String) dropConfig.get("name");
if (itemName != null) {
ItemMeta meta = item.getItemMeta();
if (meta != null) {
meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', itemName));
item.setItemMeta(meta); // Set meta before adding enchantments
}
}
List<Map<?, ?>> enchantmentsConfig = (List<Map<?, ?>>) dropConfig.get("enchantments");
if (enchantmentsConfig != null) {
for (Map<?, ?> enchantmentConfig : enchantmentsConfig) {
Enchantment enchantment = Enchantment.getByName(((String) enchantmentConfig.get("type")).toUpperCase());
int level = ((Number) enchantmentConfig.get("level")).intValue();
if (enchantment != null) {
item.addUnsafeEnchantment(enchantment, level); // Add enchantments after setting meta
} else {
plugin.getLogger().warning("Invalid enchantment type: " + enchantmentConfig.get("type"));
}
}
}
return item;
} catch (Exception e) {
plugin.getLogger().severe("Error creating drop item: " + e.getMessage());
return null;
}
}
and this is my config.yml:
default:
spawn-world: world
entities:
- type: ZOMBIE
baby: true
name: "&aGivi"
x: 2000
y: 88
z: 100
interval: 10
damage_multiplier: 10.0
max_health_multiplier: 2.0
drop_chance: 0.5
drop:
material: "DIAMOND_SWORD"
name: "&bGivi's Blade"
enchantments:
- type: "SHARPNESS"
level: 5
- type: "UNBREAKING"
level: 3
equipment:
helmet: "IRON_HELMET"
chestplate: "IRON_CHESTPLATE"
leggings: "IRON_LEGGINGS"
boots: "IRON_BOOTS"
main_hand: "IRON_SWORD"
off_hand: "SHIELD"
the problem is that when I have more than 1 enchant in my enchanments section, no enchant gets applied to the item, but when I have only 1, it gets applied
I don't understand the reason why would it happen, I am using for loop and each enchant is applied individually
could you give me a hand to figure out the problem cause?
theres getList btw
what do you mean
config.getList
bukkit configs are the reason i started using ktx.serial (+kaml)
toml π€
so you are saying that problem is in the retrieveing the config?
glad someone agrees
can i use supported plugin names in title
like XYZ | itemsadder Support
ping me with response please
if you are talking about on your Spigot page. Its best to add them to the page contents not teh title
i mean ye but it kinda improves reach
Hi
I got this error
in bungeecord
Non [a-z0-9/_-] character in path of location: lcipling
and i saw manu people use ti
*many
Any know what is?
well you could if it helps a search result. There is no rule against it
cool
don;t use spaces in names/paths
But my name is "battledoor"
i dont know because the error
?paste the full error
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
yeah don;t use :
legacy:lclping ?
thats what your error says
I'm betting you modified your MOTD with color codes and didn't wrap it in ' '
let me see it
motd: |-
&bβ€ &lTyxer Network &r&7[ 1.7 - 1.8.9 ] &bβ€&r&r
&aβ€ &a&lSOTW&r&f starts &r&a&lTomorrow&r &fat&r &a&l12:00 &aβ
i have this
?paste your full file
of course
Feel free to redact sensitive info
yeah its yoru motd
I think motds have to use the Unicode format donβt they?
put ' either side of it
At least for most special symbols.
How would it be corrected?
put a ' at the beginning and the end
like this?
motd: ' |-
&bβ€ &lTyxer Network &r&7[ 1.7 - 1.8.9 ] &bβ€&r&r
&aβ€ &a&lSOTW&r&f starts &r&a&lTomorrow&r &fat&r &a&l12:00 &aβ'
yes
let me try it
like this?
motd: ''' |-
&bβ€ &lTyxer Network &r&7[ 1.7 - 1.8.9 ] &bβ€&r&r
&aβ€ &a&lSOTW&r&f starts &r&a&lTomorrow&r &fat&r &a&l12:00 &aβ'''
oh
only one ' at beginning and end
ok
of each
Also, this is how I put it? https://prnt.sc/uUFfnju2Tfho
try it
Yaml multiplies strings are weird like that.
same error
`enforce_secure_profile: false
server_connect_timeout: 5000
listeners:
- bind_local_address: true
force_default_server: true
forced_hosts:
pvp.md-5.net: pvp
host: 0.0.0.0:25565
max_players: 1500
motd: ' |- &bβ€ &lTyxer Network &r&7[ 1.7 - 1.8.9 ] &bβ€&r&r &aβ€ &a&lSOTW&r&f starts
&r&a&lTomorrow&r &fat&r &a&l12:00 &aβ'
ping_passthrough: false
priorities:- lobby
proxy_protocol: false
query_enabled: true
query_port: 25565
tab_list: GLOBAL_PING
tab_size: 60
remote_ping_cache: -1
network_compression_threshold: 256
permissions:
admin: - bungeecord.command.alert
- bungeecord.command.end
- bungeecord.command.ip
- bungeecord.command.reload
- bungeecord.command.kick
- staffchat.talk
- staffchat.read
- staffchat.toggle
- staffchat.mute
- ab.all
default: - bungeecord.command.server
- bungeecord.command.list
- bungecore.command.lobby
- auth.lobby
log_pings: true
connection_throttle_limit: 3
prevent_proxy_connections: false
timeout: 30000
player_limit: -1
ip_forward: true
groups:
NotForokad: - admin
remote_ping_timeout: 5000
connection_throttle: 4000
log_commands: false
stats: 10f5676b-78a9-4649-afc9-ee869b3c93e2
online_mode: false
forge_support: false
disabled_commands:
- lobby
- disabledcommandhere
servers:
hcf:
address:
motd: ' |- &bβ€ &lTyxer Network &r&7[ 1.7 - 1.8.9 ] &bβ€&r&r &aβ€ &a&lSOTW&r&f starts
&r&a&lTomorrow&r &fat&r &a&l12:00 &aβ'
restricted: true
lobby:
address:
motd: ' |- &bβ€ &lTyxer Network &r&7[ 1.7 - 1.8.9 ] &bβ€&r&r &aβ€ &a&lSOTW&r&f starts
&r&a&lTomorrow&r &fat&r &a&l12:00 &aβ'
restricted: true`
Then you likely have to use the Unicode string format for the symbol.
then use " instead of '
it will be one or the other
let me try
i will try deleting the motd
i only putting like "a"
same error
with the motd in "a"
are you restartign bungee after editing the config?
yea
Find the right syntax for your YAML multiline strings.
?
Give that a read to make sure you have the right syntax.
Cause thereβs two ways to do multiline strings.
Also, try the Unicode syntax.
Is this error when you try to join a server?
Yeaa
is it the lobby?
I already tried
No error in the console
of the bungee
and the lobby
the HCF is disconnected
then the error is likely propogating from the lobby server
no clue then
idk
does legacy:lc|ping mean nothing to you?
i deleted config file
But did you actually restart?
yea
You typed end into the bungeecord console?
i only stopped it}
Wdym by stopped?
i on pterodactyl
Ah, ok
the error is from your lobby server
AquaCore.jar
bungee-1.0-SNAPSHOT.jar
DynamicBungeeAuth-10.30B.jar
NODConnect.jar
SkinsRestorer.jar
But only lobby
works
without bungeecord
Is the lobby server set to be a bungeecord server?
oh i look this in the lobby server
Hi i have problem with bedwars, when someone dies, it disconnects them from the game and puts them on mainlobby and the game ends (he had bed)
how i can send code?
?paste
?codeblock
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
in the lobby server
i try deleting viaversion?
I'd start with no plugins and build up
Please im trying solve it 2 days
?paste
What am i suppossed to do :DD
Sounds like a question for #help-server
it is for me lol
Oh sorry im new :3
https://paste.md-5.net/fixaworaca.java
So I am using LiteBans for the proxy plugin but when I do [item] it does nothing and so when I put LiteBans and the item plugin on the same server. It works fine. Is there a way to fix this?
same error :(
yea but i look this rn
[20:09:21] [Server thread/INFO]: #------------------- Chest Commands Errors -------------------#
[20:09:21] [Server thread/INFO]: 1) The item "wool" used to open the menu "example.yml" is invalid: invalid material "wool"
[20:09:21] [Server thread/INFO]: #-------------------------------------------------------------#
I think thats is the error
nope is the error 100% of bungeecord
@eternal oxide
what version do u using?
1.19.5
:( i cant fix it
I'd wipe everything and start with a fresh setup
I dounbt its a bungee error if you cleared your motd
its more likely an error passed through from the lobby
I've no idea what flamecord is
bungeecord remake like this
throw it away and use bungee
firewall, ipban , idk
if it works with bungee
Why are you typing here when this is a server. issue.. not development...
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
Same applies for bungeecord
Go to their discord
not here
Now... can someone assist me please.
https://paste.md-5.net/fixaworaca.java
So I am using LiteBans for the proxy plugin but when I do [item] it does nothing and so when I put LiteBans and the item plugin on the same server. It works fine. Is there a way to fix this?
you need that somebody puts [item] in the chat and put the item?
That is not my error...
but this is the code
Yeah but not my problem
"So I am using LiteBans for the proxy plugin but when I do [item] it does nothing and so when I put LiteBans and the item plugin on the same server. It works fine. Is there a way to fix this?"
You gave it your best LMAO
I appreciate you for giving me another plugin. But I am creating my own
Thank You