#help-development
1 messages · Page 1317 of 1
Because I dont have it
Its for my machines plugin
So a Machine mines the block, using a pickaxe in its inventory
nms.ItemStack
public float getDestroySpeed(BlockState state) {
return this.getItem().getDestroySpeed(this, state);
}
i'd really just rerun the numbers from the wiki though, it's not really worth hooking into nms for just a multiplication and division or whatever the equation was
ofc paper have it...
on paper you could probably also get it directly from the Tool component, maybe spigot has something similar
but i don't remember if spigot lets you get item components from the item prototype itself, iirc it might only be the itemmeta
But how can I use that value? I want it to be diffrent from block to block
i mean, aren't you using paper api anyway given you asked in the paper discord?
you use it against the block's hardness
I thougt I did
then I saw my project used spigot api 💀
How? Do I just multiply the values?
Minecraft or spigot wiki?
Hmm, but Coal and Diamond for example have the same "hardness" by default, so I cant really use the hardness method, at least the one material has
if the tool isn't suitable, you multiply by 30 or something
See the calculation section of the wiki page
It contains all the psudocode you need
But why has iron and diamond the same hardness?
because someone decided that they should?
They break at the same speed if thats what you're wondering about
It takes way longer for me to mine coal ore then diamond ore
what pickaxe are you using
wood
So then it just returns the hand value instead
”mining speed for block determined by the tool item component”, how do I get that?
declaration: package: org.bukkit.inventory.meta.components, interface: ToolComponent
the two ores have the same hardness but the difference is that a wood pickaxe is not a suitable tool for diamond ore, so the breaking time is multiplied by 30 or something
^ see wiki
I'm trying to use Entity#setPersistent(false) so that entities with it will be removed when their chunk is unloaded or when the server restarts. It seems to work well so far with the caveat that if you go behind a wall and can't see the entities then wait for a few minutes, when you walk around, all of the mobs despawned.
This is an issue because I load them back again when a player loads the chunk again.
Is there any easy way to fix this or should I just slap on a PDC for the impersistent entities and kill them on disable/enable?
this doesn't remove when the server restarts
I tried it before
oh wait nvm
I see what you mean now
Why can't I cancel PlayerArmorChangeEvent? I'm trying to stop players from changing their armor by right clicking with an armor item in main hand.
there isn't an PlayerArmorChangeEvent afaik
oh wait thats paper
Use the interact event then
someone please help, i have a jobs gui menu with images etc . how i install the gui on the server please help.
Any idea why the client would hard crash with a SetPassengers packet 🤔
entity ids are fine
poorly constructed packet?
I'm debating if I need to unmount an entity before mounting it for somebody else
my logs basically print
A holds [B]
B holds [C]
C holds [D]
D holds [E]
E holds [24]
Player holds [24]
Player holds [24]
Player holds [A]
What if I need to say that E holds [] before saying that player holds 24
otherwise 24 shares 2 parents?
I dunno if the client unmounts it or not
Especially in 1.20.4
yeahhhh
what does it say in log
some stackoverflow
but in packet events, protocol version is used to write named tags
in the read as well
so i have a custom item called soul charm and dont think i did it right the custommodeldata is 20001
public ItemStack createCharm() {
ItemStack charm = new ItemStack(material, 1);
ItemMeta meta = charm.getItemMeta();
if (meta != null) {
meta.setDisplayName(displayName);
if (!lore.isEmpty()) {
meta.setLore(lore);
}
if (customModelData > 0) {
meta.setCustomModelData(customModelData);
}
meta.getPersistentDataContainer().set(charmKey, PersistentDataType.BYTE, (byte) 1);
if (glowEffect) {
meta.addEnchant(org.bukkit.enchantments.Enchantment.LURE, 1, true);
}
charm.setItemMeta(meta);
}
return charm;
}
what're you trying to do
Help me with protocolLib
creating a virtual enchanting table with spefific levels
manager.updateHologramIfExists(hologram, ctx -> {
});
I don't understand what the handler should contain
You're using custom model data in an old way
use ItemMeta#setItemModel instead
This directly references an item model definition, there you just reference your custom model
no need to override any vanilla items models or item model definitions
ooh okay
i think there is a method somewhere to enchant an item with a specific seed and levels, you could use that to generate the offers
ItemFactory::enchantWithLevels
not sure where you'd get the player's enchanting seed however
whats weird is that offer can have only one enchantment
event tho a table gives multiple at times
The offer is just the enchantment and cost.
Enchanting table provides 3 offers. It’s not weird
Can any1 help me with this?
you'd have to listen to them clicking on the button and then apply the other enchantments yourself; the enchantment table only reveals one enchantment, even if there are multiple
turns out just setting the offer cost makes the game give out good enchants
and the hint enchantment
has anyone made a 1:1 earth map with like a custom world generator that pulls satellite imagery from google maps
youd have to squish it way down in the y level
i think the current max supported world height is 1024 blocks
a kilometer tall ought to be good enough if we flatten the mountains a bit, not like we need to go to the earth's core
mmm
and also the earth is a globe so it would be an approximation like a map
then there's the oceans
yes like 20km deep ocean
something i've thought about in the context of earth map before are different projections to keep the dimensions roughly accurate, mercator is ass
i forget what it was called but there was one that split the globe into triangles and unfolded it in such a way that the disjoint borders were over oceans
yeah thats probably your best bet
if each triangle were to be its own world, we could have the oceans be 1 kilometer deep and the mountains 1 kilometer tall, as long as we don't have a mountain and an ocean on the same triangle
this one i think
a cuboctahedron projection
🤡
update the compass logic a bit to point to north and rewrite dynmap to remap it back to a sphere
all the landmasses are contiguous so unless players try to swim across the atlantic, nobody would notice
2048 iirc
Can go to +-1024 on the Y axis
Nope it’s +-2032
So around 4000 blocks
yeees
yeah and then map y = 0 to sea level
And then cry because of the performance
Did yall know
The new "beginner" level to programming is not being able to sort arrays
And it's just knowing OOP
i blame python
democratization of anything always leads to that anything turning to absolute shit for everyone involved
Nah, it was something else
Someone said I was "unfit" for being a developer cause I asked if scripts were allowed in their roblox game
Asked them if they knew programming
Got to know this 😭
If that's the case, I might as well apply on Hypixel
if you think about it, roblox is also the democratization of game development
Lua
and again everything has turned to shit for everyone involved
Python 2.0
@ Choco, I'm joining in next buddy
Oh wait this is the development channel
mb
Excuse me sir
Is it possible to convert a while loop into a for loop
you always see artists getting mad about generative ai and about how i can write "picture of a cat, pixel art, masterpiece" in a text box and it shits me a picture and i can go "i made the art for my game"
but i never see anyone complaining about that same artist writing "import game, import numpy" and writing 3 lines of code and going "i made a game"
I forgot about while loops
both are just abstractions for the same jump instructions
depends on how you define "convert"
e.g. decompilers frequently "convert" for loops into while (true) loops with a break somewhere in them, simply because from the bytecode you can't really tell which is which
For is just while + abstraction for the iterator
And java has even more
The enhanced for loop
goto, goto_w, if_acmpeq, if_acmpne, if_icmpeq, if_icmpge, if_icmpgt, if_icmple, if_icmplt, if_icmpne, ifeq, ifge, ifgt, ifle, iflt, ifne, ifnonnull, ifnull
these instructions are your typical ones for loops. While it is true that most for loops can be written as while loops and thus end up with essentially the same bytecode, it would not be accurate to say that a while and for loop are indeed the same as the ordering of instructions are indeed different between the two when you can not order the for loop as a while loop. Also, we are forgetting try/catches and if statements being mixed in. Typically what you see in a for loop is that once it is done with whatever code in the middle, it usually has an instruction to go to the end of the loop, not always the case but typical in how some are setup. Where as in a while loop you don't have that and instead you have a break instruction to exit the while loop.
that is probably the most you will get in terms of identifying which loop you are dealing with but don't always exist for the for loop which is fine because it just means it can be a while loop just fine lol
modern compilers can definitely tell the difference between while, do while, indexed for and for-each loops
try-finally is also a very fun one if you have multiple exit points!
compilers sure, decompilers however not quite
it depends if the compiler changed its structure or not or removed key identifiers
er, meant to say decompilers
vineflower definitely can and that's basically the only one i care about
as was stated, at times the compiler can sometimes change a for loop to instrinsically the same as that of a while loop in terms of ordering bytecode. Also, not sure if we are assuming there is no metadata or other types of data being removed or not.
the dynmap rewrite could be called dynmapixon
fortunately, the way fernflower, and by extension vineflower, works does not rely on the exact sequence of bytecode instructions to generate java code, which is what decompilers before fernflower used to do and break with almost every update
there's a whole blogpost about its history by jetbrains when its creator passed and it's explained pretty well, although the focus of the blogpost is not exactly the technical details of how the decompiler works
yeah
u just write for instead of while duhh
I no longer have the source code of one of my plugins, so naturally I go to decompile it like I have done a few times before. I forget the program I used before, but as soon as you supply the bukkit API it decompiled no problem. As I forget the program I have tried half a dozen decompilers and they all fail. Vineflower comes the closest to succeeding when I supply the bukkit API, but still fails in the end. Then there are like half of the decompilers that don't allow you to supply reference libraries and fail miserably.
Anyone have a goto decompiler, or is Vineflower pretty much it?
define "fail"
afaik VF can just decompile without having to add any libraries or anything? no?
I’ve never had to supply a library
If the bytecode says org.bukkit.Bukkit.broadcastMessage is being called, then it’s being called, even if it doesn’t exist in context
yeah lol
It was having trouble with switch statements on bukkit.material, then there was something in my event listener class that caused an internal error
One of my classes there is a huge commented block that just says failed to decompile even with the lib
I believe the switch would be compiled to switch on the Enum#ordinal
You mean int codes instead? That's what it did without the lib but the range was incorrect...
What was the range?
It was like 16000, but there are only a couple hundred materials AFAIK
I have a version behind up on github, super annoying to figure out what I updated in the last version, but not the end of the world
Was just hoping it would be an easy decompile. The decompiler that worked last time was some kind of GUI
wellll, not really, it works in a way that is based on the name, so that if the enum entries are reordered, existing compiled code will still work regardless of the ordinal changes
I duno, it was red squiggled in my IDE
Apparently it generates a synthetic runtime class that maps ordinals to each switch case
Here's my plugin if you guys feel like giving it a try decompiling it:
https://www.spigotmc.org/resources/portal-stones.51806/

