#help-development
1 messages ยท Page 884 of 1
Yes, the difficulty I find it with it, is having a decent linter that can pick up when you do something wrong
The syntax is kinda strange
its like a hybrid
At least I feel semi confident with reading kotlin now haha
it is very loose ig, like you dont need semicolons, but it is still "required"
Javascript is probably easier to learn if you learn PHP first
took a gander at a couple projects and actually wasnt that bad
php looks cursed
a lot of people consider it outdated (for web development)
well Java borrowed quite a bit from PHP
hence if you learn PHP its super quick to switch to Java ๐
Or just learn java
only the younger people
its by far not outdated
I just hear its not worth learning as JS mixed with a powerful framework like Vue, Next, or Svelte will get you miles ahead with 1/10 the effort. I am not sure though as I dont know PHP
I think it's good to explore other languages but I feel like you should put a solid amount of time into all of them (into actually learning the syntax)
and my PHP server will still outperform any JS server you have
its not just performance
I have never touched any other language than java, I only just recently started trying to read kotlin...
in the web space it certainly is. The advantage of JS though is that you can use your customers systems instead of your own to do things. But Javascript isn't a great language for anything back end
To be fair I've wanted to start trying to mess around with python
its very commonly used in business context eh?
However JS was originally intended to be used for front end, not back end or the kinds of things it currently does
python is a really weird one
it is slow, bulky, easy to learn, but I havent seen many uses of it
although now a new compiler came out that makes it incredibly fast
python is like Bash, its really easy to get something working and resolve things temporarily. Its really good in the number crunching space as well
but from experience it is super slow, no?
Oh boy don't we love our algorithms
no
it can be if you are trying to make it do everything
but it was never designed to like do everything XD
but what I like with python is the ability to combine it with something like Bash though
frost
I did a prime number calc using python that went up to like 100,000, and it took like 15s on python, like 600ms on c++ (it was an algorithm I found online, probably not the most efficient), the difference was insane, and all that was different was the language
Can you give me notes on my economy manager class so far?
It's not big or anything
this could be due to the fact that python doesn't inherently make use of native code automatically where as something like C++ can. IE make use of instruction sets for the CPU
python inherently not making use of native code isn't necessarily bad you just have to take care of that part yourself is all
thats the whole interpreted vs compiled stuff, where C++ is machine code before being ran, whereas python is interepreted into machine code while being ran, right? praying I remember from my CS class
Even Java is susceptible to this problem, however the developers do a pretty good job though in keeping up with that
or my towny addon perhaps? ๐ this one is actually finished (I think haha, could always add more)
while interpreted can be a slight bit slower, not necessarily. It has to do with the language making use of instruction sets present in the CPU or to know to make use of them depending on what needs to be executed
I can take a look at it
native applications like C and C++ do this automatically and the compiler helps as well
python can be compiled, but it doesn't necessarily need to be compiled to run
I'm trying to make this little custom coins plugin or wtv
(p2w sorta functionality)
I would switch to ConcurrentHashMap
and then re-design to allow this to be executed in multiple threads
the readibility of your code could be improved, just the spacing and stuff
Yeah I think it was the formatter I put it through haha
my brain is a little slow rn and line 3 & 4 caught me off gaurd
an economy plugin is one of those plugins where the majority of it doesn't need to be locked to a single thread
especially when it comes to processing stuff
Well here's the thing
The function of this economy is to be implemented through console commands ie: buycraft functions
even more so to allow multiple thread processing
because you can handle multiple connections in this manner
regardless of the order they showed up
You wouldn't happen to have any examples of this implementation perhaps? I have never messed with threading haha
and you shouldn't rely on console commands, most everything can be accomplished in the code and not even touch the console
This was more for simplicity / within my knowledge
I do note, but its not super hard to get started with threading. My recommendation to learn threading is to learn how to use Runnables. Not the Bukkit ones, but Java runnables
there is decent tutorials out there that teaches how to make use of runnables in various ways including making your own threads
ok awesome
from there, once you get the handle on how threads are created, accessed, and removed. Look into learning about workers
Worker Queues
An issue I see arising: getting which threads I need to get from exterior sources such as buycraft
Worker Queues will teach you how to minimize the amount of threads you are creating to stay closer to what is needed in comparison to the workload
so you are not just spawning threads everywhere ๐
Threads are good, but too many of them is bad XD
you shouldn't need to worry about this, something outside should only worry about giving the information
and then your system worries about processing it
So do buycraft functions work by sending like a new thread request or something?
no, buycraft works because it has its own plugin that listens for connections on a specific port
and then it sends its communication to said plugin
the plugin then determines what to do with it, depending on what it got, whether that be to run a custom command or something else
You could make your own buycraft site fyi
The secret sauch to buycraft is paypals API
specifically its callback functions
Well I don't have any use for making my own buycraft site
This was just a project I was wanting to make
handy when you don't want to pay rates for something that is free ๐
Something to perhaps keep for portfolio building ya know?
maybe? idk
Just experience
what helps with learning is to think about the problems and solutions differently then everyone else
for example, everyone assumes you have to do everything in the server when this is in fact not true
you could just spawn another java process entirely
this java process is now separate from whatever is going on in the server ๐
almost like a thread, but has more advantages to it lol
also, Java allows you to hook into other languages too, and the command line
handy when you just need something like a simple bash script to execute XD
or python if that is what you fancy
Yeah of course the code isn't just limited to the bounds of the server, like I said I have just never gone beyond the main thread so to be fair I was not thinking about any process like that
Thank you by the way for all the notes I enjoyed that talk a lot!
HEy,
I need help with getting user ip, now
String playerAddress = event.getAddress().toString(); this return me the player address, so far everything good.
But the issue is that in Minecraft server it give me ipv4 but on the website it give me ipv6...
Now i need to get the user ipv6 from the Minecraft is that possible ?
Your server isn't configured for ipv6
If you want ipv6 you need a AAAA record and an IPv6 address on your server
Oh so if the server is on ipv4 it won't give ipv6
Hey im new to coding spigot plugins, does someone know why i get a null pointer execption error in the console?
Lobby (Main Class)
public static Location spawnLocation = new Location(Bukkit.getWorld("Lobby"), 18.491824023704698, 19.0, 49.47120706849732, 179, 1);
Other Class
player.teleport(Lobby.spawnLocation);
You shouldn't be using a static variable, it's initialised at the wrong time
Also make sure that's actually your world name
I see that make seems.
What should i use then?
Set it in onEnable and show the error if it's still an issue
I cant send images sadly so i try to explain.
I put the code public static Location spawnLocation = new Location(Bukkit.getWorld("Lobby"), 18.491824023704698, 19.0, 49.47120706849732, 179, 1);
in on enable now, but now the public static is red marked
here are 2 swords with a sharpness enchantment and a fire spell
does sharpness 11 really increase damage by 4 units?
no, you need to leave the declaration in the class and only initialize it in onEnable
please learn java basics before attempting plugins
sorry i dont get
what to do if the attributes of an item reset the base damage of the item when they appear
I have 3 listeners that operate on a single file, and sometimes what happens is that they do the operation at the same time and it corrupts the file, how do i fix this?
by not operating on the same file at the same time
i need to operate to the same file, but how do i handle it in a way that doesn't corrupt the file, do i need to make a thread for writing and reading?
you could make a seperate class that will, for example, query the operations and then handle them asyncrounously. I personally have never encountered such an issue, but you might find a solution by just thinking or googling
or simply have a lock somewhere and acquire it when you're about to write
it sounds like a pretty common problem, so you could probably find this out yourself by googling
i did, but i can't wrap my head around how locks work
Start operation -> lock -> another thread try to edit file, would not be able because it's locked -> operation finish from first thread -> release lock
I wonder if you could use CompletableFutures for that
wat
I've been obsessed with them for a while
a synchronized block might be easier to understand - anything in there runs only in one thread at a time as long as you lock on the same object
https://docs.oracle.com/javase/tutorial/essential/concurrency/locksync.html - chapter Synchronized statements
i put a synchronized(this) {} on the major functions but it still somehow happens
because you need to synchronize on the same object
this synchronizes on the current class instance, if you're doing it in two different classes and/or instances, it won't work
aw shit
what was that nerd emoji for
emily hates me
why
do i have to sync to the listener or the instance of the class if am trying to edit?
also i remember syncronized functions to be a thing
you have to have an object somewhere that you pass to both synchronized blocks, i.e. you put a new Object() into a field in the first listener and get it in the second listener as well
synchronized methods are basically just wrapping the contents of the method in a synchronized block and synchronizing on either the instance or the class type, depending on whether it's static or not
any object will do?
yea but you probably don't want to synchronize on random stuff
This is how my listeners and file looks like, all 3 of them use the furnacesFile, can't i lock into that instance?
override fun onEnable() {
furnacesFile = CSV(dataFolder, "furnaces.csv")
if(!dataFolder.exists()) dataFolder.mkdirs()
if(!furnacesFile.exists()) furnacesFile.createNewFile()
filePermission(furnacesFile)
server.pluginManager.registerEvents(PlayerOpensLavaFurnace(furnacesFile), this)
server.pluginManager.registerEvents(LFurnaceBreakPlace(furnacesFile), this)
server.pluginManager.registerEvents(CookingHandler(furnacesFile), this)
addRecipe()
}```
instead of creating a dummy object to lock on
yeah probably
that wasnt a fix rip
hello, is there a template available for a website leaderboard for minecraft? i can't code so i'm hoping there's a template out there that i just missed
is it possible to create a plugin for fake online with bots
or does this require a bunch of clients?
or just tab
Is It possible to make an entity visible only to selected players without using NMS???
there was a hide and show method, let me bring up javadocs rq
for players (if you wanna hide/show them) there is also hidePlayer and showPlayer
Thx, I was looking for such method in the Entity Class, that why I can't find it
Hey all, is it okay to post a question related to the minecraft protocol?
yes
sometimes people ask here even for help with other programming languages, so ofc it's okay
mockbukkit is what i was looking for
Ok then here it is:
Hey all,
I am writing a 1.8.9 minecraft server from scratch in typescript. This server is for now very basic, it handles incoming packets from clients and replies to them.
Right now, when the server receives a login start packet, it directly replies with a Login Success packet containing a generated UUID and the player username. The buffer has the following format, taken from: https://wiki.vg/index.php?title=Protocol&oldid=7368#Login_Success
const uuid = uuid() // 875814ef-fd10-45fb-b244-aed0ba663094
[ 16, x, ..., x,
// โ UUID len (VarInt) โ UUID
7, y, ..., y ]
// โ Username len (VarInt) โ Username
Unfortunately, the client keeps throwing a "DecoderException: The received encoded string buffer length is longer than maximum allowed (45 > 36).
I tried setting the uuid to something simple, like "1234123412341234" or "1234-1234-1234-1234" but this throws a DecoderException: readerIndex(27) + lenght(1) exceeds writerIndex(27)
Any help is appreciated ๐
The UUID is most likely sent as two 64 bit integers
So a buffer of 16 bytes without the varint before that?
64 bit integers? Isn't that a long
Well according to the documentation I'm wrong, but idk
But yeah, the UUID is split into two longs/64 bit integers and that's how you usually transfer it
Yeah uuids are two longs
Long isn't 64 bit in every programming language so I decided to use another term
ok but on v1.8.9 in the docs it says the UUID is a String, and in this particular case it is "separated by hyphens"...
just tried setting the uuid to a buffer of size 16 (equivalent to 2 64bits) and client throws DecoderException: readerIndex(26) + lenght(1) exceeds writerIndex(26)
Alternatively you could ask over at #mcdevs@irc.libera.chat they are more likely to know the answer
is that an actual email address or a discord channel ๐ ?
Though do be patient there are pretty much only three people that could answer
IRC channel
The discord before discord
Do be weary though: it can leak your ip address if you are paranoid about that
How do I communicate with an IRC channel lol? Not familiar at all with this
Hello, is it possible to auto update a plugin with request to spigotmc.org ?
i think exists libs for that maybe you can check the forums for that
Hello. Why I can't cast class that extends Monster to Zombie?
you test that monster is a instance of zombie?
Yes, I am setting EntityClass.ZOMBIE
But if my custom mosnter class extends Monster it cannot be cast to Zombie
ohhh custom entity?
you have the error in console?
Yes, ClassCastException
and anyy more details?
i dont work with custom entities then not sure if maybe the issue is how you are creating that entityy... (and in what version)
My custom mob class that extends PathfinderMob: https://pastebin.com/UMfpKnNc
and when I trying to extends my custom mob class then spawn it
i'm getting error
So when JediMob extends Zombie class its working
but I need custom class with any type
well in NMS the zombie extends from EntityMonster...
but also you are running Purpur not sure if they make changes in that
Yes, EntityZombie extends EntityMonster
But cast is not working
I was trying to extend classes: Monster, Mob, PathfinderMob
i mean the only way you can cast to EntityZombie is if the class custom using is extend from EntityZombie.. the
Yes, that's problem
but PathfinderMob like in your code is another custom class?
No
This is NMS class
Is it possible to make custom mob class with changeable type?
nope
Is it fine to use a dotenv file in production to store data like database creds?
not totally sure but i think not...
based in NMS where when register class for entity all has the specific class... you cant change that...
depends... how can access to that file...
?
i mean you talk about a .env?
Yeah. I'm going to be deploying a REST API which needs to connect to a database etc, and I'm thinking of the best way to provide data like database creds. My first instinct was a .env file
yeah.. depend in the infra... like..
if yyou deploy in kubernetes you can use secrets for store that things and "hide" sensitive data...
if is like the old way... like only run the files.. the most simple way is a .env but you need make that file cannot be read by another users or can be get like in a exploit or something
Hey, Im making an RPG, and I was just loking for opinions. I was wondering which data provider I should use, MongoDB or MySQL. I know both to a degree, well enough to use either really, and was just wondering which would be faster, or better performing in my case. Any advice/opinions are helpful! Thanks
it depends on what data you'll use. Do you need relations and/or strict schema? Use a relational database. Do you need documents with loose schema? Use MongoDB
hey guys! I need to make sure that when writing /signe - a sign with the text "HellO!" opens, can this be done via NMS/ProtocolLib or? I did it with the opening of the tablet, but the problem is that I still can't make the text
with location i have to store for get the position of the player in the middle of the block he's standing? i tried with xyz and pitch and yaw but it's moving me in the middle of the 4 blocks
-0.5 on the x and z
thx
if i want to store like some arrays info how can i do? (maybe it's better with an sql)
Does anyone know how to reload a config?
I tried using: plugin.reloadConfig();
But when i change config and then reloading it, but it dosnt seem to update it
alright thank you
anyone knows what am i missing to reload a config
Is there a way to use custom fonts in item lore just like in messages? (Where in messages you use BaseComponent[])
like in the example
Pretty sure that's still pending a pull request
Paper and NMS has it, spigot does not
(iirc)
hmm interesting
if u let me ask
That's a neat font icon for damage.
should I try making it on Paper? (still learning Spigot + Java)
not rlly made by me, but thanks, im pretty sure the icon is free to the public too so if u want it
Personally I'd just dip into nms for a bit I'd hopefully expect components to be merged by 1.21
nah, I'm not "in the market" for that
NMS isn't very hard to maintain with mojmaps
idk much abt NMS ill read the spigot wiki about it
I can help you If you want
But you'll have to give me like 30 minutes to get out of bed and get up
no no, no need to worry ty for the availability tho
but can I send you DMs in case i have some small questions?
Just ping me here I'll be around
ok ok
I also reccomend a multi module approach if you don't know how to do that I can help
what is the correct method for 1.20.4 minecraft version to correctly retrieve GUI name. Coding a plugin and i need to retrieve the correct name of a GUI so onInventoryClick can work correctly
Don't use gui names use hashcodes or equals
@storm jungle read this thread https://www.spigotmc.org/threads/a-modern-approach-to-inventory-guis.594005/
Daily reminder there is an InventoryView#setTitle method your titles aren't safe and never will be
mfw players rename a chest in the anvil to "Vulcan AntiCheat"
LOL I remember seeing a video about that
this guy like disabled all checks for himself and started going wild on the server
Yeah that's exactly why you don't use name checks for inventories
why did mojang not add inventory uuids yet
you don't need to
its inherently unneeded
also they would never add UUIDs to inventories regardless its like if I just added a UUID to my arraylist to identify it, that's stupid design
if anything had UUIDs its InventoryViews and actually they already do have a UUID technically that being the players who has it open
did you store the config object in a field somewhere?
because if so you're still using the old config
Nop its taking the new one
then what exactly is the issue
i was setting up a vps i've just bought and i was trying to make a new user, which i did, i gave the user sudo permissions and ssh'd into the server with the credentials of the user. i then edited sshd_config to do PermitRootLogin no and ran /etc/init.d/ssh restart - my terminal froze, so i attempted to reconnect and timed out. i restarted the server and now i'm receiving Connection failed: connection refused. No more addresses to try. by termius. firewall (ufw) is open on ssh (ufw open ssh) and i have not changed the port. any idea how this could be resolved and why this could have happened? i dont really wanna redo the whole setup again
do they permit loading a rescue OS?
i don't think so, but i can login via RDP apparently, but I have no idea what that is and whether it will work since i've changed the root pwd
check if SSH is running with netstat -tulpen
can't do that if they can't connect
i don't have access to the terminal
did you not say that you have RDP or VNC or whatever
I want to find Entity by ID Problem is that Bukkit.getServer().getEntity(uuid) takes UUID as input parameter but, Entity#getId() returns int. So how can I get UUID of an entity?
they said they could connect via RDP
the email i got when purchasing the vps specified my creds for ssh and rdp
and didn't know what that was
getUniqueId()
get VNC and connect via RDP
doing that rn
... I'm blind
should give you a console ๐
why do we even have getId in spigot
can you force a reboot on the VPS?
who is your provider ZBL?
seems you didn't setup the firewall the way you thought
yeah most likelyy
ik with hetzner you can VNC that shit no matter what you do through their website
if this won't work out im gonna have to redo the entire thing
thankfully i didn't do much yet
there is not much you can do without the ability of loading a rescue OS
a certain russian hosting
one of the things why I like OVH
actually they might have it
one sec
which kind of weird hoster are you using that they don't give you a proper remote console nor a rescue os
what is it called
if they allow it, you need to mount some directories so you don't screw up permissions etc
have you perhaps heart of hosting-minecraft
they provide terrible fucking customer support but overall the hosting is high quality
and then all you need to do is have ufw not run automatically
ah, that sounds like the most average russian minecraft website
it's quite popular
seems like a terrible provider
i've used it multiple times before specifically for a minecraft hosting
but now that i need a vps i headed to them again
ok they have some sort of rescue thing
trying to figure it out
so can you boot into a rescue system like grml or sth, or not?
seems aweful to me
have no idea what grml is
as long as they can just boot to a live OS it doesn't really matter which
one of many linux live systems for rescue and stuff
then boot into it, mount your partition, chroot into it, start ssh and see why it fails
that is dumb
only need to prevent it from running on start
so they can just use the normal system to log in
it is taking unhealthily long to reboot
logging in without ssh is gonna be a bit complicated
oh read it wrong
anyways, they should have ssh if they have rescue OS
but, its not the SSH failing though
the firewall is blocking their connections
two options:
- "boot from drive" choose this option to boot your server from the drive next time it reboots
- "boot in rescue mode (rescue iso)" choose this option to boot from a rescue iso mode next time it reboots
i chose the second option and started the reboot now, and it's taking way too long to reboot idek why
it's been like 2 minutes
nvm it's rebooted
it takes a bit of time to fetch the ISO
now how would i log into the terminal without ssh access
you should technically have ssh, so try ssh and using your default login
if that doesn't work, use RDP
rdp times out, ssh fails with the same error "Connection failed: connection refused. No more addresses to try."
then its probably not you
its most likely the host system or the ip address
ip address in that the network related things have suspended taking connections
Why RDP for server?
wait they have a "vnc access" button which opens a very pixelated terminal in my browser
you probably need to reset your server I'd highly suggest switching to a better european hosting provider like Hetzner or OVH
because it gives you the live view of what it would look like if a physical screen was attached
:|
yeah i will probably switch later
can you see what it is even doing now?
you don't even have to try hetzner if you only have a russian address though
yeah
hmm, stuck on some weird screen
i'll reboot it once more
guess they didn't bother testing their rescue ISO
to see if it actually does any rescuing
or i did something wrong
the hosting has a rather large userbase so i'd assume such large bugs would have been patched by now
maybe you just banned yourself with fail2ban
that is a very real opportunity
i do not remember the try limit i've set but i must've exceeded it by now
it used to timeout but after a while it started to give me the "Connection failed: connection refused. No more addresses to try."
i've vnced into it again and now it seems to be booting up or smth?
ohi can run commands it just requires a password
1 sec
well its russian
yeahh
russian anything hasn't been decent since the late 90's
lmao
sadly i have to agree
this thingy does not respond to my keystrokes whatsoever
i dont know any distro that hides the username
^^
it does not react to enter
i am not that stupid
My bad
ok now it finally does i just had to press it like 15 times
yayyyy
ok i should probably disable fail2ban and ufw
yes
ayo 9minecraft took their shitty page down
gg no re
but it did remove ufw
you didn't mount all the directories, don't try uninstalling it
just disable it from the services
are you sure you are not looking at the services for the rescue OS?
i was thinking about that yes
what should i even do lol i've never booted into a rescue os before
because typically to do anything with the OS that is installed you need to mount the partition
typically its either SDA or SDB that needs to be mounted
you will have to use the partition tool to figure that out
is it just mount /dev/sda?
well if its a normal linux install, typically sda contains your boot partition related stuff
and sdb contains everything else
mount /path/to/disk /path/to/mount
^
uhhhhhhhhh
mkdir -p /mnt/whatever
mount /dev/mydisk /mnt/whatever
and not just sda but the partition
did you just use a normal ext4 partition or did you use LVM or anything?
i have no clue i was just provided with a fresh ubuntu installation
mount: wrong fs type, bad option, bad superblock on /dev/sda, missing codepage or helper program, or other error when running
mkdir -p /mnt/attsda
mmount /dev/sda /mnt/attsda
1 sec
not found but can be installed with apt install lvm2
do i install and run again
if they rescue system does not have vgscan, then they probably didnt setup lvm
depends on the iso provided
just do lsblk -f
could be the iso just doesn't have lvm as it isn't technically necessary
that should show you the filesystem and device name
mount /dev/sda1 /mnt/myfolder
oh i also tried with sda1 and it gave me superblock has unknown read-only compatible features (0x8) enabled
and then this error on the next line
i feel like in the time we've been troubleshooting this i could've redone the setup twice lmao
but i'm too invested into this now
I find it weird that the FSAVAIL says 0 on everything.
which OS is that rescue system?
does it even support XFS? do you have xfs_repair available?
is not installed
1 sec
if it's debian or similar, install xfsprogs
ubuntu 20.04
temporary failure resolving 'archive.ubuntu.com' there's no way it has no access to the internet please
nvm
it's doing something
should i just reinstall the system
yeah imma
weird they gave you an outdated live OS disk
this whole experience is weird lol
the issue is that the the FS makes use of an updated kernel that the live OS does not have and isn't compatible with
probably a ufw misconfiguration after all, but i don't see how that could've happened, because after configuring ufw i was still able to connect
well ufw doesn't terminate existing connections
but what most likely happened is your fail2ban clobbered you
i think it was a combination of fail2ban and ufw
i was getting timeouted for some time
and then i started getting errors immediately
well when you set permitrootlogin to false, and if you didn't update the fail2ban settings
it auto bans anyone that attempts to log in with root
well its common knowledge to whitelist one's self before implementing auto banning stuff
XP having better support for network drives than windows 11
i mean i was not trying to log in with root for my first couple attempts
windows 11 disables such things by default and you need to enable them
why even bother with fail2ban, just diasble password auth and done
i wanted to do passkey auth but it was too hard for my smol bren to comprehend
^^^ ssh keys are the best
it's not like those SSH bots would be very dangerous anyway...
unless you use "admin" as user and "admin" as password, they won't get very far lol
lmao
They are just waiting to catch you lackin.
at least now you know what not to do
I'm trying to delete all signs that "pop off" when their attached block is removed, what event do I need to listen to? :)
Block break event id assume
Called when a block is broken by a player. problem is I set it using code, so it's probably not the player's doing
What do you mean by attached block
Sign is on stone, stone gets set to air, sign breaks
BlockDropItemEvent is also attached to a player
BlockPhysicsEvent maybe?
Mmmm itโs awesome youโre a docs readerโค๏ธ if you read through it long enough youโll find your answer, I have no clue of spigots methods that detect block events outside of player interaction
Iโm sure if your patient enough as well, someone who actually knows spigot can get you that answer
Not that I donโt know it haha, Iโm just self taught in java through 4 years on and off Minecraft framework so there are a couple ideas I have but nothing that doesnโt involve the requirement of player interaction, sorry!
item spawn event

Like I said, someone who actually knows their stuff can help haha
I should just become a professional documentation researcher and put a solid 2k hours into spigot maybe then Iโll be useful D:
hi who can help me pls
ask your question
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
This seems to stop the PlayerInteractEvent running, anything I can do to alleviate this?
o.O
i need help to start my spigot server pls
you didn't mention anything about player interactions
Tbh, I didn't realise they were linked
#help-server Server specific help is provided in that channel. This channel is for development.
Actually made the opposite claim D:
So does it just stop that event firing, can I do something about it?
yeah don't cancel the item spawn event?
you can just remove the entity without cancelling the event
lol ok
Thanks!
Happens to all of us man
Is It possible to create a line between two locations?
you could use particles, or this funny elder guardian beam
Spigot support Elder guardiรกn Beam?
Guardiรกn beams are heavy for performance?
Just stretch some display entities over a really long distance. :kek:
Oh yeah thatd ofc also work
What is a display entity?
An entity that displays things
New in 1.19.4+
if i stop the server the array list will be cleared right?
yes
and how can i store it in a like sql?
The size can be adjusted?
Ye
You can make it smol you can make it big you can even make it bigger
That's in the snapshots right now.
I was thinking about a magical items kinda plugin... something with like lucky trinkets that provide certain benefits, demonic wishing eyes, etc stuff for a magical sort of time period... got any suggestions for any more magical sort of items I could include in this?
Armor
I was wanting to keep away from weapons so keep that in mind as well
I was thinking about armor but wasnt really sure where to go with it... how do I make armor magical??
Maybe some kinda cultist armor or sum to buff damage from certain weapons
You could also make something similar to draconic evolution armor where you don't take damage until you have taken enough hits
Hmm maybe like classes of armor perhaps? (full set bonus system kinda thing?)
Yeee
Hey @worthy yarrow can you help me ? I write a message in help-server
Hmm I like it, just seems like too appealing the pvp side of things, I was wanting to incorporate a lot of magical items that might benefit a player in an instance of not having forms of travel, or perhaps portable storages, etc... stuff thats like quality of life sorta thing
What if I made an armor + bosses system that incorporates special "boss" sets that may provide real world pvp benefits or perhaps sets that help with certain bosses stuff like that? I think that would be pretty cool for armor / bosses
Maybe like "boss runes" applicable to pieces of gear that will apply special bonuses
you could also use the already existing smithing templates for such things
That was kinda my thought for it if I were to implement these sorta things
Sounds like a good idea
Yeah or maybe just a drag n drop system... just to support more versions without having to rewrite a lot of the code
ye ig
Got any ideas for the quality of life factor perhaps?
maybe some magic/enchantable food
I was thinking of a food system where it's like "bigger portions" when you eat lets say a 3 roll sushi platter... it splits into like 2 fish after eating the inital "portion"
Sort of like a portable cake kinda thing I guess you could say
hm
Also this system would include custom recipes or whatever for these food items
Hi. Just wondering, for the following code, would I need to run this asynchronously, or is all the networking handled on the client end?
Thanks!
It should be handled on the client
Alright, so just to be clear, I'm good to run this on the main thread? :)
Yes
well you would need to anyways since its an itemstack
Oh am I not supposed to create item stacks in an async thread? The majority of my plugin is doing that since I'm usually querying a database simultaneously.
well, not sure if it works now or not since updates. But typically when it comes to items or anything to do with the world you just don't do some things async or in another thread lol
server tends to not get happy with that
is there an event for when someone saves a structure with a structure block
Ah yes, I've had that with the Inventory. Whenever I need to open one and display it to a player I have to do it in the main thread. Maybe item stacks don't require that anymore. Either way I'm glad they work async lol!
Given that they "work" doesn't mean you cant break them... make sure to test that a lot haha
EventtHandler
public void onTrashInventoryClick(InventoryClickEvent event) {
Player player = (Player) event.getWhoClicked();
Inventory clickedInventory = event.getClickedInventory();
ItemStack clickedItem = event.getCurrentItem();
if (clickedInventory != null && clickedInventory.getName().equals("Trash") && clickedItem != null) {
if (clickedItem.getType() == Material.GRAY_STAINED_GLASS_PANE) {
event.setCancelled(true); // Prevent the player from picking up Glass Pane from the trash
}
// You can add additional conditions for other item types you want to consider
}
}```
why getName(). are wrong?
Hmm. I'm not really sure how I'd go about testing them, any advice there?. The only time I'm interacting with an item stack in an async thread is when the item doesn't yet exist in the world.
if (e.getView().getTitle().equals(ChatColor.DARK_AQUA + "MobCoin Shop")){
Oh boy... that is out of my skill range haha
I'm not sure how you'd "supposed" to manage itemstacks in that way
Fair enough lol. The plugin will be tested on a server with around 15 members simultaneously using it so hopefully that will suffice prior to the 1.0 release.
Just have them trying their absolute best to break any and everything haha
I'm sure they will lol
aha, that is probably why it works async
makes sense now
Ah I see what you mean, only when it exists in the world. Gotcha!
Well I'm glad I got talking to the correct people lol
I try to help where I can... though its usually just proposals of how to implement logic since I am not the most experienced with spigot, also I hate reading through docs so
Fair enough, everyone has their own role in a large project!
That's certainly the way I like to think of it
Does anyone have experience with Paypal IPN and SpigotMC?
why do you need to check the name of your inventory anyway?
https://www.spigotmc.org/threads/a-modern-approach-to-inventory-guis.594005/
My Second Daily Reminder that InventoryView#setTitle exists and will fuck up your system. You're current system is open to exploits dupes and more
had hackers on my server and they uuid spoofed me. we run 1.20.2
this is what they said
do you use bungeecord
I don't remember spigot fixing anything along these lines while I always reccomend updating it usually isn't for these reasons. This seems to be a BungeeCord vulnrability. Might be beneficial to create an issue on the BungeeCord issue tracker on github mentioning users are able to bypass bungee authentication. Granted without this client code it might be difficult to actually fix
iirc thats not a bungee issue
it was idk how many years ago
how would you even spoof the uuid
idk if it was ever fixed
If they are running Bungee online
this is kinda confusing me
back end servers run offline mode, if you have the ports open to them they can join as who ever
You used to beable to get around bungeecord and spoof your UUID since BungeeCord requires backend servers to be "online-mode: false" You can take any user you want
idk if this is still true
yeah it is
aren't there like bungeeproxy things or something like that
spigot does say to secure your backend but people dont listen
bungeeguard
not using localhost though
I'd guess their bungee is set to offline with some other authentication
what is ther best way to load a yml file in bungee/velocity
bungee has a config system for that
and what about velocity
yes
Bungee set to online?
seems like they have snakeyaml
yes
odd indeed then
close the backend ports and use bungeecord
be sure your servers are really running on localhost
We are
isn't there a way to restrict it so only 127.0.0.1 can join the server
there is no path between localhost and any external port
nothing was changed then
setup bungeeguard
does that mean they are talking bs
yup
btw, tf is a notchian client
bungee guard will fix all this?
bungeeguard will required a token that is only provided by bungeecord
Vanilla
don't allow players the ability to directly connect to the MC servers
oh, why notchian tho
we dont
you obviously do if someone uuid spoofed
can only uuid spoofed in offline mode
only way they could circumvent the online mode is by not connecting through the proxy
IE directly connecting to the MC servers
yes that what they do
they can brute force the bungee messge when joining direct
check that the ports are definately shut for backend servers, and i would advise setting bungeeguard up
idk what you are talking about with brute forcing
I explained to you what it is going on whether you agree with it or not
bruteforce what?
I had a buddy that got spoofed. The MC servers showed that the connection was coming from 127.0.0.1, suggesting the hacker successfully spoofed to authenticate through Bungee itself.
they didn't unless you allow offline players through the proxy
mfw firewall rules exist
Not on aternos uwu
Proxy is in online mode. No access to MC servers. He changed his password too and they attacked again. So this conversation has some merit
you can't even host bungee backend server on aternos
Oh
if it has some merit I'd make a bug report going through the steps to reproduce said error so it can be patched
it doesn't, there currently exists no way to spoof uuid's unless you are in offline mode or you have a plugin that is allowing it
otherwise it smells of poor configuration
sorry but magical code is not a thing
all code I write is magical
if it exists such a security vulnrability shouldn't be discussed extensively here regardless it should be emailed with an in depth explanation of how it functions to the support email and patched asap
Yep, only time I've ever seen someone get past Bungee was a mis configured setup. didn;t follow the "secure your system" after installing Bungee.
I don't know how they managed. That's the thing. All I'm saying is I've seen it before. Just not sure how to reproduce it in order direct anyone on what might need to be done to address it
bungee doesn't change how the protocol works, if they can get past bungee and they didn't misconfigure anything, then this means they can get passed vanilla online mode mechanics
ahh fair
I moreso mean if bungee has some bug that allows you to get past online config somehow that is something that should be addressed in depthg
Hmm, well, it might be possible that bungeecord is fucking up something, who knows, do you never make a small mistake that you need months to discover?
but bungee doesn't make changes to the protocol
how do you mess something up that you are not changing?
In many ways
and if bungee was messing up with online mode, sessions would mess up every so often
or something with the authenticating would mess up
the proxy takes care of authentication during the login process just as if it was the server, that process is completely transparent to the client, once that is done it'll forward some info to the server
the login process between the client and the proxy does not change
Emily is correct, so I can't see how bungee would have some flaw that would allow someone to magically bypass
two, if such a thing exists, why is it that more people are not saying something or reporting this o.O
I don;t see Bungee allowing a Client to Force it to take a certain UUID. Impossible
you can skip the login process by skipping the proxy (you'd need a modded client so it'll forward the spoofed info to the server, as if it was the proxy doing it)
or just run your own Bungee
or that, yeah
You can;t skip the proxy though, IF they truly are on LocalHost
I mean if your firewall is improperly set up...
Localhost has no bindingsa at all the any public address
my guess is this misconfigured firewall
they were referring if the mc servers were listening on the loopback address
ah
yep, they are definitely getting direct server access for it to happen
there's a way to modify the time that the particles exist?
no
i have finally reset the server, the configuration panel at this hosting is so buggy i couldn't switch off the rescue mode for hours lmao
will try to setup it with more care tmr
should just switch providers lmao
Spigot uses Log4j to log console output, hence making it easy to listen to incoming console messages, or to block certain console messages from appearing. Prequisities You need to have Log4J on your classpath. We simply add the dependency to our pom.xml using the provided scope, as Spigot already contains those classes on runtime: Create...
when the server shuts down / in the onDisable event, is it possible to set a lot of blocks back to air or is it too late and would I need to instead set them back to air on startup?
You could probably do it in onDisable
sweet
but why do you need to remove a lot of blocks when the server shutdown?
plugins can't disable logging
I am making a plugin that will remopve player placed blocks every so often
if the server restarts, i don't feel like storing and persisting what blocks were placed and what the countdown was paused at
Hi frost any ideas for magical items? Something along the lines : quality of life, ie: maybe portable storage, forms of transport, etc?
no way cmarco doesnt have bible plugin on his mc server
mailboxes
What makes these mailboxes magical? ๐
I do have an idea to create a mail delivery thing, where an entity brings you your packages or mail
cmarco gonna make a plugin about student loans and paying rent
That would be really cool in my opinion.
๐
I'm making inventory menus and I have a problem:
I have a custom kotlin DSL for my inventories, which creates an instance of my InventoryMenu class, which is then stored on the player (via a custom Data object I have). The problem is that every time an InventoryCloseEvent is fired, I set that the player's current inventory menu to null (because in my code handling inventory menus, InventoryClickEvents are cancelled when there's an active inventory menu, but I want players to be able to use their inventory when there's no inventory menu active). the thing is, in the DSL, I'll have an action to open a menu when another menu is already active (this is used for a submenu), which triggers InventoryCloseEvent, which sets the player's inventory menu to null, causing the inventory menu to not work. Is there a way I can supress the firing of InventoryCloseEvent when I open a menu?
edit: fixed by adding a kludge where it records if a submenu is open
no
TeamColor teamColor = TeamColor.values()[i % TeamColor.values().length];
Team team = scoreboard.registerNewTeam(teamColor.name().toLowerCase());
team.setAllowFriendlyFire(false);
team.setColor(teamColor.getChatColor());
team.setPrefix(teamColor.getChatColor().toString());
Hi this is the way I register new teams. TeamColor is just an enum with a chatcolor in it.
smallestTeam.addEntry(player.getUniqueId().toString());
And this how I add a player
But in-game the playername doesn't have a color
Not in the playerlist
not in chat
and not on his nametag
you add players by name. Entities by Stringified UUID
why?
Because thats how Teams works
where can I find that info?
It probably isn;t documented. You just find it when you try to use Teams
that's bs
welcome to Minecraft development
Is there a way to give an inventory/GUI some sort of UID so I don't need to use .getView().getTitle() to identify the GUI, and so renaming a chest won't work
Use the inventory instance
Yeah I searched in this discord for an answer and read through it but didn't find a solution for my problem, I probably missed it
Thanks I will try
But it didn't have a method to give an UID to the inventory, so somehow it does that another way i guess
it just identifies it by the view or inventory iirc
Then how does it prevent the renaming a chest exploit
because the inventory name doesnt matter
huh
TextDisplay display = player.getWorld().spawn(location, TextDisplay.class, pre -> {
});
display.setCustomName("\\uFFFD");
display.setCustomNameVisible(true);```
any ideas on why this does not work?
oh wait
I forgot to load my resourcepack lol
why are you using the consumer if you don't use it lol
why not use setText ๐ค
That is the correct way
how text displays are meant to be used
it is not done
I donโt think the custom name ever shows
shoudnt you use only one backslash?
otherwise you set it to literal \uFFFD
but don't you want to use the char with that id?
yes I do
there is 0 resources on how to work with resourcepacks /: had to use chatgpt
still not working
use one backslash only
well it is getting displayed, but not with the custom font
to use fonts you need components
what?
either A. Use Paper or B. dip into NMS
/summon text_display ~ ~ ~ {text:'{"text":"\uFFFD","font":"myfont"}'}
does it show if you summon it like this?
You can replace stuff in the default font silly
it isn't like I defined any custom font
why would you though
You donโt need components
custom fonts are great for this
Why not?
Thereโs hundreds of reserved private use characters in Unicode you can use
sure, but then you just pray they aren't already used
then you're texture pack is miconfigured
yeah idk how to properly configure it
Used by who smh
ChatGPT told me to use the number representation of the unicode
other plugin developers
so 65533
"pack": {
"pack_format": 18,
"description": "s"
},
"font": {
"providers": [
{
"type": "bitmap",
"file": "font/65533.png"
}
]
}
}```
mcmeta
Whereโs the font file
hm I know that at least for sounds, you must not use the file extension
\assets\minecraft\textures\font
Yes but you didnโt
what?
Change the actual font file
assets/minecraft/fonts
that does not exist in my RP
I used some random template
also, my title background is grey smgh
there is no proper guide to make resourcepacks and no proper template
at least there's a decent tool on spigotmc to merge resource packs
There is most definitely a proper template
link?
https://minecraft.fandom.com/wiki/Resource_pack actually this explains everything, doesn't it?
Fandom wiki, destroy
minecraft.wiki supremacy
If only google would get that message
not really, it does not show shit how to write one. just explains each tag
thanks
See also
Tutorials/Creating a resource pack
can't you just upload a font file to chatgpt and ask it to turn it into a resource pack lol
now, HOW do I make changes to that font
well but I already registered my shit in the pack mcmeta
this is what chatgpt told me when I asked how to turn a ttf into a resource pack
Try that one
where tf is minecraft:font/your_font_name/
assets/minecraft/textures/font/your_font_name
Although you can put the image basically anywhere
Download the one I sent and look at how they do it
Did you put it as a custom font or in the default one
default
nothing
I guess imma just calm down for now and completely restructure my resourcepack properly tomorrow?
Itโs extra fun when youโre trying to generate resource packs via code
good that I don't need that for this plugin
My Question is half Coding half Server help I got an custom texture pack where I have an Image for my Scoreboard Displayname but it wont load and only show the invalid char thing does it need to be specifc size for the scoreboard
Does it show when you paste it in chat?
no it didnt I found the solution it is that the image cant be bigger then 256px
Yeah it can
nah I tried it it all works but if it exceeds it 256px it wont work
Whatโs a good way to hide a certain entity (like a cow) from a player everything I try with protocol lip isnโt working in 1.20.4
can someone help me
Player#hideEntity
Don't sleep with loose women
put yourself first always
Donโt eat the yellow snow
if it's black, fight back, if it's brown, lie down, if it's white, say goodnight
Im scared to read into this
bears
Is there a way to send a resource pack in a plugin as the player joins before loading in, like how server.properties now works with packs
declaration: package: org.bukkit.entity, interface: Player
That adds a resource pack, I'm asking how do I add a resource pack specifically as they're loading like how it works if you put a pack in server.properties
Pretty sure adding it on join is basically the same
No, if you put it in server.properties the pack loads up BEFORE you actually join, rather than after you've loaded into the world
Be yourself!
I swear Iโve always seen the packs load right after I join
You also get the prompt after joining if you have that enabled
i guess they're asking if there is anything exposed about the configuration phase
which, no
Not in the newer versions
would love some intent system for delaying the configuration phase finishing
Time to expose configuration phase oh nvm... that would require me to touch the spigot plugin loader nvm
noob
leader
Bruh I hate typing on my phone ๐ข
No it wouldnโt?
What
Even before world
Isn't the config phase when the player joins
the bit where resource packs now load if in server.properties
I could've sworn it was configuration -> world etc
Becusse I thoughts you couldn't access the server object
I guess there's a configuration stage for the world too, but I'm talking about the player join processing stuff where you send resource packs
Thatโs nothing to do with the connection phase
I donโt think thereโs really a name for that
Registry phase I guess
That's what I thoughts configuration phase was lo
Smh do you even NMS bro
Not outside of menus really
that's bootstrapping
Ahhk that's why I was confused
Bootstrapping, registry, Mojang being rude, whatever you want to call it
Mojang being nice soon
?????
public class ShitListener : EventListener<PlayerShittedHimselfEvent> {
public override void OnEvent(PlayerShittedHimselfEvent eventData) {
Logger.GetLogger().Log("Haha funny" + eventData.GetPlayer().GetName());
}
}```
i finally made it on unity
me waiting for Mojang to stop adding random 1.21 stuff and release the regular 1.20.5 when the 1.20.5 arm reach is perfectly fine and I desperately want it for plugins
Ew gross I can see the C# code style from here
because it is
i just prefer it this way(as java)
It's brcuase he has some braincells left
Visual studio on its way to scream at you:
Braces on the next line is pure brain dead behavior (sorry md)
Iโm very sad there isnโt a gif of Brendon Urie kicking the door open on tenor
thanks everyone who helped me with that shit
It's the correct way to write code. And if that bothers you, you need to reevaluate your priorities in life.
Actually according to the java language conventions 
And if that bothers you, you need to reevaluate your priorities in life.
I'm currently reevaluating my life priorities and I have yet found something to change
Braces being on same line is still #1
I 'm paraphrasing here, but K&R said pick a style you like and stick with it.
idk who this K&R guy is but he needs to re-evaluate his choice of words
They had a particular style that they liked, but realized it was advantageous for people to use the style they were most comfortable with.
google style
yeah they need to grow up and do same line braces
So you're wrong to criticize other peoples' choices.
or die
I use a slightly modified google style. :p
wasn't microsoft style mega cursed
It do feel a bit funky
Mostly changes around their god awful indention rules.
actually I'm totally right. Especially if the choice was next line braces
I could maybe let it go if they just comitted a Felony or something, but this I could never
Resource to help accelerate production solution deployments for customers
:OOOO THEY USE GOOGLE STYLE
Blocked.
๐
@echo basalt Its confirmed I'm a better troll than CMarco
That's nothing to be proud of.
true that's quite a low bar
Atleast Cmarco uses same line braces though ๐ค
you're ass
<3
cna anyone help me with my code?
i have an issue.
i tried to make a plugin that cancels drop event from stone , if /nocobble is toggled so when stone break nothing drops but it did not work
here is my code in spigotcraft channel
?paste
Toss the code in here
Why in that channel? This is the development channel after all.
If you're trying to prevent drops from stone, then you should probably check against Material.STONE instead of Material.COBBLESTONE.
Potential issue: You're checking if the block type is cobblestone, not if the dropped item is
yes you can
i have tried this
again does not work
you still dont check the item

