#help-development
1 messages · Page 1825 of 1
hello, im new to modding mc. Im trying to make a mod for 1.17. Is that supported with spigot?
of course
Define mod
get with the program pal everyone else uses a build system for a reason
Spigot supports server side plugins, which you could call ”mods”
But generally when someone says minecraft mod they don’t mean a plugin
spigot is server side?
Yes
I see
either or just build the server jar and then include the built jar as a dependency
If you want client side use fabric or forge
i think i went over this with someone and they mad at me
mods affect the client side, which mean they can add new game features, like custom items, blocks, and etc
plugins only affect the server, which mean they can only use in-game features
fuck if i know i only use eclipse to convert projects to maven
but plugins are muuuch easier
mods could also be plugins/addons idk
ok, so is bukkit also server side?
so if you can do it with a plugin, then its recommended
spigot is an extension of bukkit
Yes
@buoyant viper Ofc they mad at u cuz u have the wrong profile pic. Use sakurajima.
Bukkit & Spigot are serverside ONLY
mod plugin addon all the same thing under a different name
Forge & Fabric are both serverside & clientside
Bukkit, craftbukkit, spigot, paper, etc are all server side
plugin implies serverside but yeah basically
i was matching with an egirl :(
oh i see. I thought that these were client side
@young knoll Bungeecord as well
not necessarily
@buoyant viper KEKW
The only client mod loaders I know of for 1.17 are forge and fabric
u can have a client with a plugin system
i said implies not always means
if you are a beginner to this stuff, i recommend using fabric before forge
is importing a .obj model and its .mtl textures into MC possible at all? sorry if this is an annoying noob question, but desperate here
its all down 2 context 😞
forge is more powerful, but fabric is easier to setup
im pretty sure it is but this isnt the server you would ask that in
No idea, we don’t really excel in that stuff
Try the minecraft commands discord
yeah
easier to setup bc u gotta do it all by urself 😼
@crisp arch Fabric kinda sucks I only use it cuz it got better mods. But forge shows you which mods you installed instantly. I didn't figured out how gayric does that yet
@dusty sphinx TELL ME HOW
i have spigot 1.18.1 server and when i step into nether portal it doesnt teleport me i only see purple waves
use modmenu
theres modmenu mod for fabric
i mean i know how to code with java and have experience with other games making plugins, but i never dabled in minecraft specifically
import the library
fabric has a mod template in github
@dusty sphinx WHICH
Forge has a mod template you can download too
the buildtools output
fabric-example-mod?
Is nether enabled in server.properties
i think youtube is a pretty good resource
fabric apis are a lot more abstract
yes its a good template
@dusty sphinx Bro i already added it ..
I thought build tools may have assisted
there is no server.properties folder in server folder i have spigot.yml and stuff
@dusty sphinx I already added the buildtools jar librarryy
@coral sage Spigot also has one of the most beautiful javadocs ive ever seen, so you can also use that if you are confused: https://hub.spigotmc.org/javadocs/bukkit/
package index
@crisp arch No you can't. Error 404: No permission.
just get good
i cant see the logs i dont have permission for console
@thick gust well first of all you are using java 1.8 with 1.18
so update to java 17
just used multiverse and it can tp me to nether
@dusty sphinx For the love of god if some1 tells me once again i got to update to java 177 i will kms
but normal portals doesnt work
bro update java 177
1.18 is built against java 17 lmao
@crisp arch That's it where do u live?
Fuck you guys
Area51, meet you there 👌
maybe fuckin listen and youd get what you want
YOU FINALLY GOT JAVA 177!??!!
then set it as your jdk in eclipse
bro hes gaming
@sullen marlin can even send ss of my server file there is no properties
java 177
set it as your jdk in eclipse then
@crisp arch Shaddup dominos guy go plant some coconuts and pluck me bananas
@dusty sphinx HOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOW?!
You have access to the server files but not console?
i dont use eclipse how would i know
🙃
look it up
i do have ftp
It's done
~~jesus you have to edit an ini to change the jdk in eclipse 💀 ~~
I mean you don’t
Jesus it still does not work to fucking fix my errors
That’s the jdk for eclipse itself, not your project
import the class then
@dusty sphinx You gotdamn banana plucker stop say that
Ahhh welcome to Eclipse
^
dude literally just find the package the class is in and import it
Run buildtools with -- remapped and look at the maven info in the 1.17 spigot announcement
How I change my Java versionon of project?
Also no one is going to help you crash the client
^
@young knoll I won't look up a single spigot announcement again
Such plugins will get you banned from spigotmc.org
at least vsc would grab the right jdk, it doesnt even work with java <11 xd
@sullen marlin Besides that there are still plugins on Spigot which exactly do that XDDD
LEEEEYEYYYRRRRROOOOOOOOYYYYY!!!!!! JENKINSSS!!!
Simplier way I found before on 1.8
Make a 16 row inventory
Report them
#Crashed
thats my server folder there is no server.properties
@young knoll Nah i dont 😄
intellij users :chad:
Ankara best city @jade lodge
ty
Oh god there really isn’t
Look
For real now how do I change my Java Version for my project
And craftbukkit
gotta love it
Exactly
tbh in trying to see if i can move my entire java dev into vscode instead of relying on intellij
just as a proof of concept tho
Oh gos vscode
intellij still on top
This chat is hurting me more than usual tonight
vscode is fine its just... not as good? like its more than usable but youll still never catch me giving up intellij
as long as the gradle plugin doesnt shoot itself on me i should be fine
Look In HighTech most companies use Jetbrains for some odd reason when it comes to working around Java
since i use gradle... a lot
Visual Studio is the way to go
fuk dat
For a new project i could only use java 16
Ah
get it hooked up to Azure DevOps
Eclipse is uhh
good job
Heh...
easy
Update eclipse
AND REMOVE THIS WHITE NOISE COLOR
OMGG
You need a plugin from the marketplace for java 17
@heavy perch Stfu i dont waste my time doing it
wat
how can i see enable_nether command when there is no server.properties. multiverse can tp me but portals only giving me purple waves
GO TO PREFERENCES
Anyone know what event i should cancel to prevent fireballs from being flung by explosions?
if u mean the theme eclipses dark theme is still ass..
i gotta try out the microsoft toolbox i have never really gotten into it
which is weird because i love windows
I use the custom one's
this hurts
well i dont like windows
i fucking hate windows
but i love it
Better? @heavy perch
REMOVE BUTTOM TABS PLZ
That does not even make sense @dusty sphinx
windows is a steaming pile of shit but you gotta love it
when i build maven but i get no output uh help https://paste.md-5.net/arobuvulub.xml
You sign up to Azure for free and get access to most things for free even the machine learning studio and some basic VM servers
do u have the right spigot jar imported
eh fair
Just
USE
GRADLE
GROOVY
use ur mum
Fu
what the hell is java.version
Not helpful
oh sh-
thats not how it works anymore
HOW
do maven tasks work with gradle
'I'm having an issue with my Toyota'
Why can't I install java 17
your compiler config should look something like this, notice the single tag xml <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <release>16</release> </configuration> </plugin>
'buy a Honda'
bumb
"I got a Toyota Supra tho"
implying anything could even go wrong on a toyota
It's not helpful in the same way
those older tags havent worked since java 1.9
What about a Hy-un-dai
https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.18.1-R0.1-SNAPSHOT/ do i have to download every file here?
those shits will only die long after ur gone
you need to install a marketplace plugin for eclipse to use a jdk newer than 16
looks like an issue with the env vars, tried jar fix? fix's shit like this when I reinstal java all the time https://johann.loefflmann.net/en/software/jarfix/
Idk
my family is a hyundai shill, theyre pretty neat
@dusty sphinx I am using jdk 17 for eclipse.
very basic cars tho
Hyundai is good
@dusty sphinx Adopt ur mum
yeah
Offtopic though
lets move that talk to general
oh im not a car person
how the fuck did this turn into car talk
works, thanks
xDD
md referenced toyota and honda
@dusty sphinx Now what if i have jdk 17
yeah i know its just funny
i think md_5 mentioned soemthing about a toyota and a honda
@dusty sphinx There is no Java 17 available in eclipse when i create new java project and on official javala wabseit i just have 1.8 option to download
yeah just import the class now your libraries should load
dude for the last damn time i cant help you with that i dont know eclipse and i dont use oracle jres
You need a plugin
I already had jdk 17 when I had the problem like 20 minutes ago
I dont need a plugin shaddup xD
Unless there has been a new beta for eclipse recently
Eclipse does not support java 17 yet
@dusty sphinx fuck u then 😄
wait no something broke again
why is it saying ant
Executing pre-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Executing post-compile tasks...
Loading Ant configuration...
Running Ant tasks...
im so confused
Yo I know you guys are like deep in a discusstion but anyone know the event that triggers when a projectiles vector is changed by an explosion????
are you using intellij
yes
did you hit this button
anyone help me??
here let me show you
sadge
this doesnt run your maven build by default it compiles the project with whatever intellij does
lol regulad blocked me hahahahah xD
good you made a maven run configuration
I don't know for sure but EntityDamageByEntityEvent might be fired
now hit the run or debug commands next to it to use it
Calculating if a block is inside a certain region for every region created, Is that thread safe? Should I run it Async? It’s just checking the comparing blocks x y and z then comparing for every block in the region
i used the intellij Minecraft Development plugin but i guess i should know better, that plugin is full of bugs and inaccuracies
yea, i should make my own template
i did months ago
anyways, i click build and it just says
Executing pre-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Executing post-compile tasks...
Loading Ant configuration...
Running Ant tasks...
and then it ends
if theres anyone here that's familiar w/ pulling a large set of data from an sql server on ChunkLoadEvent into memory and then using that data then flushing it to the SQL server on ChunkUnloadEvent or onDisable can that person provide me with some guidance on how i would have to adapt my plugin to do this instead of just always pulling that data from the database only when its needed
Async mostly but must be careful Ig
i just dont know what the methods i need to use to call stuff into memory are, or how to differently handle that data than just pulling it from the database live
this is how i'm doing things currently https://gitlab.com/thomaslegan13/watchblock/-/blob/master/src/com/n0grief/WatchBlock/EventHandler/SQLLogger.java
GitLab I like
but for slower databases or ones not local it can cause issues because of the slower response time, i feel like storing the data with a chunk identifier and on chunk load pulling all the relevant sql data for that chunk and working with it in memory then flushing it back on chunk unload may be better
Every request you make, even if its prepared statement, you really should use Async
i was told async doesnt work with preparedstatements
Running SQL requests on main thread could take unreasonable amount of memory
It does depends on the case
Not sure memory is the issue
It’s gonna take the same memory either way
shouldn't be data that asks for more memory on the way
The problem is that it’s a blocking operation
there are certain cases where i cant and ofc by chance they happen to be the more intensive ones, like creeper explosion sql database has to query 20+ block coordinates all at once, on a local database no problem but i have some users that use remote hosted databases and their whole server freezes for a sec every explosion while the plugin fetches and compares all the data
Yeah don’t do that
but the sql operation HAS to happen BEFORE the creeper explosion happens for obvious reasons
Async get and cache
just turn off entity explosion block damage 😎
Pro
well the creeper explosion block damage is configurable in my plugin based on if the blocks are owned by people
@buoyant viper
Yeah you need that data already in memory
yep
Otherwise you have to hang the server while you fetch it
anyways the getting and caching of the data into memory is what i have no clue HOW to do
which would lag the sh! out of the server
was jus jokin
im aware thats the solution thats why im asking if anyone can provide me with some docs as to how to utilize it 🙂
- save it up into memory by containers.
- use YML which should never be used in this world at all.
- just pull that data on entity prime.
coming in late an seeing something about sql and slowness. is it slow to write to your sql server which is causing "lag"
youre making a region plugin?
just store it all in ram all the time
it is not much data
its a per-block protection plugin
I recommend depending on WorldEdit to work with cubids
does it really have to be per individual block
Are SQL writes blocking too? I assume yes
people arent gonna want to claim each block individually
cuboid regions are much more normal
yeah... this is a replacement plugin designed to mimic the exact behavior of a deprecated one
Yes
yes
Slow sql = right to local server file. Runnable updates SQL from FILE instead of blocking
storing it in memory is exactly what i want to do, i was just asking if anyone had the relevant documentation on how to do that and then how to handle that data as im sure its probably slightly different than handling it directly w/ the database
You can just write async
Calculating if a block is inside a certain region for every region created, I’d that thread safe? Should I run it Async? It’s just checking the comparing blocks x y and z then comparing for every block in the region
Caching and locations works different
It’s getting the blocks x y z
Think that region stores that location already inside a list for example
at the moment the only people who are actually having issues w/ the current way the operations happen are ones that are using sql databases that are not hosted on the same machine or local network as the server runs on but id like to implement something specifically for those use-cases just incase
You probably don’t want to do that async
it just streams over it
Because then you need to wait for the result
The Region doesn’t save the blocks
even the naive: for (region r : allRegions) inRegion(block, region) is plenty fast
And generally you don’t want to wait when doing block protection
It just saves the corners
you only gotta compare 2 corners
This isn't too bad
Ig
Yes but I use the other 2 to check if 2 regions will overlap
Agreed, but in some cases i found treating a file as a "transactional sql" sometimes worked better.
If any of the 4 corner block is inside a region the it is overlapping
I see what you say
Alright would do this thank you
2 corner
you only need two corners
the min(x,y,z) corner and the max(x,y,z) corner
Tru
@heavy perch sql is more than fast enough on its own to do what im doing on a playerbase up to like 20 or so players simultaneously w/o any noticeable performance loss but after that it DOES become an issue thats the only reason i'm wanting to figure this out now
Just do what MD says
How would I then check if two regions overlap without having to check for every block again? I mean yes I use only two corners but the other 2 I use to make it faster to check if the region overlaps
I think you already know the answer
but simply id use streams to check
Dog
dog
no, the image is actually reversed. it is goD
Lmao
Alright thank you. And we’ll it is the same Isn’t it? Using 4 corners?
2 corners per region
Ohh I get you now yeah my bad haha thank you I appreciate it.
Anyone know the maven dependency to make a 1.3.1 plugin?
Experimenting with very early versions of mc
quick question
what happens if i don't unrgister event listener instance?
does it auto unregister it?
when garbage collected?
why would you unregister? do you only want to listen for it during certain times on your server?
You generally don’t need to unregister
well i need to
nvm solved by other way
Then just do it?
well i didn't know when it is grabaged
but nvm i just came up with idea that doesn't need to unregister
As long as you unregister it it should be eligible for GC
Unregistering an event usually doesn't matter but only if you need the event to work at certain times
if (eventlistener.isActive()) {do something} else {don't do it}
unless the event is onServerTick() or something like that
HandlerList.unregisterAll(JavaPlugin)
its unregistered when your plugin is disabled
ouch, you can only unregister the entire plugin?
No
You can unregister the listener.
Still trying to find the maven dependency for 1.3.1 👀 god old stuff is hard to find
There are a few unregister methods
API or NMS?
GL
if you have the server jar just use that
if you dont have the server jar, then why do you need 1.3
why didnt i think of that
repo.bukkit.org is dead
lol
life saver 😂
bukkit in general is dead
um i know that
You said you needed to unregister the listener... so there you go lol
Alright here’s a question that’s hard to word
Does something like the guava cache exist where the timeout can be different for each entry
quava cache? are you talking a different garbage collection for different memory sections?
I have somehow made a 1.3.1 plugin work
Guava cache is a map implementation that support automatic expiry of entries
Time to write an entire core for 1.3.1
Among other things
:)
so a hashMap with an expiration date?
Pretty much
never heard of it in MC but can be implemented via event listeners for the "entry" being created and a runnable to check the hashMap to .remove().
I mean you don't really need that
It's very easy to wrap a HashMap<K, Box<V>> where the box has an expiration date
When attempting to get from the map, you see if the box has expired
Doesn’t solve my problem, because it stays in the map
The only downside is that they will hang around in memory until someone attempts to retrieve them
Yeah I guess
Yeah that’s the issue
It’s for a cooldown and I don’t want entries to just sit there
Oh
I've done that before
Just schedule it to be removed when you insert it
And use remove(K, V), not remove(K)
That way it will only remove if the value has not changed
I guess with cooldowns that wouldn't be an issue anyways, since you can't use an ability while it's on cooldown
Yeah basically
Either that or you make your own "garbage collection" for the cache, with the box approach
Where you periodically check all the values to see if they have expired
Yeah that would probably be better
It really shouldn't be a problem unless you have thousands of players on one server, which I really doubt you would
Scheduling a bunch of delayed tasks doesn’t seem ideal
Not just players technically, any entity
Hm
Realistically it will mostly be players though
Iterate and delete all expired every now and again
Alternatively just remove on PlayerQuitEvent, EntityDeathEvent, and ChunkUnloadEvent (all entities in the chunk should be removed)
Should be good enough™️
True, but the chunk may get reloaded
Are the cooldowns ever more than like 30 seconds?
I mean, honestly what's stopping you from using PDC here
True
That’s up to the user
Hm
I mean we can wring our hands about it all day but I really don't think it's going to make a difference how you choose to implement it
Yeah, it’s very niche anyway
Non-fixed length cooldowns
For anything fixed length I’ll still using the cache
hi hotties, idk what im doing wrong
trying to update my core plugin to 1.18, but im getting all errors
as in evreything bukkit errors lol
Did you read the release thread
So you saw you can't depend on the server jar
💀
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or use a dependency manager such as Maven or Gradle to handle this automatically.```
@vale ginkgo
Hi does ProjectileHitEvent get called if arrow hits a block that it doesnt collide with? Grass weeping or twisting vines for example. If not how could I detect it?
I already tried that
But it doesnt work 100% of the time
Only like 30%
Because sometimes the arrow travels too fast
So it skips the block
then try 0.5 tick
Then you would have to interpolate its motion between the ticks
That's not how this works lol
🙂
And how would I do that?
get position on current tick and previous tick
create a linear equation and check whether if it intersect a hitbox
Hello, I'm making my first plugin...
Color text work but I'm getting those weird characters, why ?
Screenshot:
https://media.discordapp.net/attachments/840393258554490902/920925403110072370/unknown.png
Code:
public class Events implements Listener {
final String SOUHAIT = "Amuses-toi bien sur §c§l§o§uQueebies World !";
Player player;
@EventHandler
public void onPlayerJoin(PlayerJoinEvent e){
player = e.getPlayer();
player.sendMessage(Bienvenue(player.getName()));
player.sendMessage(SOUHAIT);
}
String Bienvenue(String name){
return "§l§oBienvenue §o§2" + name + " §f!";
}
}
Use ChatColor
its gonna make the code long afff only for a little string. Is there another way
For example player#sendMessage(ChatColor.RED + ”This is a test”);
There is no other ways?
// player.sendMessage(colorize("&6Your name is &e"+player.getName()));
public String colorize(String s) { // Does not use hex colors.
return ChatColor.translateAlternateColorCodes('&', s);
}
gonna create a class tool.java and use this
thanks @stone sinew
very appreciated
👍
ok, this is about the 4 time in the last week and a half that i have done this. if anyone needs help testing a plugin with an actual player online let me know via a PM/DM/{what ever discord wants to call it}
@eternal night I see you too
some people don't. i have many so i am not worried about it
You could also just use offline mode for testing
you could but i am not going to subject somebody to that without knowing ALL of the issues behind that.
Not really an issue on a local server
still waiting for a mojang mapped client project that you can just run
or finding it xD maybe it exists
the sponge project ?
Otherwise just run forge or fabric with empty mods
oh shit
yea
the disadvantage of running around in the server all day xD
no clue about clients
How can I make a blaze immune to projectile damage?
cancel the event
How do i set the drops for a block?
List<ItemStack> drops = (List<ItemStack>) block.getDrops();
for (ItemStack i : drops) {
drops.remove(i);
plr.sendMessage(i.getType().name());
}
drops.add(new SpawnerFactory(plugin, spawner.getSpawnedType()).createSpawner());
i have this rn
Cancel ProjectileHitEvent
and the block drops are set to drop a spawner
I dont think it makes a copy
List<ItemStack> drops = (List<ItemStack>) block.getDrops();
i then modify that list
Ok, so i think it does create a copy.
How do i set the drops??
Use the blockdropitemevent
You can remove the old drops and then spawn your new drops
Or just change the type of the old drops
online mode = false have no issue other than clients joining, it just disable the authlib i think
how would i get the block from the block break event?
does modifying getItems change the drops?
Also the drops are item entitys, how do you convert a item into a item entity?
Removing yes
You cannot add to it
World.dropItem
oof, well then the blockbreakevent worked fine
cause spawners dont drop items anyway
the issue was that it might not work with telepathy enchants
so i was trying to set the drops of a block
is spigot patched for the latest CVE?
?exploit
aw
md used a fun command
Find information about the log4j2 security patches here: https://www.spigotmc.org/threads/spigot-security-releases-—-1-8-8–1-18.537204/
more specifically, is it 2.16.0?
read the last post down the thread
there is a new log4j vulnerability
read the last post down the thread
just rerun buildtools i guess
Could you help me with creating the linear equation? I havent made anything like this before with Java / Spigot
How do I keep an item frame from falling when it's not attached to a block?
maybe its the entityDamageEvent or something like that. Itemframes are entities after all. maybe the entityDeathEvent?
could cancel it
not sure on it tho
You can't cancel EntityDeathEvent
68 lines, 58 sonarlint warnings. This is what we call programming in style
Hello
Why when i try to spawn a bunch of items with nms, they get despawned ?
but you can spawn an entity you set to be the exact same as the dying entity
hi guys, i'm trying to code something to be able to click on a player but with distance.. so my idea was to right click in the air with a interact event and shoot a projectile, but i need to make the projectile invisible and that seems impossible, do you guys have any idea how to do that ?
Does that even have anything to do with the issue?
i think bukkit has a raycast method u can use instead
i just dont know where it is
i know how to change tablist header and footer with nms
but how to change the player order in tablist ?
it goes by the game profile name
see RayTrace Class
does anyone have a really good sqlite guide, I can generally have sqlite functional but I don't like my implementation and feel like there has to be an easier way
but, MySQL would be easier
I'm happy with sqlite for now
hm this is already fairly similar to how I currently do it
if it aint broke dont fix it
it ain't broke but it is also a pain to extend functionality for
man
adding columns is actually not very fun huh
looks like sqlite doesn't natively have a way to add a column if one doesn't exist so you just shotgun tables into it and handle errors when it turns out they existed
a bit dumb
seemingly the only way to really do it almost 100% natively would be to version the table itself and then add based on the version which is also not amazing
can't you attempt to access a table to see if it exists, before 'shotgunning' a new one into it?
*column
not directly with a statement, it requires a workaround
try{access} catch(...){interject}, wouldnt that work?
the issue is you can't do it using sql statements even though IF NOT EXISTS exists for checking if a table exists
which is just annoying
I need to start generating the tables modularly because the more things I track the more torturous the code gets
stuff I do can be hardcoded... today
MySQL
I'm not going to switch to mysql just because you put the letters in bold
not to mention mysql afaik has exactly the same issue
I found that luckily for my purposes i can use player PDC
sqlite is useful, but I find the statements to not be very fun to work with and it is not easily extensible once you already have data going
well, by default anyway
I'm sure you can construct something around it to make it easier to deal with
to be fair it will be a nightmare to get the data from the PDC in a readable format
choose depending on situation i guess
sqlite is easy enough to explore with the right software
also has the advantage of being very easy to backup
and restore
and move
i'd just use pdc for small data
i dont
what are you saving?
eh well
i have an item based magic system in the works
im storing the number of items (as int) each player has used
in the player?
and then like twenty or so extra variables
like effect time for long lasting effects
since this isnt something admins need to see it's not too big an issue either
it can be checked per player, which is enough
minecraft effects?
ah that would be really simple otherwise
is there no way to make a custom effect by extending the effect class or something?
lets not remap my spigot api
Exists a event
Is there an event when a cactus is broken by a block?
I think it's BlockPhysics
its probably block break, physics update, or block place
Or something similar
quick question
does InventoryClickEvent .getCursor() returns cursor after inventory handling (e.g picking up the same type to cursor) or before the calculations?
when an event is Cancellable its pretty much always before
what are you trying to achieve
since i don't need to resend the inventory packet
im trying to recalculate pickup all cursor with some exceptions
basically im simulating pickup cursor action, but i don't pickup all the items which are in specific array (GUI)
Hi, could someone tell me if it's possible to get the current join and quit message outside of the quit and join event?
hey, im trying to add some aliases for some commands, and i would like someone to answer this question
can i make an alias for commands with arguments? like, if i have a command that is /command one and another one that is /command two and i want those aliases to be something like /1 and /2
is that possible to do? with the options available on the commands.yml file
im afraid not with the options in commands.yml
Is there a way to check if an item has been destroyed with an even ?
I've tried #EntityDamageEvent and #EntityDeathEvent
both dont seem to work
So like throughing an item into fire or so would trigger it ?
ItemDespawnEvent maybe?
ok, thanks either wya
way*
you could of course make another command, and just make it run the one with args
doesnt trigger when the item just gets destroyed
well if you throw an item into fire EntityCombustEvent will be called
It was an example, I'd rather have it be called whenever an item is destoryed
But I might need to use multiple events to get that result
idk what u have tried but EntityDeathEvent should work for that
I'll try again, but it didnt work the first time around
Oh might not have worked cause I have an error in my code preventing the plugin even being loaded, well damn
:D
EntityDamage works, EntityDeathEvent aparently not, damn
EntityDeath only works for living entities then
makes sense since the only enity it returns is a living instance
then ur gonna have to use multiple events to get the desired outcome
think so aswell
Is it possible to disable block collisions for a specific entity? (I'd also extend some nms Entity if needed)
it should be possible, but not for player connection driven player entity via Pathgoals but im not sure how to utilise those to achieve what you need
i'd rather use packet entity, since those do not tick, and could clip through the walls just fine.
I want some hostile ArmorStands to be able to go through walls and control their movement via setVelocity
Entities have a noClip or noPhysics option
Well their NMS internal representation does
Already set the noClip value to true, but that had no effect
What do you mean by that?
NMS Code works just fine if your plugin is compiled by Java 8 🤔
Wait a second i will post the error
cannot access net.minecraft.world.damagesource.DamageSource
bad class file: C:\Users\opkar\.m2\repository\org\spigotmc\spigot\1.18-R0.1-SNAPSHOT\spigot-1.18-R0.1-SNAPSHOT-remapped-mojang.jar(net/minecraft/world/damagesource/DamageSource.class)
class file has wrong version 60.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
[INFO] 1 error
[INFO] -------------------------------------------------------------
1.18 requires java 17
So you can't compile it with java 8?
it will not run on a lower java version
if you really want. u can just compile the 1.18 server on java 8
and it will work :D
You can compile it to Java 8, but you still have to use Java 17
Okay, how I can do it?
Are we talking about a plugin, or the server itself?
just install a newer java 5head, java 8 is hold af and slower
^
Plugin
-
Something like this?
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<target>1.8</target>
<source>1.8</source>
</configuration>
</plugin>
...
in pom.xml
uhh, no
you just need to install a never java
your plugin can still compile on java 8
if you want
I have java 16 and 17 downloaded
Java version: 1.8.0_312, vendor: Amazon.com Inc., runtime: C:\Users\opkar.jdks\corretto-1.8.0_312\jre
ye
Bc I use it it project
If you're using IntelliJ with maven, go inside your pom.xml and edit source and target
<source>8</source>
<target>8</target>
After this, go inside your Project Structure menu, go to Project and set Project Language Level to 8 (Also select a Java 17 JDK, otherwise you still won't be able to compile)
After that you should be fine
if you want to run a 1.18 server im pretty sure you're going to set your environment variable path to the correct java version
Yeah, I can't on java 1.8
Or just use the full path everytime 🤔
you can just launch the server with the path to java 17 dont need to change env vars
yea or that
omg.
I made it before the other way round that I set jdk to 8 and java version 17 ._.
But thanks anyways 😛
💋
I have an Entity and i want it to always look at the player. The problem is, i want it to be individual for every player, so the player sees the entity facing himself. Is there any easy way and if so or not, how can i do that without using libraries?
You want an entity to look at a player, but from the view of every player it is looking at them ?
So like we have 2 players, and both see that the entity is facing the player ?
Yes
I think you'll need Protocollib to send the rotation info of the head individually to each player
Step 1 out of i dont know how many in writing a Rust wrapper for all Bukkit APIs, I have automatically generated a JSON structure for a jarfile containing all methods and such 😂
do you all think a auction house plugin would be hard
shoulnt be too difficult
Is it possible to have one player see blocks but gave them not be there for another player
How?
An example of the produced json: https://paste.md-5.net/rofatuhiyo.json 😂
i wish you lots of luck & patience for this project :)
Halfway there luckily :"D
Now it's time to build a Rust program that takes this JSON, and emits JNI wrappers
How do you guys think i can make an auction house plugin
like basic ideas,,etc
to store the items andstuff
You probably want a database
do i use sql or smth
SQLite is a good option
whats the benefit of using SQlite over normal storage
is it some reason to use §x§5§5§F§7§5§5 ? instead something some are both human readable and easy to type?
That’s the default spigot format
But you can always implement your own
Or use adventure or whatever
I know it is spigot default 🙂 but the question are way?
I modify the method to accept other hex format (no issue), I mean Spigot self not use it when parse the hex (use mincraft format/standard hex format).
Is only used when it go thru the char´s in the for loop and never use §
That symbole was chosen a long time ago
Failure to find org.spigotmc:minecraft-server:txt:maps-mojang:1.18-R0.1-SNAPSHOT in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of spigotmc-repo has elapsed or updates are forced
Im building with md_5's mojang -> spigot remapper but i get this error
yeah but is no point use §x§5§5§F§7§5§5 when mincraft self accept #hex. I accept first § but the rest are not needed at all.
It does?
You sure
He could do like §xhex
yes I copy TextComponent and test my self
Could someone help me understand what this error means? I thought I understood but it seems I was wrong...
in 'string', line 41, column 6:
Use: true```
The weirdest bit here is that it's pointing me to a piece of code that I haven't changed in ages. (not included in what I sent here, I just thought I should mention that)
this is orginal method, it jump over the § and only use the numbers so it parse #55F755
if (c == 'x' && i + 12 < message.length()) {
StringBuilder hex = new StringBuilder("#");
for (int j = 0; j < 6; j++) {
System.out.println("hextest " + message.charAt(i * (j)));
hex.append(message.charAt(i + 2 + (j * 2)));
}
try {
format = ChatColor.of(hex.toString());
} catch (IllegalArgumentException ex) {
format = null;
}
i += 12;
Run your yml through an online parser
Yes ChatColor.of is designed to parse #rrggbb
That’s what it’s for
yes but I mean the method self 🙂 You don´t need make it so complicated. I can easy remade it s you only need type §x55F755. thats way I ask way made it like it done here?
Oh... I figured it out lol.
bump
Have you run BuildTools
yes
im trying to run md_5 specialsource, because i used spigot remapped mojang
Kind of curious, why does Bukkit rely on Eclipse Aether, an already archived project, not updated in a while?
hey everyone, I'm trying to create my first big plugin and I want to allow some bungee cord features (like staffchat, sending to servers, /hub, /report, etc.). do I need to create an entirely separate bungeecord plugin or is there a way I have this functionality with a spigot plugin? i've never used bungeecord
You need a Bungeecord plugin for most stuff. Basic things can be done without
Read this ^
i used spigot remapped mojang, now how do i remap it back?
okay, thank you!
The maven plugin will take care of it
do you know when i would register a bungeecord command over a spigot command? like what's the difference?
Register where you need it
Should it be on the server or on the proxy
It's up to you
nope i get an error
md_5 says i need to remap
alright, thank you
Anyone has an idea of what database should I use to store my Player auctions? im making a plugin
MySQL
or if you dont want to host an sql server, SQLite3 works
ok thanks ill do that
the internet is a good place to start ;)
Is there a link anywhere on supplying placeholders with PlaceholderAPI? Their tutorial only shows how to use default ones
It's the same for every placeholder
Im trying to make my own not use the vault_rank and player_name default ones
but i think i found something
What could be a reason why Entity#teleport literally does nothing at all?
Something cancels the teleport event
And what if there's no plugin installed with any TeleportEvents? 😅
if i store a player variable somewhere and the player disconnects, if i try to send a message to him, it will simply do nothing, right?
Don't store player object
it may throw illegal state exception
i will reutrn a nullpointerexception
mb
well not return
but ya
just stop storing the player when he disconnects
From what I know, the implementation will turn some of its internal variables to null
How do i get the player who was hit by a projectile
Which in other words mean that the object is no longer 100% safe to use
Storing it may also implement a memory leak
Provided that ::getHandle does not return null
what exactly do we mean by storing a player variable is it just what it sounds like
I mean like the instance
Keeping a reference on player w field or smth
Yuh, any strong reference basically
ok so ive been doing that a ton but stopping when disconnected bc when i go to reference players i dont want to parse the uuid of every one wouldnt that hinder performance or no?
Performance as no memory leaks or speed?
what kind of memory leak would arise i am genuinely not educated
Well a memory leak just means there’s an object which no longer is strongly referenced or generally has no real reason to be used, however it cannot be collected by the garbage collector.
I mean you have to work hard to get a memory leak by accident
But yeah
Also about the parsing
So if I have no reference to the player after he disconnects
Is that ok theN? but continue
Do you mean Player -> UUID or UUID -> Player?
Yeah just a thread safe HashMap essentially iirc
Stop prematurely optimizing if you don't know the actual computational cost
would have to check players to then see what team they are in player->uuid then to check teams members
idek whereim going with this
Me neither lol
But yeah, usually we do the optimizations after fiddling stuff into work
wowoyoyuhi
At the stage when you see bad performance
That sounds like a smart way to work
Or if you know in advance that something is expensive
And then of course there’s this non functional requirement that your software should be fast
But you shouldn't assume without knowing
Which is hard to tackle
So make it a functional requirement by setting a requirement on the speed
Like, I want this to work fine when the server is at 500 players
how do you know how fast your plugin is running
You can look at timings
Indeed
How to send enderdragon to specific client
yeah packet entity
how to reindex in intellij?
what about with NMS
I don't want to use additional dependency
🌝
Yeah its only for one version
and pretty much every server uses protocollib
I do not plan on updating
I've tried this
final EntityEnderDragon entity = new EntityEnderDragon(world);
PacketPlayOutSpawnEntityLiving spawn = new PacketPlayOutSpawnEntityLiving(entity);
((CraftPlayer)p).getHandle().playerConnection.sendPacket(spawn);```
but it doesnt work
intellij says cannot resolve method about a method i just defined in another project. Ive restarted the IDE already and still spitting this
Oooo 1.12
nvm
Yeah how do I send it
i didnt rebuild
another project you mean
literally another project?
yea i got it i didnt rebuild it
if yes and you are using maven/gradle to use that, update it on the maven
oh yea im a nub and dont use those
congratulations
im not saying that to be that guy
Four words:
Use proper build tool
i actually just donrt know how to lmao
what events do i need to listen to in order to protect an armorstand completly?
atm i only listen to EntityDamageByEntityEvent and EntityDamageEvent
PlayerArmorStandManipulateEvent
Cant you Just armorstand#setInvulnerable and addEquipmentLock on all slots?
Hey guys, glad to have found this discord. I'm just getting started and trying to add a custom item. I am adding it like so.
enderBagItem = new ItemStack(Material.ENDER_EYE, 1);
ItemMeta meta = enderBagItem.getItemMeta();
But this seems to be inheriting the actual behavior of the ender eye as well as the appearance of it. How do I tell it just to use the sprite of the ender eye, but remove any right click events for it?
i don't think there is a setInvulnerable
Hi am trying to make a poison bow so i am using the entitybowshoot event and then get lore of the bow if it is Poison I. But idk how to get the player that is shot and then give that player poison
There is
How do you take off ul,bold,italic etc without removing the actual color? Or is there maybe some kind of previous color?
Hey, I want copy blocks from other location to a other location, but how?
place the color after decoration
Adventure 😌
or use adventure smg
Can you link? i cant find that
got it thanks
Im coding Bukkit in kotlin
and it says that broadcast message is deprecated
what does that mean
- You are on paper
- The deprecation note literally says you what to use instead
Wasnt meant thst paper is bad
idk what deprecated means
it means its an old way of doing something and is (usually) planned for removal @mighty sparrow
yeah paper is phasing out a lot of bukkits api for text-related things in favor of their own with kyoris adventure lib
?
and paper will probably mark their deprecations to for removal as soon as the hard fork happens.
if not already done that is
Location::getBlock then just Block::setType
Idk how you get your locations but yeah thats 'bout it
i know, but not whif the locations
kinda sadge tho, wouldnt a for removal actually lead to paper not supporting a lot of bukkit/spigot plugins?
yes, but I mean thing is, minecraft itself stopped using raw strings a long time ago, so arguably its for quite justifiable reasons.
alternatively ye
yeah. However, the hardfork is far away. I think they would do it when paper would have enough big community
yeah, gonna get hangar up running first 😛
isnt that for sponge?
is it?
or is it paper+sponge
Paper+Sponge
ya
16.12 19:45:35 [Server] Startup18:45:35.590 [luckperms-hikari housekeeper] DEBUG me.lucko.luckperms.lib.hikari.pool.HikariPool - luckperms-hikari - Pool stats (total=10, active=0, idle=10, waiting=0)
16.12 19:45:35 [Server] Startup18:45:35.590 [luckperms-hikari housekeeper] DEBUG me.lucko.luckperms.lib.hikari.pool.HikariPool - luckperms-hikari - Fill pool skipped, pool is at sufficient level.
16.12 19:45:47 [Server] Startup18:45:47.400 [AL-MySQL-Pool housekeeper] DEBUG com.zaxxer.hikari.pool.HikariPool - AL-MySQL-Pool - Pool stats (total=40, active=0, idle=40, waiting=0)
16.12 19:46:05 [Server] Startup18:46:05.590 [luckperms-hikari housekeeper] DEBUG me.lucko.luckperms.lib.hikari.pool.HikariPool - luckperms-hikari - Pool stats (total=10, active=0, idle=10, waiting=0)
16.12 19:46:05 [Server] Startup18:46:05.591 [luckperms-hikari housekeeper] DEBUG me.lucko.luckperms.lib.hikari.pool.HikariPool - luckperms-hikari - Fill pool skipped, pool is at sufficient level.
16.12 19:46:17 [Server] Startup18:46:17.400 [AL-MySQL-Pool housekeeper] DEBUG com.zaxxer.hikari.pool.HikariPool - AL-MySQL-Pool - Pool stats (total=40, active=0, idle=40, waiting=0)
16.12 19:46:35 [Server] Startup18:46:35.591 [luckperms-hikari housekeeper] DEBUG me.lucko.luckperms.lib.hikari.pool.HikariPool - luckperms-hikari - Pool stats (total=10, active=0, idle=10, waiting=0)
16.12 19:46:35 [Server] Startup18:46:35.591 [luckperms-hikari housekeeper] DEBUG me.lucko.luckperms.lib.hikari.pool.HikariPool - luckperms-hikari - Fill pool skipped, pool is at sufficient level.
16.12 19:46:47 [Server] Startup18:46:47.401 [AL-MySQL-Pool housekeeper] DEBUG com.zaxxer.hikari.pool.HikariPool - AL-MySQL-Pool - Pool stats (total=40, active=0, idle=40, waiting=0)```
Console is just being spammed with these debug msgs, please help me
Sponge decided to use Hangar because Ore is written on Scala, and that scares contributors
How can i be sure my papi extension will load after my plugin?
ah fair enough
depend in plugin yml i think
?scheduling
no one is there
patience young one
and this channel isnt for server issues
Ive been following their tutorial on their site and Im not extending javaplugin so will a plugin.yml do anything?