It's really no biggie though, I had a support request where the guy screen shared on Discord. He was getting all kinds of errors in the console and the plugin didn't work properly, then he rebooted the server and everything worked fine...
I haven't had to update in like 4 years, but one of these new versions is bound to break something.
Does anyone know what I can use to have hologram leaderboards, something like decent holograms or fancy holograms?, up to 1.21
or some way to achieve it, dholo doesn't work and fholo too, or I must be doing something wrong, but the placeholders look like ---
Holograms are just armor stands.
or, nowadays TextDisplay
declaration: package: org.bukkit.entity, interface: TextDisplay
in the end you always have the option to fix errors which occurred in decompiling manually (if they are something small) ofc that wouldnt work with the class you mentioned which failed entirely
Does textdisplay work with placeholders?
placeholders aren't a minecraft concept, no thing in minecraft directly works with placeholders
with the exception of like translatable and score components, but that's not what you mean
how placeholders work is that a plugin pre-processes the text and injects the placeholders, and then sets the text display, armor stand, or whatever else to display that text
if you are making a plugin and want to use placecholders, its up to you to use the placeholder api and implement that functionality
besides @p @e @a etc
that'd be the selector component yes
What's the best way to store data for both simple and complex plugins?
whats a simple plugin and whats a complex one?
what type of data are you storing
Simple: /home system plugin. You'd be storing specific locations a player sets.
Advanced: Player Levelling System, Specific attributes, etc. As well as things created ingame through a GUI, that would change the config of a plugin.
configs can be in a config format like yml or json (in a flatfile) no?
^^ configs through yml and the playerdata in a database like sqlite or mysql
Yes But I'm saying if I wished to create a plugin which incorporated an ingame GUI editor
and then for the other bits, usually storing it through NoSQL like mongo or something is fine
you can go with SQL
Most servers have access to a MySQL compatible DB like MariaDB
and for those that don't you can use SQLite
but like, thats if u're actually gonna use what SQL will offer u, if u're just storing and loading data blobs, mongo is somewhat nicer
That's true but you need to bundle the drivers and stuff
especially if you're adding new things seeing as what you're coding might be somewhat of a growing rpg?
yea fair
Nothing stops you from having a gui to edit configs saved in a flatfile
^
How the data is stored isn't relevant to how it's used once it's in memory
What is relevant is your indexing of that data; how does one piece of data relate to another? Do you have to find samples of data by say, a timestamp, or are they tied to a block location? Sql and databases allow for very robust ways of finding which data to get into memory and when, but that is only tangentially related to ingame guis or anything of the like
but then you gotta edit in game only
wdym exactly by flatfile
Or be super extra and make a file watcher
Or txt if you want to be fancy
Yeah placeholders are just strings that you match and replace yourself.
One question. Where is the user data like the inventories in the server?
in the playerdata directory under the main world directory
i.e. world/playerdata by default
I looked at that and its all matrix, I cannot tell what I looking at. I just trying to push the inventory and data to another player
it's compressed nbt
if you want to move all the data of one player to another player, simply rename the first player's file to replace the second player's file
while the server is offline
if you need to do anything more complicated, open both files in an nbt editor and do what you need to do
for doing it programmatically, which i assume you're looking for since this is the dev channel, you can use a nbt library or nms
Minecraft servers are being super annoying. I just trying to move the player data from the paid account to the cracked account. The servers are offline it shows on my end
yeah mojang servers are down again
I NOT asking for help with piracy, just with the player data move. Just want to make that clear
You know what nbt editor I can use for this?
just rename the file if you want to transfer all data
Also, the messages are sending slower. The internet, I might see what is happening. Hard to tell
Maybe my connection?WARNING: [youtube] ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')). Retrying (1/3)...
Thanks, that worked
HOLY SHISH
yoooooooooooo
epic stuff
but since we already got all the names basically does it matter much
It does matter, it helps a lot that the mappings are there at runtime
No more compiling and remapping the same code for each version
I don't really do that so idk
Makes reflection easier too
maybe if it improves startup time that would be cool
yeah if I ever do NMS reflection it'll prob be nice
🤔
I mean that really depends on hardware and plugins obviously
rn for me its like 20-25s
huh what are you running on
ryzen 5600x NVMe storage
im on 1.21.10 paper, I think most of startup time is the plugins
yeah ik
well 5600G if you want to be specific
but my game is nothing like vanilla so yeah
never heard it called that
The 5600X doesn't have integrated graphics the 5600G does
same
no more obfuscation?
oh joyous day
no more remapping
damn I actually might have to redo some of the stuff I was doing from scratch since I'll hopefully barely even need any reflections
ngl 1.21 has been a big W
custom items
dialogs
no more obfuscation
uh
idk if we got new attributes now but I only started using some of the weirder ones now
I wonder if they're looking at roblox and slowly starting to wonder if they should be more like that
Enchantments have been feeling weak lately. Attributes are the way!
What event i need listen to for stone cutter actions?
just inventory click event
Hello, I’m creating a Python script that automatically generates word filters. However, after trying many different approaches, I haven’t been able to find a filter that supports RGB or hex colors.
For example, “cow”:
(?<![A-Za-z0-9§])((?:§[a-f0-9x])*(?:§[a-f0-9x])*[ccççćĉċč](?:§[a-f0-9x])*(?:[\s._@%":;()¿?=!&/\^*_\-<>]*)?(?:§[a-f0-9x])*[oo0òóôöõōōǒŏȯőȫ](?:§[a-f0-9x])*(?:[\s._@%":;()¿?=!&/\^*_\-<>]*)?(?:§[a-f0-9x])*[wwŵẁẃẅ](?:§[a-f0-9x])*(?:[\s._@%":;()¿?=!&/\^*_\-<>]*)?(?:§[a-f0-9x])*)(?![A-Za-z0-9§]), x
The word gets filtered correctly but it doesn’t work on regex101. What could be the reason?
FilterGenerator: https://github.com/SparkCry/FilterGenerator.git
There are different regex standards
python has it's own things
what flavour are you testing against
Why not filter against raw messages
With formatting stripped
And you can use some kind of algorithm
To match words
Since it’s easier to create a script in Python, the idea is to have it automatically generate the filters, saving the effort of formatting each one manually
I tried several approaches, but the plugins I tested don’t correctly filter messages containing color formatting
Fully strip out the color formatting then
oh you're not making a plugin but configuring one I guess ok
It’s not a plugin, 😅 it’s a script that generates word filters with support for hexadecimal color formatting
Ok and how do you intend to use the filters then
python raaargh
In plugins that use regex filters, blocked words only work correctly when the message has a single color code. When the text includes multiple colors (for example, rainbow text), the filters are ignored entirely, allowing players to bypass restrictions for insults, domains, and similar content.
Guess I just wasted time making a GIF, only to realize I can’t even share it here 😅
- (\b.?cow), horse
- c o w( s )?, horse
- co[00]+w, horse
- planet.?minecraft,another dimension
- pmc,another dimension
- ((\d+\.){3}\d+),another dimension
This type of formatting allows users to easily circumvent the filters.
#cow
- (?<![A-Za-z0-9§])([§a-f0-9x]*[cCçÇ????][§a-f0-9x]*[\s._@%":;()¿?=!&/\^*_\-<>]*?[§a-f0-9x]*[oO0òóôöõø??????][§a-f0-9x]*[\s._@%":;()¿?=!&/\^*_\-<>]*?[§a-f0-9x]*[wW????][§a-f0-9x]*[\s._@%":;()¿?=!&/\^*_\-<>]*?[§a-f0-9x]*)(?![A-Za-z0-9§]), x
This format successfully blocks rainbow-style hexadecimal colors, but it still doesn’t block IP addresses, domains, or server names when using this method.
I’m still new to this, so please bear with me 😅. If there’s already a platform, plugin, or script that supports this format, I’d really appreciate it — I’ve been spending the whole day trying to make it block IPs, domains, and servers properly.
pattern.matcher(PlainTextComponentSerializer.plainText().serialize(component))
strip all color and formatting before trying to match anything
also that regex is unintelligible, you ought to use metacharacters like \w instead of [a-zA-Z0-9]
personally though i gave up on regex anti-advertising filters and use text embeddings based classification instead
remind me again, is it a guarantee that from a YamlConfiguration freshly loaded from a file/string (i.e. there haven't been any put's with e.g. ConfigurationSerializable objects), calling getValues(true) will return a map consisting purely of string keys, and primitive/list/map values?
in other words, there won't be some random Location object there eagerly deserialized already?
no, tagged entries (==: org.bukkit.Location or however that is typed) are mapped during deserialization/loading
uh is that a "no there won't be locations" or "no there will be locations"
looks like the latter
very annoying, is there a way to disable it? do i need to load it in manually though snakeyaml?
yeah "no it's no a guarantee"
uhhhhhhh probably? i know that a "vanilla" snakeyaml mapper does not use the ==: key for object-mapped entries, that's something bukkit configures, so i think it would be a regular string -> string entry in the map where the key is "=="
but that YamlConstructor is the thing that is passed to the yaml library so it does the things
right, ty 👍
How do you hide this in spawner?
I've tried Hide additional tooltip but it doesn't work
My guess is you are not using Spigot. Other platforms require additional actiosn to block it
nope I'm using spigot
public static ItemStack getSpawner(String name,int price){
ItemStack i = new ItemStack(Material.SPAWNER);
ItemMeta m = i.getItemMeta();
ArrayList<String> lore = new ArrayList<>();
m.setDisplayName(messageManager.translateHexColorCodes(name));
m.setLore(lore);
i.setItemMeta(m);
return i;
}
I don;t see you hiding anything there
yeah removed the line
never knew it existed honetly
good to know
I'll try it
Give https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ItemFlag.html#HIDE_BLOCK_ENTITY_DATA a try
declaration: package: org.bukkit.inventory, enum: ItemFlag
hide tooltip will entirely remove the tooltip which you probably don't want
ah yeah
I'm using 1.21.8
That still exists in .8?
declaration: package: org.bukkit.inventory, enum: ItemFlag
Then you are not on 1.21.8
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
I'll try refreshing maven
yeah it worked
I'll try the hide block
Yeah it works
thanks
java```
ItemStack oldHelmet;
if (chosen.getInventory().getHelmet() != null) {
oldHelmet = chosen.getInventory().getHelmet();
} else {
oldHelmet = null;
}
if (oldHelmet != null) {
chosen.getInventory().remove(oldHelmet);
}
ItemStack pumpkin = new ItemStack(Material.CARVED_PUMPKIN);
pumpkin.addEnchantment(Enchantment.BINDING_CURSE, 1);
chosen.getInventory().setHelmet(pumpkin);
new BukkitRunnable() {
@Override
public void run() {
chosen.getInventory().remove(pumpkin);
if (oldHelmet != null) {
chosen.getInventory().setHelmet(oldHelmet);
opposingRed.remove(chosen);
}
}
}.runTaskLater(UwpCTF.getInstance(), 200);
I cant get this to work and I am unsure why. I think its silently falling our or nulling somewhere but I am unsure what the cause is. I get no issues in console
I did see a 1 in the binding curse, but changing that to 0 also didnt do anything to affect the behavior
The punpkin isnt appearing. The helments are not getting removed either, which is interesting
is the code running?
you better go catch it then!
I figured it out. It was in a for loop that I intended to end sooner, but for a bunch of code that shouldn't have been contained in it was in the for loop due to a bad }. Whats odd about it is there were no exceptions and not a obvious issue lwith everything else. Oh well, its fixed
Just a heads up those remove methods might remove more items than you intended
you're better off not using remove
does that mean I should just replace it with air or something? or you're saying I should not remove it in the first place... I guess so yeah, I added that in when I was having the issues to see what would happen but it would just replace itself with the pumpkin
You're already overwriting the item in the helmet slot
Hey, I'm running maven package from github actions for a 1.8.8 plugin(don't start a useless debate) and getting this error, how can I fix it?
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
Error: Failed to execute goal on project: Could not resolve dependencies for project
Error: dependency: net.md-5:bungeecord-chat:jar:1.8-SNAPSHOT (provided)
Error: Could not find artifact net.md-5:bungeecord-chat:jar:1.8-SNAPSHOT in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
Error: Could not find artifact net.md-5:bungeecord-chat:jar:1.8-SNAPSHOT in sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots)
pom.xml:
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Find another repo it is hosted in
and how am I supposed to do that?
🤷🏽♂️ It’s an old version
I understand, but isn't it weird that the spigot api is available while bungee chat isn't? maybe I'm missing something here
Bungee chat used to be hosted on sonatype
The path on the nexus has to be /content/groups/public not the current content path
Worked! I took the repository url from https://www.spigotmc.org/wiki/spigot-maven/
maybe a small message about legacy versions can be added
It's a wiki, you could add it 😉
oh, I had no idea. I will 🙂
Thank you!
Could probably just change the url, the reasons for using /snapshots are no longer applicable anyway
well I just discovered that it's impossible, because I had requested the deletion of my account so according to the rules I can't make a new one.
Hopefully a random reader here will do this.
Hi!
I'm collaborating with a friend of mine who is a very qualified builder (can send qualifications if interested) - I'm an avid worldbuilder. We're planning on starting a youtube building series (with the help of his already very notable youtube friends), and to make those builds into part of an mmorpg minecraft server - if anyone wants to collaborate with us on our passion project, please let me know or ask for more details! :D
To be sure, this is not a post advertising for free labour or anything of the sort - it's only for fun for the both of us, and there are no speed expectations/pressure/deadlines. It's purely a passion project and if it takes off, then that would be great.
reads a lot like advertising
otherwise if it wasn't why would you point out how popular your friend is, or how qualified another person is at building
and that you are doing a youtube series
How is this ad that claims to not be an ad related to here?
Idrk, it was to inspire some faith in the project I suppose
There's no problem with the intention, it's just not the correct place
Its not done/made with the ultimate intention of monetisation
This is a programming help channel
That's still an ad lol
and im sorry, i assumed it meant help for programming and I guess this is technically a form of asking for a programmer's help
are you looking for a programmer?
I guess? I assumed an ad was if it was explicitly for some monetary gain - I guess it does read like one
yep
I mean my friend is learning java rn to help out and there are some interested people, i wanted to establish a small friendgroup who could nerd out and work on a collaborative creative project for fun
well, it's still not the correct place, this channel is for getting helping in developing plugins. I think the website has a hiring forum
?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/
Ah crap now I look like im asking for free labor ;( its very weird to find a way to say things without it being assumed to be one way or the other
Ill check it out ;D
Sorry guys :(
All good, everyone makes mistakes 🙂
Would it be okay if my friend who is learning java, to come and ask for someone's help regarding it?
yeah, this specific channel is exactly the place
Ohh yeah okay - my original understanding was that, but I didn't realise that asking for a programmer to do something vs help with something was distinct
tytyty ill stop bothering you
No bothering at all, without questions we would stay dumb xD
Have him come here and ask for help with whatever he needs help with
anyone experienced with rabbitmq?
this is my code roughly
channel.queueDeclare(COMMAND_QUEUE, true, false, false, null);
commandListener = new CommandListener();
channel.basicConsume(COMMAND_QUEUE, true, commandListener, tag -> {});
and the listener is just DeliverCallback impl
i have multiple servers running with this exact code, basically what the system does is it publishes a command like so
plugin.getChannel().basicPublish("", COMMAND_QUEUE, null, message.getBytes(StandardCharsets.UTF_8));
then executes with the listener above
the issue im having is, it seems to not work consistently, some deliveries are lost (i feel like its going round-robin on the consumers), what could be the issue?
the above part is in onEnable, the below is inside a commandexecutor
all consumers should get the message
Sorry if this has been asked, didn't see it. Is it possible for ItemMeta#setItemModel to fallback to the vanilla texture if the client doesn't have the resource pack? It's showing the purple/black missing texture right now. Or do I just need to use the old method of CustomModelData?
Helloo, good afternon its been such a long time. I would like to know how JDBC transactions are done, because i cant understand them. I just know that for making a transaction you have to reuse the same Connectio. Because if not the transaction is done in a different context from the other. Right? Could someone lnk me to an example please
This JDBC Java tutorial describes how to use JDBC API to create, insert into, update, and query tables. You will also learn how to use simple and prepared statements, stored procedures and perform transactions
as in like the client completely missing the pack?
is this aqua fog effect still possible in 1.21.10? https://www.spigotmc.org/resources/prodigysky.86542/
yes
how?
ye but i cant seem to render it near the player without turning down render distance
i want it to be closer like this
rather than this
i mean the fog is controlled by the client, no?
specifically based on render distance
there are some things that can add fog, like the bossbar and the blindness potion effect, but i'm not 100% if they use the biome color
blindness definitely doesn't
I'm looking for someone who will update the resource pack from version 1.21.1 to 1.21.4 Minecraft
bossbar is pretty much the same as environment fog
that'd be worth a try, if you don't mind there being a bossbar
yeah but i already have environment fog, what im trying to do is make it render closer to the player
you can't
at least not to my knowledge; fog exists purely to hide the render distance, "fog thickness" isn't a biome feature
what you can do is send the player a lower server render distance based on the biome they are in, but i maybe foresee that running into issues with the client not retaining chunks correctly
and any time the render distance is changed, all chunks get re-rendered, so it would look pretty janky on the client
1.21.11 I will have a feature to control the fog parameters :D
neat
that'll be nice for immersive bogs and swamps and suchlike
mayhaps underground dungeons as well
i have no idea but i sort of suspect you have to listen to the craftercraftevent or whatever it is, check the recipe, and cancel it
did you confirm that your code actually reaches the setCancelled part? like other than just eyeballing it and figuring that it should work
shove a sysout there and see if it fires
throw more sysouts at it until you figure where your assumptions about it break down
e.g. at the very start to see if the event fires at all (and to sanity check the listener is registered)
it sounds dumb but unless you're plugging the server into a debugger, the answer to "why doesn't it work" is almost always to throw more sysouts at it
shouldn't it be itemtype?
since its inventory
declaration: package: org.bukkit.inventory, interface: ItemType
how do you get the file name without extension
no regex, I think it should be possible with Path but i just cant figure it out
use split, extension is technically part of the name
then extension is unknown and is just a file. windows hides extensions for appearances but its still there
Use event.getResult not recipe. Mace recipe may be complex
ohh thats nice, where can i see the planned parameters?
Change list for 1.21.11 on the minecraft wiki
ok thanks
It's still biome params, but you can change biomes around the player on the fly
I'm gonna scoot over to PaperMC's discord help server :)
Hello everyone, joined the discord because my IDE is always being mysterious about why my program doesn't work. This code works:
import java.util.List;
import java.util.UUID;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeModifier;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.EquipmentSlotGroup;
import org.bukkit.inventory.ItemRarity;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.components.CustomModelDataComponent;
public class ItemHandler {
public static ItemStack fancy_sword;
public static void init() {
createFancySword();
}
private static void createFancySword() {
ItemStack item = new ItemStack(Material.STONE_SWORD, 1);
ItemMeta meta = item.getItemMeta();
meta.setItemName("Fancy Sword");
item.setItemMeta(meta);
fancy_sword = item;
}
}```
But when I try to add attribute modifiers it doesn't (it still compiles, but the command I use to give me the item doesn't do anything):
```private static void createFancySword() {
ItemStack item = new ItemStack(Material.STONE_SWORD, 1);
ItemMeta meta = item.getItemMeta();
meta.setItemName("Fancy Sword");
meta.addAttributeModifier(Attribute.ATTACK_DAMAGE, new AttributeModifier(NamespacedKey.minecraft("ATTACK_DAMAGE"),1.0, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlotGroup.MAINHAND));
meta.addAttributeModifier(Attribute.MOVEMENT_SPEED, new AttributeModifier(NamespacedKey.minecraft("MOVEMENT_SPEED"),1.0, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlotGroup.MAINHAND));
item.setItemMeta(meta);
fancy_sword = item;
}```
I'm using spigot-api version 1.21.10-R0.1-20251027.210814-6.
Was just gonna say
I did that, it still doesn't work :(
do /paper dumpitem while holding the item
or if you're not on paper, put it in a chest and then do uh
f3+ something to copy the tile entity data
and see if the meta is getting applied
f3+i
i can't get the item, the command doesn't work when I add attribute modifiers(i haven't added a recipe, but I doubt it would work)
check the console and see if there's an error
hi guys
i was wondering why this is not setting the player's gamemode as intended
but other code i put in here to test like message sending works
String[] ignoreGroups = {"jailed", "experiment", "spectator", "helper", "admin", "player"};
for (String group : ignoreGroups) {
if (player.hasPermission("group." + group)) {
LoggerUtil.debug("Player " + player.getName() + " has permission group." + group + ". Ignoring promote.");
// Schedule gamemode change for next tick since player isn't fully loaded yet
Bukkit.getScheduler().runTask(plugin, () -> {
player.setGameMode(GameMode.SURVIVAL);
LoggerUtil.debug("Set gamemode to SURVIVAL for " + player.getName());
});
return;
}
}
originally i just tried to setGameMode without the scheduler but i thought maybe it was because the player just joined
the greater function is here
@EventHandler
public void onPlayerLogin(PlayerLoginEvent event) {
Player player = event.getPlayer();
LoggerUtil.debug("Player " + player.getName() + " is logging in.");
if (!player.isWhitelisted()) {
LoggerUtil.debug("Player " + player.getName() + " is not whitelisted. Ignoring promote.");
return;
}
String[] ignoreGroups = {"jailed", "experiment", "spectator", "helper", "admin", "player"};
for (String group : ignoreGroups) {
if (player.hasPermission("group." + group)) {
LoggerUtil.debug("Player " + player.getName() + " has permission group." + group + ". Ignoring promote.");
// Schedule gamemode change for next tick since player isn't fully loaded yet
Bukkit.getScheduler().runTask(plugin, () -> {
player.setGameMode(GameMode.SURVIVAL);
LoggerUtil.debug("Set gamemode to SURVIVAL for " + player.getName());
});
return;
}
}
There is this error, do you know what it means?
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:218) ~[guava-33.3.1-jre.jar:?]
at org.bukkit.NamespacedKey.<init>(NamespacedKey.java:85) ~[spigot-api-1.21.8-R0.1-SNAPSHOT.jar:?]
at org.bukkit.NamespacedKey.minecraft(NamespacedKey.java:177) ~[spigot-api-1.21.8-R0.1-SNAPSHOT.jar:?]
at com.github.spitelessness.items.ItemHandler.createWitherBrand(ItemHandler.java:33) ~[?:?]
at com.github.spitelessness.items.ItemHandler.init(ItemHandler.java:23) ~[?:?]
at com.github.spitelessness.App.onEnable(App.java:16) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:267) ~[spigot-api-1.21.8-R0.1-SNAPSHOT.jar:?]```
what's on line 16 of App.java?
in the onEnable method
at com.github.spitelessness.App.onEnable(App.java:16)
follow the call here to ItemHandler line 23 and ItemHandler line 33
ItemHandler.init();
something you are doing there is trying to construct an invalid NamespacedKey
you're passing it ATTACK_DAMAGE when it only accepts letters a-z, numbers 0-9, forward slashes, periods, underscores, and dashes
java.lang.IllegalArgumentException: Invalid key. Must be [a-z0-9/._-]: ATTACK_DAMAGE
I didn't do UUID.randomKey() because I want the tooltip to show up as green (base attribute instead of blue modified attribute)
i have no idea what you're talking about
What should I do instead of NamespacedKey.minecraft("ATTACK_DAMAGE")?
you need to provide a valid namespaced key
one that consists of the letters a through z, digits 0 through 9, periods, underscores, forward slashes, and dashes
yours has uppercase letters which is not valid
so the first thing i'd try is making it lowercase
it's very hard to give any useful help when i can't see the code
either way, try with a lowercase key
namespaced keys cannot have capital letters in them
bump if anyone knows
try PlayerJoinEvent instead of login
login happens much earlier than join and i'm pretty sure it could be more than just 1 tick until the player is actually physically in the world
Thanks, I got the item working, but it has blue attributes, whereas I want it to have green attributes.
i honestly don't know how to make them green
basically in between login and join there is the entire configuration stage, where the server sends datapacks and registries and a bunch of other things to the client to "configure" the clientside state; this can take multiple ticks
the join event fires directly before or maybe after, i don't quite remember, the player is added into the world
Good evening, I wanted to ask how to set the name tag, not before the name, but the whole name tag.
no clue what you mean but maybe Player::setDisplayName
The function doesn't set the entire name tag.
I want to be able to set the entire name tag.
Don’t think you can easily change the name tag for players
what's the name tag
Other than the hacky method of attaching another entity as a passenger
the text over a player's head?
Yes
yes
get a plugin that does the hacky shit for you i suppose
Alternatively mess with NMS and PlayerProfile
Which plugin can handle that?
i know TAB does it but that's not really the main point of the plugin
i mostly notice it as an undesired side-effect
i'm sure there are many plugins for it though, perhaps ask in #help-server where the server admins frequent, or try googling a bit
How do I get the item meta / item name of a dropped item? I have an event handler to cancel EntityCombustEvent, but I don't know how to check if it's the specific item I want.
idk
I understood everything except cast to item. What do you put after event.getEntity()?
Would this work?
if (item.getItemMeta().getItemName() == "Item Name") {
event.setCancelled(true);
}```
No you need to cast to Item first, not ItemStack
despair
Do you know java?
Somewhat,but I started learning spigot a few days ago.
You also shouldn't use == on strings, use . equals
A bit more advanced, but you should use Persistent Data Container to mark your custom items. Technically someone could just give any item the same name as your custom one with an anvil...
PDC is satanic black magic. if it didnt exist in 1.7.3, dont use it
I thought anvils only changed display name, not item name?
Is this better?
if (item.getItemStack().getItemMeta().getCustomModelDataComponent().getStrings().get(1).equals("uc")) {
event.setCancelled(true);
}```
Looks like it would work to me
Yes
Add an instance of Item before casting to not error when other items combust
Probably also want to check there are model data/strings
And java starts indexing at 0
wdym
What happens to your code if something other than an item combusts
This should work, right?
public void onEntityCombust(EntityCombustEvent event) {
if (event.getEntityType() == EntityType.ITEM) {
Item item = (Item)event.getEntity();
if (item.getItemStack().getItemMeta().getCustomModelDataComponent().getStrings().get(1) != null) {
if (item.getItemStack().getItemMeta().getCustomModelDataComponent().getStrings().get(1).equals("uc")) {
event.setCancelled(true);
}
}
}
}```
Model data component can't be null
You need to check get strings isEmpty and also change 1 to 0
Do you propose using NBT then?
🤡
I propose using Book Data
All my plugins just write CSV data inside a book and place it in an item frame at 0,0.
Don’t listen to abb3v
Atleast place it in a infinite glitched (int limit) storage chest of books at 0,0
oooh yeah I gotta start doing that
too advanced for me, i store my data with 16 different blocks as values in a separate dimension and stack em
Better to store the info as a binary set of blocks with stone =1 and dirt =0
Hi,
I’m extending the supported versions for my plugin which currently supports 1.17-1.21.1. I'm using packetevents to detect the movement keypresses to move the cart (vehicle) and I’ve run into a movement issue on 1.21.2+ (works fine on older versions).
Problem:
When the player presses and holds W, the minecart moves only once (one tick).
It does not continue moving while the key is held.
Releasing and pressing again triggers another single move.
Older versions (<1.21.2) using STEER_VEHICLE work perfectly with hold-to-move.
What I Know:
- In 1.21.2+, STEER_VEHICLE is replaced by PLAYER_INPUT.
- PLAYER_INPUT is only sent when input changes, not every tick.
Question:
- How do I make hold-to-move work on 1.21.2+ with PLAYER_INPUT?
- Do I need to assume input persists until a packet says otherwise? Or is there a better way to detect continuous key hold?
- Any help or working examples would be greatly appreciated!
PacketEvents Version: 2.10.0
Spigot Version: 1.21.4-R0.1-SNAPSHOT
Full listener code: https://pastebin.com/PVgr2B1K
Thanks in advance
why not just use the new PlayerInput event? and yes its a toggle
how many chunks would you need to store a chunk this way xD
Hey there,
I’m a verified Minecraft plugin developer on BuiltByBit and primarily release paid, high-quality plugins. However, I’m currently not eligible for premium plugin uploads here.
You can verify my legitimacy and past work through my existing BuiltByBit resources:
- EliteBounty – Item & Money Hybrid
- EliteAFKZone – Custom AFK Reward Plugin
- CustomEC – DonutSMP-Style Ender Chest Plugin
I’m a trusted and experienced developer with a consistent record of quality work and community trust. I’d greatly appreciate a manual verification so I can list and sell my premium plugins here as well.
Thank you.
That won't happen. Follow the rules, just like anyone else
I appreciate the reply from you but im looking forward for a reply from one of the support members.
Litterally will not happen. Others have asked. There are rules for premium plugins, you need to abide by them.
I completely understand and respect the rules — I’m not asking to bypass them, just to be considered under the intent of the Premium Resource Guidelines
As stated there, the purpose of the premium system is to ensure that developers who provide quality plugins and proper support are able to publish premium resources. I’ve already demonstrated this standard through multiple paid resources on BuiltByBit with proven support history and positive reception.
Since I’ve already met the quality, consistency, and community trust standards outlined by SpigotMC, I believe this should be sufficient proof of credibility for manual review or early eligibility.
They should consider introducing a manual verification process for developers who can provide clear proof of their legitimacy and quality of work.
Are you ai?
kinda
im writing this in my native language and using gpt to enhance and translating.
Kek no wonder it’s written like a book
at the end of the day its understandable.
Yes it is
Hey, thanks for the suggestion — I just checked out the PlayerInputEvent docs, and yeah, it looks like a clean, built-in way to handle this since 1.21.2. The getInput() method pulling from the Input object seems straightforward for grabbing forward/backward/left/right/jump/sneak flags without diving into packets.
One question though, does it fire every tick while in a vehicle (even if inputs don't change), or only on changes? The docs say it's for "updated input," but if it's a true toggle/every-tick event like the forum reply hinted, that could solve my hold-to-move issue perfectly without PacketEvents.
Tempting to switch for simplicity (especially since it's experimental but stable in 1.21+), but I'm already deep into PacketEvents for cross-version support down to 1.17. Have you used it in a vehicle plugin? Any gotchas with sneaking (dismount) or jumping (my nitro trigger)?
I believe it fires on a state change
Section Requirements
We regularly change the requirements for authors to participate in this section to help moderate supply and demand. As it stands the current requirements are:
8 week old account
80 messages (forum posts) + 20 positive ratings
3 free resources
Two-step verification enabled
Save your backup codes (print them out)! We will not reset accounts who have lost their backup codes.
In the five years which we have run this section for, not once has a user failed to be promoted within one hour of meeting these requirements. Do not contact us about being unable to use this service.
Last line right there: "Do not contact us about being unable to use this service."
Not to mention the do not use discord as a way of contacting staff rule
also like why do you not qualify?
do you not have any free resources I guess?
I think the requirements are not just about being trustworthy
its just about being a good citizen on the platform and active contributor before you can make use of the premium features
It's usually the 80 messages +20 positive ratings that get people.
you can try contacting support but you will very much be met with either nothing or a no.
also help development is not really the channel to discuss this
?support
Yeah I passed these requirements without even trying...
Thanks thats what i was looking for!
i need atleast of 3 free resource which i cant do
just make some easy plugins
How can you not make free resources?
like a discord bot or some qol things like nametag rendering
see it as an investment
idh time and ig its not worth it
actually i already released 3 free plugins..
now i need to message 80 times right?
Yeah, just click the new post button and see what you can contribute to.
just spend some time replying to help requests or yeah make a meaningful post
Alright thanks
will do ❤️
looking at that picture getting the 20+ positive ratings is also not very straightforward
I don't think there is such a thing as negative ratings, so that's a plus
well yeah its just more that getting 20 positive ratings is not as easy as dumping 3 resources on there and twiddling your thumbs, well I guess it highly depends on the resources and the wind direction of the day
Premium resources can be hard to sell anyways. I released one like 2 weeks ago, and it has 0 downloads.
Maybe I should make a slimmed down free version.
yeah I mean premium resources depend even more on what the actual resource is
if its like custom item plugin 126 its a hard sell
Yeah, mine is pretty niche. It integrates Twitch streams into Minecraft. So basically you need to be a Twitch streamer with your own Minecraft server.
I couldn't find any other ones that do what mine does. There are a bunch that take Twitch chat and put it into Minecraft though. Mine can do both Twitch to Minecraft and Minecraft to Twitch.
fair enough
I got the idea from a plugin request, so I figured at least the guy requesting it would want it...
I have def seen streamers use twitch integration in MC but that was probably a mod or something
lol
I think the coolest part about the plugin is that you can use channel point redemptions to give people stuff in game, so like diamonds or flytime.
You can also give ranks to followers and or subscribers. Plus there are announcements and custom commands for a ton of twitch events, like hype trains, raids and such
I'm thinking if I make a free version I only do chat mirroring and follow and subscribe events and not include support for 1.8
How i can connect postgresql jdbc driver to a spigot plugin? A gradle dependency isn`t working, and another ways in the google search
do you have the gradle shadow plugin added
yes, i tried
did you declare the depenency as implementation and run the shadowJar task anduse the -all jar?
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id "java"
id "com.gradleup.shadow" version "+"
}
group = "iwust"
version = "0.1"
repositories {
mavenCentral()
maven {
name = "spigotmc-repo"
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
}
}
dependencies {
compileOnly("org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT")
implementation("org.postgresql:postgresql:42.7.7")
implementation("org.jetbrains:annotations:26.0.2")
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
toolchain.languageVersion = JavaLanguageVersion.of(21)
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}
tasks.named("shadowJar", ShadowJar) {
archiveFileName = "${rootProject.name}-${version}-all.jar"
relocate "org.postgresql", "shadow.postgresql"
}
tasks.build {
dependsOn(shadowJar)
}
What happens when you run it
When i use DirverManager.getConnection(...), i catch SQLException - "No suitable driver found for"
You may need to merge your metainf service files
in your ShadowJar task include mergeServiceFiles()
not sure postgre can be relocated though
like this?
tasks.named("shadowJar", ShadowJar) {
mergeServiceFiles()
archiveFileName = "${rootProject.name}-${version}-all.jar"
relocate "org.postgresql", "shadow.postgresql"
}
nothing changed
open your jar and look to see if postgre has a service file in meta-inf
?tryandsee
and check postgre driver is present in the jar and properly relocated
$ ls META-INF/services
java.sql.Driver
is it?
yes, it is relocated to shadow/
so how?
just add it to the dependencies section of the plugin.yml
might be worth Class.forName'ing the driver
libraries
libraries:
- org.postgresql:postgresql:42.4.2
- com.h2database:h2:2.1.214
- mysql:mysql-connector-java:8.0.30
- org.mariadb.jdbc:mariadb-java-client:3.0.7
- com.zaxxer:HikariCP:5.0.1
- org.slf4j:slf4j-api:2.0.0```
and, i shoold move postgres jdbc jar to plugins folder?
it's downloading lib, but it still doesn't work
[18:24:45] [Server thread/INFO]: Downloading https://repo.maven.apache.org/maven2/org/postgresql/postgresql/42.7.7/postgresql-42.7.7.pom
same error?
yes, "No suitable driver found for"
show some code then
sql connection code?
this is my data
DRIVER = org.postgresql.Driver
URL = jdbc:postgresql://%HostName%:%Port%/%DatabaseName%?characterEncoding=utf8```
?
Connection connection = DriverManager.getConnection(url, user, password);
it trows SQLException
what is your url?
jdbc:postgresql://localhost:5432/{database_name}
looks fine
before your call to DriverManager do a Class.forName("org.postgresql.Driver");
IT WORKS! Strangely, it only worked when i placed this line right before the call of ".getConnection".
I have to pay you
?services this is no place to ask like this
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/
https://gitlab.gnome.org/GNOME/mutter/-/issues/4416
gnome users: if you experience key being stuck in an xwayland app whilst closing an app or switching the workspace, newest version of mutter broke the correct behaviour
there's already a revert commit being made, but until proper fix is being rolled out i suggest blacklisting gnome-shell and mutter from updating
Looking to paste something? Try a code block or one of the following websites:
- https://pastes.dev/
- https://sourceb.in/
- https://mclo.gs/ (best for server logs)
Anyone got a good guide on how to use MySQL to setup a database for my plugin?
I don't know if it's any good, but it's from the wiki
https://www.spigotmc.org/wiki/mysql-database-integration-with-your-plugin/
The home of Spigot a high performance, no lag customized Bukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Thank you!
With removal of obfuscation will NMS become easier to work with?
Easier to support multiple versions, yes
just working with it in general, no not really
it depends really. This is advantageous to those who want to run custom servers though because all that is needed is to really just decompile and do some fixing up. Before part of the decompiling you needed mappings and while although mojang did provide some mappings not everything was deobfuscated. So now there will be, hopefully, no more guessing
as for the current forks, it just saves a step in the decompiling process in no longer needing to remap stuff. As for NMS stuff you wouldn't need to reobfuscate or have to worry about deobfuscated vs obfsucated stuff lol
improvements?
Fix your names
nah
I think this was very difficult for me, and it took me a long time to pass.\
like what
"BagFuck"
it doesnt matter for a heal command but for anything more complex you wont get away with writing code like this
just move on really
other than names im just tryna see if its decent
no one is gonna be looking at the name of it later on anyway
you dont need methods if youre only gonna use them once
what methods are only used once
you are. in 2 months when you need to come back to this your not gonna understand
doing ryetrarded stuff
like the isnull method
why do you need that
just check if its null
thats like an extra 5 characters or something
if (p == null)
no need to make 1000 methods when you have an ide that auto completes everything you do.
more methods = more confusing.
method names have to be descriptive
whats heal() doing?
healing
not what i meant
it gets the max health attribute checks if thats null if not grabs the value then applies it to the player
Player#setHealth?
why do you need to check anything if your just healing a player?
because the ide says it might be null so uh i add a null check and it stops bothering me
@NotNull brudda
jokes on u, even with coherent names i still dont understand what the f#$k my code does 2 nights after writing it
If it works it works
isNull is crazy 😭
works is an overstatement
classical
Valid c# syntax too
well there’s a space in the c# version but
Why are all of your local variables final 😭
force of habit
is Null is in C# cuz of op overloading no?
wouldnt really make sense to have that in Java
is in c# is just == in IL iirc but yes you’re correct
is will ignore all overloads when compiled
That’s why it breaks unity
yea but like in Java having something like isNull is pretty useless, unless you're using it to pass a method ref
since java doesnt have op overloading
Yeah just use !=
Or don’t check it, let the user deal with the consequences.
Man people that use Objects.requireNonNull because they don’t know what it does and just click “Show context actions”
Those people are silly
yea nullability sucks anyway
I mean rnn isnt necessarily bad
it’s not bad, no, but often when you see it
It’s people who don’t understand what it does
Using it to get rid of a warning
eh idk
And then their code nullptrs wow who could’ve predicted this
maybe back in the days that was probably the case
or if ur looking at some beginner's code
Yeah that’s what I mean
I’ve been using Java for several years now though and I don’t actually think I’ve used it for anything
It’ll nullpointer when you try to use the object anyway
I've used it for LivingEntity#getAttribute for example when I know that it will never be null
Then why use it?
to make IDE stfu, and because I can navigate it through IDE, to find all those places where I assert an invariant
I mean you can disable that with a comment
You you can suppress that with an annot also
but like, then if it should yield with rnn, I directly know I was wrong about my perception of the system and its invariants
? is nullable
! is not null
Ig its similar to if u use checkers framework and you write nullability proofs ie
but checker's a pain
Cope and write extra null checks
never too many null checks
I like that c# has evolved from Microsoft branded Java to something that actually has its own pros and cons compared to Java so neither is explicitly better actually
The whole code should be null checks
Null check the variables you just set
Gotta make sure
yea, dont want a miracle to alter the correctness of ur alleged program
I suppose, I mean same argument with Kotlin
A photon.
True!
That being said, I’ve noticed, at least in the dev circles I’m in, that kotlin and java communities have worse relationships than c# and java ones
Like kotlin users dislike Java more
lmao yea
val a = b?.c?.d?.e() ?: throw NullPointerException()
I mean Kotlin is nice, but it feels like every kotlin project I'm on, I will be surprised by how different conventions, patterns and designs they each will use
where as in Java there's a bit more concistency, tho this is just my opinion based on experience, and by no means trashing on kotlin
Same thing in c# lol
But with var
yeah every kt project is a little different
some are incredibly thrown together
some are incredibly consistent
yup
I personally prefer the thrown together ones
I have made plugins and mods in both kotlin and java at the same time before to piss off all communities
also instead of NullPointerException its NullReferenceException
I usually go for java and I use kt for exposed if I have to
did you pull a kotlin + lombok?
just make a lil object or two for all the database handling and yeet @jvmstatic on it all
#1 thing you shouldn't do in a kotlin project
But then like make it an important and useful utility so that people have to learn Java, haha!
That too
#1 thing you
shouldn'tshould do in a kotlin project
🥹
But you should make it throw a badimageformatexception to confuse people
what are you yapping about
im looking for a dev who help me to set my server
do what exactly
like help with plugins and small fixes and npcs creation
you'd be better asking in #help-server for that
I have a project for someone and willing to pay pretty good Anyways I need to reverse engineer cosmic client and make a cheat that can inject into it.
OMGG OF COURSE!
This is a haxxor community afterall
Isn't cosmic like non existent
lol why are you saying that?
trolling
if (5 is 6) and if (exampleVar is not null) are both valid
?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/
Irrelevant to here.
i'm looking for someone to give me money
for free
plugin setup making leaderboards etc
dm
no not DM, make a post on the forums
you can dm me for sending-me-money purposes
The services message is very clear my friend
like wdym?
This is the wrong place to ask
?paste
Looking to paste something? Try a code block or one of the following websites:
- https://pastes.dev/
- https://sourceb.in/
- https://mclo.gs/ (best for server logs)
WHY
Every single time i code a command
it has to dont work and return usage
you probably didn't register it
show code
it will print usage if
- it is not registered
- the registered command executor returns false
use a paste site to paste your 700 lines
none of them
?paste
Looking to paste something? Try a code block or one of the following websites:
- https://pastes.dev/
- https://sourceb.in/
- https://mclo.gs/ (best for server logs)
it's one of them, otherwise it wouldn't print usage
Just use one of the paste sites above
paste your server log as well, since your plugin could e.g. explode before registering the commands
Oh
I gotta check that also maybe ur right
Yeah ur right
ty
Hello, im opening my skyblock server in 1 hour but the custom resourcepack that I made doesnt work. Can somebody help? It says 'resource reload failed'.
How do you host the RP ?
Mc pack.
And did you just put the link in server.properties ?
Did you include the sha ?
No, I use Skript.
Then ask Skript
Don't fucking DM me with this
I said ask Skript
I don't know skript
Skript isnt a person...
ask the discord server
Check client log to see why it failed loading
Okay, thanks mate.
But if it works on client and not when you send it from server and you send it with skript whatever bs, then you should ask them
U probably made it with itemsadder right?
I'm skeptical of Mojang removing obfuscation from the game, sure obfuscation brings no benefit to anyone (because mappings exists anyways), but to me it feels like they're trying to refactor game to be data driven as possible and then they will put it in maintenance mode in favour of bedrock edition
cannot even call that a wild take, pretty sure your cat ran over your keyboard
Ah yes, let me invest endless hours of developer time into cleaning up tech dept in our codebase to then put the product into maintenance mode
I also do a full rewrite of my projects before I abandon them for shits and giggles
java edition aint bringin in the cash anymore fr
have done this many times
git commit -m "big cleanup + refactor" && git push
Last commit 7 years ago
they know modding is the core of the game. I believe they'll just refactor java edition be behave more and more like a game engine and let the content creators do whatever they want. They know if they won't do that, the community would be quite angry if they didnt provide an ability to mod easily
that's almost the same thing that Sun Microsystems did when they got bought by Oracle
they open sourced the jdk before getting bought
knowing that java edition is not profitable to them i see this as an effort to make compromise between community and mojang
there's a reason why java edition losts its branding as just minecraft
knowing that java edition is not profitable
[citation needed]
i see it more as them trying to emulate roblox, which during the covid shutdowns and thereafter beat everything else out of the water with its ease of customization
doesn't make financial sense for them to pretty it up and then leave it as abandonware; i doubt the suits calling the shots really value "community sentiment" enough to put that much effort into just making amends
rather than abandonware, i foresee a simple interface on realms for installing mods, simple enough for a child to use, because that's where java edition makes its money; children's pocket money spent on realms
they tried this all the way back during the craftbukkit fiasco with the official "modding api" but it never went anywhere, we'll see what'll happen this time
We are in the same boat
Does anyone here have an expertise with packets? I'm running into an issue where my client isn't acknowledging the block changes, the packet creation code with the positions works fine (you'll see the #createPackets) as it is used when players load chunks. The particles appear correctly at the position and I've tested to see if the positions were right by sending a block change above the block I'm trying to modify and they appear, so it seems to just be ignoring the packet? (I also know these packets are being sent as I am logging all packets in the console)
so you can modify the blocks above the ones you want to?
sounds like something else is updating your blocks
yeah which is why I’m confused
nothing should be modifying the block could it be because I’m cancelling the digging packet the client doesn’t want to receive an update?
Are you currently breaking the block when the issue is happening
I break the block and then the code given would regen after a specified time and it doesn’t display the new blocks.
However if I interact with a block around the batch of blocks it will then display the packets coming in.
I just had a really stupid idea
train an ai model on a movie
just one movie
but with a generic base model
then tell it to play that movie back
but crank the temperature
would it come up with different lines and endings?
imagine if each time you went to see lord of the rings in the theater you kinda got a similar movie to the original but at some point it kinda starts hallucinating a new path
like boromir just tanks all of those crossbow bolts
and takes the ring too
or gandalf takes the ring
yo i made a plugin but its not working very good can som1 help me pls
it kinda works but some thing sdont work
like?
so i made a kinda bliss smp but also kinda merged with strength but some of the shards dont work
what exactly is "dont work"?
without code we can't tell you much
you know how sometimes things work? this time it didn't
"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.
ok like I expected it to work good with no bugs, but instead it is running like doodoo with lots of bugs. help
here's my code
package
I haven't written the rest yet
you forgot the semicolon cuh
;package
perfect
works great thanks
np
wtf was i typing?
like that has been sitting here in my message box for like 5+ hours
yk that message box stays there forever
in ur client
atleast in that device, even if u restart discord
Hi everyone,
I'm trying to create a new world programmatically using WorldCreator with Paper 1.21.10, but I keep getting this error:
java.lang.ClassCastException: class net.minecraft.world.entity.EntityType cannot be cast to class net.minecraft.util.debug.DebugSubscription (net.minecraft.world.entity.EntityType and net.minecraft.util.debug.DebugSubscription are in unnamed module of loader java.net.URLClassLoader @4e515669)
at net.minecraft.util.debug.LevelDebugSynchronizers.<init>(LevelDebugSynchronizers.java:36) ~[paper-1.21.10.jar:1.21.10-100-e8c6ba5]
at net.minecraft.server.level.ServerLevel.<init>(ServerLevel.java:216) ~[paper-1.21.10.jar:1.21.10-100-e8c6ba5]
at org.bukkit.craftbukkit.CraftServer.createWorld(CraftServer.java:1300) ~[paper-1.21.10.jar:1.21.10-100-e8c6ba5]
at org.bukkit.Bukkit.createWorld(Bukkit.java:828) ~[paper-api-1.21.10-R0.1-SNAPSHOT.jar:?]
at org.bukkit.WorldCreator.createWorld(WorldCreator.java:494) ~[paper-api-1.21.10-R0.1-SNAPSHOT.jar:?]
My code here
WorldCreator worldCreator = new WorldCreator(name);
worldCreator.environment(environment);
worldCreator.type(WorldType.NORMAL);
worldCreator.createWorld();
any idea?
ask paper
^^ this
I'm posting here because I tried with Spigot but I got the same result
?whereami
Give us a spigot error and we'll help
I just told you that I get the same error message whether I'm using Spigot or Paper...
No you don't, You get a similar one, not the same
So what? What exactly is the nature of my problem?
We are not here to support paper, only spigot
I just mentioned that I'm getting this error message: java.lang.ClassCastException: class net.minecraft.world.entity.EntityType cannot be cast to class net.minecraft.util.debug.DebugSubscription (net.minecraft.world.entity.EntityType and net.minecraft.util.debug.DebugSubscription are in unnamed module of loader java.net.URLClassLoader @4e515669) on both Spigot and Paper. I switched from Spigot to Paper to try and fix this problem, and I got the same error. I want to know if anyone else has experienced this issue.
You are in McDonalds complaining about a Burger King meal.
Send the stacktrace from Spigot
You are comparing things that are not comparable lmao
EXACTLY
You seem very excited. You don't understand the context and you're focusing on the word "paper"
You seem to want to argue with us instead of providing actually useful information
I just want to tell this dear friend that I didn't come here by chance; I initially encountered this error on Spigot, as I mentioned earlier
Then give us teh stack trace from spigot
or just ask in the paper discord if you want to use paper
look, arguing over it isnt worth it, these guys are stubborn. during this conversation I could have spun up a dozen servers to get an error log, its just not worth the effort to argue
Spigot and Paper do things differently under the hood. Some errors only happen on paper, so prove to us you have the exact same error on Spigot and we can help you.
but yeah just asking in paper discord is a good option too
Never mind, I'll go to the Paper Discord server. Thanks again
do u recommend any ways to fix it ?
look earlier in the log to see where it errors
?paste
Looking to paste something? Try a code block or one of the following websites:
- https://pastes.dev/
- https://sourceb.in/
- https://mclo.gs/ (best for server logs)