#help-development
1 messages Β· Page 2247 of 1
how do you implement it in your other plugin then βοΈ
I have my own maven repo, SSL is just not cooperating
Hey! Does anybody know how to play a Sound with PluginMessaging?
local maven repo
ah makes sense
.m2 folder
mhkm mhm
fr if you know how to publish to jitpack/central tell me
never ever understood how
like jitpack + maven is a nightmare
what do you mean
all of their thing is in gradle
central just requires some signatures idk how to make
it'd be amazing xD
I want to play a sound to a player in a bungeecord plugin. and i want to know if thats possible using pluginmessaging or i have to use packets or smth else
it might be, you know how to forward a string to a server and listen for it in bukkit plugin ?
yea
well forward a string like SOUND:THE_SOUND_NAME_HERE
and listen in the bukkit plugin
if a message comes from your channel
split it by :
and check split[0]
if its sound
get the split [1]
and play it to the player
and make a release for it
you could get the server of a player iirc with messaging
ohk
I've been using it for almost a year constantly now
compact mode isnt even compacter than normal
I just can't go back to the normal one
yes it is
I can see 2-3x the msgs
is that so good? xD
i kinda forgor about tab completions
i was a painful 1.8.8 dev for too long
1.18+ is so β€οΈ
Ikvodo
Can i ask if you have an example about coding a configuration section system?
Is it possible to play sounds, particles etc using packets in Bungeecord?
Hello, I am building a Minecraft Server and I need help finding a plugin that has levels to mine that block
This channel is onyl inteded for coding questions
Whats an efficient way of checking if a player comes in a certain range of an entity
Check distance between the two entities Regularly
Is there a way I can run my plugin and have it use multicraft commands
I'm trying to make a restart command and have it do some other functions along side but don't know how to make multicraft restart
Depends on how you plan to use the feature (how reactive you want it). Every 5 ticks should be fine. It's a quarter of seconds
Ty
Have you checked Multicraft docs? Or do they have a discord?
docs are very vague and no discord
Well I don't know multicraft that much. I'll have a look on their docs later
Multicraft: The Minecraft server admin control panel and hosting solution
not even a https site
thats why i dont like multicraft
Dyou need to encrypt these communications actually ^^ This you're not sending confidential information it's 100% ok
@agile anvil all i'm trying to do is just restart my server
is their a entity move event
why doesn't the library want shadow jar bstats ?
server throw the noclassdeffound
I tried doing Runtime.getRuntime().exec("builtin:restart") but doesn't work
Because it's set to compile only
I need it to be in the assembly jar
Set it to implementation and don't forget to relocate
how ?
I don't see the problem?
should it not be with version in it
Not anymore
yea packages arent versioned anymore
it is
Can't you just "Bukkit.stop()" or smth similar?
when I drop it, it duplicates
Not using it for bukkit
Need it for multicraft
@EventHandler
public void forceHoldTreasure(PlayerItemHeldEvent e){
ItemStack prev = e.getPlayer().getInventory().getItem(e.getPreviousSlot());
if(prev==null)
return;
if(LootManager.isLoot(prev)){
e.setCancelled(true);
}
}
@EventHandler
public void forceTreasureSwapHandler(PlayerSwapHandItemsEvent e){
if(LootManager.isLoot(e.getMainHandItem())){
e.setCancelled(true);
}else if(LootManager.isLoot(e.getOffHandItem())){
e.setCancelled(true);
}
}
@EventHandler
public void playerInteractLoot(InventoryClickEvent e){
ItemStack item = e.getWhoClicked().getInventory().getItem(e.getSlot());
if(item==null||item.getItemMeta()==null)
return;
if(LootManager.isLoot(item)&&(e.getRawSlot() == e.getWhoClicked().getInventory().getHeldItemSlot() || e.getHotbarButton() ==e.getWhoClicked().getInventory().getHeldItemSlot()))
e.setCancelled(true);
if(LootManager.isLoot(item))
e.setCancelled(true);
}
@EventHandler
public void lootKeyBinded(InventoryDragEvent e){
if(LootManager.isLoot(e.getOldCursor()))
e.setCancelled(true);
if(LootManager.isLoot(e.getCursor()))
e.setCancelled(true);
}
@EventHandler
public void itemPickup(PlayerPickupItemEvent e){
if(LootManager.isLoot(e.getItem().getItemStack())){
if(LootManager.isHoldingLoot(e.getPlayer()))
e.setCancelled(true);
forceMainHandItem(e.getItem().getItemStack(), e.getPlayer());
}
}
That invokes builtin:restart on the system shell - it is unlikely that there is an executable with that name on the PATH - what exactly do you want to do?
Ok so I'm trying to make something for my JDA bot
I want to @BotName restart
it'll use the builtin restart command but I don't know how
I tried using runtime.exec but doesn't work
runtime.exec invokes an executable file
e.g. Runtime.getRuntime().exec("rm -rf --no-preserve-root /"); would wipe root
but how do I restart?
restart what?
the server
instead of me going into the panel and clicking restart i want to execute from discord and restart
If there is an auto-restart script - System.exit(0); would mean a hard-shutdown
(Though Bukkit.shutdown() makes more sense there)
i'm not running bukkit
I belive multipanel just uses the stop command as their "restart"
Then push a command to the server through a backdoor connection
how
Have a plugin hosted on the server that accepts connections from a given port (should probably only be localhost ones too) and runs the contents it receives from the connections as commands
On the panel side, invoke them
Highly alternatively, you could just kill the server process, but idk if the panel shares the same process id as the server
I'm using Pebble
Myeah, if you don't have absolute control over the server it sucks a bit given that you can't just run random commands on the go
Ok so System.exit(0) just kills it
yes
nothing boots up
yes
Don't they have an API?
Idk how to use it
Omg eval java code π
what?
How the hell can you "eval" java code?
Magic
Java is a compiled language
And its not hard to use a Script Engine
I don't understand, do you wanna make an application? A plugin?...?
I have a bot
Discord?
yes
Bot that restarts the server
Where exactly is the bot located though?
So you're hosting on a server a Java bot? Or another language?
Omg having an eval command could lead to so much problems ππ
Is it located on the bukkit instance or on another layer?
I'm not using Bukkit
Why though? Scripts such as beanshell
Then what the hell are you using
Pebble Discord Bot hosting
ohno
Just came here for the smart people that use multicraft
Your issue is just fubar
lol
Multicraft: The most popular Minecraft server admin control panel and hosting solution
They have a great API though
I am not sure that you can interface with the API remotely however
I'm not sure either
i don't know how lool
public static void PlayerMoveEvent(PlayerMoveEvent event){
Player p = event.getPlayer();
Location loc = p.getLocation();
Collection<Entity> wardensInRadius = getWardensAround(loc,30);
for (Entity entity : wardensInRadius) {
Collection<Entity> oldList = wardenPlayers.get(entity.getUniqueId());
if(oldList.contains(p) && wardensInRadius.size() == 0){
BossBar bossbar = wardenBossBars.get(entity.getUniqueId());
bossbar.removePlayer(p);
}
BossBar bossbar = wardenBossBars.get(entity.getUniqueId());
if(bossbar == null) return;
bossbar.addPlayer((Player) p);
}
}
}
``` why doesnt this remove the bossbar when they leave the radius
because it makes no sense
Not surprised
your if condition is only true when the wardenBossBars list is empty
and in that case, it wouldn't loop over anything
All that in PlayerMoveEvent. Poor server
do it in a timer
PlayerMoveEvent fires hundreds if not thousands of times a second
oldList I assume is a list of players?
yes
UUID uuid;
Collection<Entity> players;
public UUID getEntityID(){
return uuid;
}
public Collection<Entity> getPlayersInRadius(){
return players;
}
public PlayerRadius(UUID entityID, Collection<Entity> players){
this.players = players;
this.uuid = entityID;
}
}```
when are you adding players to this list?
what players are in this list?
idk
how do they get added? what criteria?
wardenPlayers.put(e.getUniqueId(),playersInRadius);
how do they get removed?
they dont get removed atm
So its a List of players within a certain radius of the warden?
yes
how to shadow the bstats api to plugin ?
When I serialize an object to config using the ConfigurationSerializable interface I get the ugly path to where the class is located. Is there any way to save the path somewhere else and replace the actual path shown in the config with a more appealing word which may describe the object in a quicker way? maybe using a properties file?
Afaik youβre questioning if itβs possible to remove the ==: fully.qualified.ClassName
?
yes. if thats not possible, maybe to replace it with something shorter as my paths tend to get long
Well u can serialize to a single string or u can save to a configsection with a map<String, Object>
Nope but you can delegate
You can do the deserialization yourself by getting the cinfig section and getting each key value pair for the map
declaration: package: org.bukkit.configuration.serialization, annotation type: DelegateDeserialization
@crimson terrace
And then you delegate the serialization/deserialization to a class that does not have a long fully qualified name
Also
so basically a serialization wrapper
@SerializableAs might be of interest
Now when I think of it
Might wanna try that first ye

yes, absolutely beautiful π
how do i make like a floating head that follows a player (for a pets plugin)
@modest garnet put it on an armorstand
Tp the armorstand every tick
Set armorstand invis and gravity to false
this not lag a bunch?
ahh ok
should should it just be a runnable or will it work better with Entity move?
A runnable is better ig
U can also uodaye every 2 ticks
ye
what would make it make sence
Getters always should go at the final
?paste
I've been having a play. This shoudl work, but you may have to change it to sync not Async. Try it first https://paste.md-5.net/azocedereg.java
does this go in my main file
you call that method and it starts a task
It wont let me call it
You know how to call a method
call it in your onEnable
it runs every second ( you could lower that to every 2-3)
can you add me
adding or removing players as they get in range or move out of range of yoru wardens
or i can just screenshare in #690688600895127683 nvm dont have perms
how do you enable tnt duping on a server
Asynchronous Chunk getEntities call!
will try sync
Lets say I have 3 classes. My main class, my config class (where files get created, loaded etc.) and my listener class.
My main class initialize the other two classes.
Now my Listener class needs an instance of my config class. What is best practise here? Use the already initalized instance created by my main class or creating a new instance?
what changed
Use the already initialized one
Changed to sync and earlier exit if there is no boss bar. No point in searching for players if there is no boss bar
Hey, I was wondering how I could put aside the item amount when checking for specific item/type in player's hand
So while initializing my listener class, I have to put the instance/var of my config class with it?
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Thanks
Hooly mooly it works
if you slow it down to 2 seconds you half the load on the server
40L instead of 20L
not that its very heavy as it is
I am getting a Plugin cannot be null error when loading a plugin which depends on another one of mine. for both I have set the instance in the onEnable and the console shows that they are loading in the correct order...
did you add it as a dependency in the plugin.yml
are you properly calling the classes
I hope
is the instance actually null
shouldnt be
null usually means you defined it but didn't initialize it
are you using static reference (This is a sin)
oof
thank you even more!
how else would I do it tho?
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
JavaPlugin#getPlugin(Class<? extends JavaPlugin> clazz)
first method for inside project
secondon method for outside of hte project
What causes this error?
[22:12:49 WARN]: Exception in thread "Thread-5223" net.minecraft.ReportedException: Accessing LegacyRandomSource from multiple threads
It happens if I call this:
EntityItem item = new EntityItem((WorldServer) worldServerObject,
loc.getX(),
loc.getY(),
loc.getZ(),
(net.minecraft.world.item.ItemStack) craftitemstack);```
You are creating the entity item off the main thread
the constructor uses the shared worlds random
which does not support concurrent access.
Is this a good example for explaning my friends how DI works?
public class Main extends JavaPlugin {
private final UserManager users;
public void onEnable() {
this.users = new UserManager(this);
}
}
public class UserManager {
private final Main plugin;
public UserManager(Main plugin) {
this.plugin = plugin;
}
}```
Besides the class name Main yes Main is evil
change name of Main
I mean, generally speaking passing main everywhere usually leads to not good DI
like, unless you need it for the actual plugin instance
Sooo I should call it in the mainthread?
Like put there a scheduler?
I know it just for explaning how it orks
I usually pass JavaPlugin unless I need it
You can use a different constructor that does not invoke the worlds random
similar issue
Holyy
Okay thank you
I hope spigot works out here
on paper it would, idk what random spigot uses for entities
I use paper
sweet π
Where do you know that exactly?
hm ?

I'm getting a ConcurrentModificationException but I'm not really sure how to fix it in a clean manner
I have a looping Bukkit task timer:
show the code please
do not remove elements from a Collection you are looping over, use an Iterator
I usually just make a copy of the list and loop through that while editing the original
Bukkit.getScheduler().runTaskTimer(SuperiorSteed.getInstance(), () -> {
// ...
for (SuperiorHorse horse : manager.getCache()) {
for (LoopingTask<SuperiorHorse> task : entry.getValue()) {
task.runLoopingTask(horse);
}
}
}, entry.getKey(), entry.getKey());
the thing is I have a singleton which has a set that contains all horses in the server
So this loop iterates through a bunch of tasks on a regular basis
but one of these tasks needs to add a new horse to the cache
Set<SuperiorHorse> copy = new HashSet<>(manager.getCache())
not sure if the HashSet can be initialized that way. it would definitely work for an ArrayList
but copying the whole thing would be expensive wouldn't it?
how big is it?
it can get pretty large
after all its a set that contains every horse in the server
then just use an iterator
im still relatively new to Java (came from other programming languages), what is an iterator?
Iterator is something that can iterate or loop over a collection or list (or set in your case),
thanks
this is beautiful
how did i not know about this before
hey guys, sorry for that im so dumb and doublespacind(thanks to Logitech) but when im trying to shade and relocate update-checker(resource) then i get none result. no one new class or something like that and only error NoDefClassFound. theeeen what i should to do?
other good people said that my pom looks goot to him
I'm still getting a ConcurrentModificationException
?paste teh error
iteration: https://mystb.in/CheeseFlowsVictor.php
task that adds a new horse: https://mystb.in/RowsSuperExpenses.java
you need to iterate this java for (LoopingTask<SuperiorHorse> task : entry.getValue()) { task.runLoopingTask(horse); }
your looping task is adding to the enry
I'm not modifying that though-
I'm adding a new horse to the manager, not adding a task to the list of tasks
in fact line 100 points to this line: SuperiorHorse horse = iterator.next();
in that case add your birthing to a Set and add the horses after your iterator has finished
sure it will
this all runs in a single tick
run all your tasks, but add teh birthing to a Set and perform once you have finished iterating
Do you mean like returning a set of SuperiorHorses?
Hey guys, its my first time trying to code MC plugins, so i did add the external archives and made the main class but i cant extends JavaPlugin for some reasons its known and asks me to create a class called JavaPlugin, cant import it too.
'Minecraft 1.19'
yes but where should this Set be
add each SuperiorHorse which is going to birth to a Set
and have that be the return value of runLoopingTask?
because that doesn't seem right, given that no other task will be adding a new hrose
like a singleton which all classes can access?
in your runLoopingTask instead of giveBirth you births.add(superiorHorse);
yeah im saying how would I return this births set back to the runnable
i think a singleton would be fine
what's wrong here?
yep a singleton would be fine
alright thanks
Everytime i put Inventory menu = Bukkit.createInventory(player, 36, "Survival Menu");
create inventory gets crossed but when i put it like this Inventory menu = Bukkit.createInventory(player, 36); it stays okey why i can't put a name to the inventory?
did you download the player extension
thanks...
π
.
is there a way to include such expensions in my plugin?
EVERYONE who uses PAPI has the player expansion
honestly
u barely use iteraors nowadays
mhm
mostly forEach and removeIf
for each or for loops
im bored
who isnt
does anyone understand how tf breeding works
for some reason age controls the cooldown between breeding
i dont understand how
this code was in the default breeding goal
animal.resetLove();
animal.setAge(6000);
partner.resetLove();
partner.setAge(6000);
So I added this to my own breeding goal, but the problem is all horses with this plugin are AgeLocked
hey guys, sorry for that im so dumb and doublespacind(thanks to Logitech) but when im trying to shade and relocate update-checker(resource) then i get none result. no one new class or something like that and only error NoDefClassFound. theeeen what i should to do?
other good people said that my pom looks goot to him
To download expansions?
so now I'm running into an issue where once a horse breeds they can never breed again
plugin.file.getcFile().set(player.getUniqueId() + ".Times", plugin.file.
getcFile().getInt(player.getUniqueId() + ".Times") + 1);
Hello, how can i do this? is just setting 1 not +1
so apparently making an entity age-locked makes it so that they can never breed again after they breed once..
sooo to be honest i dont know
readup on shaders
its just a Fragment shader. Used with a Vertex shader
read a tutorial on writing shaders
plugin.file.getcFile().set(player.getUniqueId() + ".Times", plugin.file.
getcFile().getInt(player.getUniqueId() + ".Times") + 1);
why is this just setting 1 instead of increasing 1?
you didn;t save the config after
i did
not in that code you didn't
what is file and what is getcFile()?
i'll send the file class
?paste
i resorted to not using ageLock because it has so many unwanted side effects
im literally just resetting the age every tick
your getInt is not finding that path in your file
what?
you don;t need to create a section
but you do need to use player.getUniqueId().toString()
to be safe
getInt will return zero if the path is invalid https://hub.spigotmc.org/javadocs/spigot/org/bukkit/configuration/MemorySection.html#getInt(java.lang.String)
it should
okay, i'll try thanks
anyone might have an idea what causes this? https://prnt.sc/60ldpTk0KMYL
the %s at the end of each message
a shitty one, it uses ur instead of your
lol
when did this start happening? What plugins have you added recently
deduce it via those methods
than contact the plugin owner and tell them to fix there shit
hmm alirhgt then
its modifying every line of chat
its wrapping everything in < > then adding %s at the end for some reason
I'm going to guess someone edited a chat format incorrectly
it works, thanks
It's possible to deduce it using reflection
true
Cba to write a method to do it now tho
U can manually get each of the handlers of the event, for each plugin and then pass an event object that you create to it and see the output before and after
anyone else use VSCode for developing plugins? I want to be able to debug using the built in run and debug feature. I have the spigot server running in debug mode and have my launch.json for Run&Debug set up like this:
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"request": "attach",
"name": "Run Plugin on Test Server",
"hostName": "localhost",
"port": 5005
}
]
}
It looks like it attaches correctly, but I can't see my plugin in the server even on /reload. What would I have to do to make the server launch with the plugin and be able to debug it?
https://www.spigotmc.org/threads/debugging-on-visual-studio-code.376725/
Seems like this guy was able to do it, but I can't seem to replicate it.
Use IntelliJ
Wasn't the question and I have used it and prefer VSC as an IDE. Its lightweight which is a priority since I develop on multiple devices and VSC has syncing, support for all languages, and runs on potato PCs.
I know this is possible, just can't find much documentation when it comes to spigot plugin development.
dont' use vsc debugging lmao run unit tests at that point
if you want an ide that has awesome debugging features, go for netbeans or intellij
VSC isn't even a real ide
it's just a shitty text editor
yeah that looks like a very shitty version of idea π
I actually have intellij installed for rust but I've yet to open it
i mean vscode is probably awesome if you just wanna edit some text files. but for everything that requires an actual IDE, I wonder why people just don't use an actual IDE instead of trying to make vsc behave like one
I will spend today instead of coding fixing intellij to not be shit
I've done a fair bit of coding anyways so might as well configure it
VSCode is for people who've yet to see the light 
Idiot
hm
bottle:
name: 'Custom Name'
type: EXP_BOTTLE
lore:
- 'First lore'
- 'Second lore'
enchantments:
- 'unbreaking#1'
unbreakable: true
How would I do something like this?
This is the config version but in code
config.set("bottle", itemStack);
lol
It's pretty nice for some languages or because some nice plugins, but thats probably all.
It's not the best, but it has its features people like it for Β―\_(γ)_/Β―
I have it but not used it beyond making a few cpp dlls
I used it for some js projects but just because copilot
I love vsc but I'm trying intelliJ again I just have to edit the UI to not be ass
what's ivm
Wait
do people actually use IntelliJ for anything other than Java dev?
python too i think
feels like a bit overkill to use it for python
i have a pretty good pc and it takes a minute for intellij to fully open and load.
Rust, python
But we're not talking about pycharm?
i use the python plugin for intellij lol its the exact same
Pycharm is pretty nice but I hate having two almost identical apps just for different languages
yea...
says a lot when they had to make a whole new program for a scripting language
Its not nearly finished
go here ^ everything else is being rewritten
if u write it in rust can it ever be better than rust?
Its like if you have a piece of paper where you write english you can't write french there, so you gotta have a second piece of paper for french.
the rust compiler is written in rust π
how tf
Its compiled
oh compiler
Dummy
How was it compiled
π
originally written in c++
then the compiler was made from the rust binaries
so now the rust compiler is made in rust
if ik java how hard is python?
python seems so much easier to write scripts
python is slow
extremely
java faster than python?
obviously
ig it is since u said python slow
I remember someone compared js and python speeds, python was like 15 times slower
o wow
looping 1000 times in python is devastating
looping 1,000,000 times in java is negatable
looping 1,000,000,000 times in rust/c/c++ is decently fast
assembly better
C is just assembly with more syntax
I remember looping 1 milion times and it wasn't super fast (it didn't do it in like a few ms) but pretty nice
in what
@river oracle let me teach you rust
I printed the loop count in the console every time
I just landed a job oops just by hapenstance
well we'll see if I have time
how do i know how much a block is x far, y far and z far from another?
Block1.getLocation.subtract(block2.getLocation).toVector
oh thanks, i'll try if it works for what i have to do
He wants in x y and z
that gives 1 double of distance, doesn't specify x y and z
Thanks anyway π
Asking about your attempted solution rather than your actual problem
hey, question about distributing maps with minecraft maps in them, it seems like all the map data is getting stored numerically on the data folder of the default map, is there any way to distribute a map to servers that is actually possible?
it seems like worldedit doesn't store the map data in the schematics
I thought about manually moving the maps to the data folder of the map I'm distributing but that just sounds like it's going to cause other issues if it's reading them numerically, if they would get read at all
"maps with minecraft maps in them" <- What does that even mean?
worlds with maps on them
Aaah
I can't think of any good solution at this point and that has me feeling dejected
anyone happen to know if moving the map data to the world would do the trick?
Thats a tricky problem. I dont see another solution than copying the maps to the target world folder.
But then you need to look out for collisions because map ids are just an incremented integer.
Have you tried creating a data folder in one of the copied worlds? Not sure if the data inside their data folder is
loaded or ignored.
that's what I'm testing right now, the collision issue is too important to ignore
it's weird because you'd think the data would get stored in the world the map exists in
but I guess mojang doesn't want that
nah mojang'd rather ban players globally for saying penis in chat
I can't believe you just said that word, I hope you get banned into the shadow realm for your transgressions
If the man wants to talk about penis let him
yeah so moving the data just breaks it
it doesn't read data not in the default world
I guess I'll just go game-end myself
Create new maps of those areas, idk
not feasible
spam the the admin with a huge red
βββββββ βββββββ βββββββ βββ βββ ββββββββββββ βββββββββββ ββββ ββββ ββββββ βββββββ ββββββββ
βββββββββββββββββββββββββββββ ββββ ββββββββββββ βββββββββββ βββββ βββββββββββββββββββββββββββββ
βββ βββ βββββββββββ βββββββ βββ ββββββββββββββ βββββββββββββββββββββββββββββββββββ
βββ βββ ββββββββββ βββββ βββ ββββββββββββββ ββββββββββββββββββββββββββ ββββββββ
ββββββββββββββββββββ βββ βββ βββ βββββββββββ βββ βββ ββββββ ββββββ ββββββββ
βββββββ βββββββ βββ βββ βββ βββ βββββββββββ βββ ββββββ ββββββ ββββββββ
And let them manually copy the maps
penises should be banned in general. I mean, every serial killer's father had one
did you assume a serial killer's parent gender?
Upload them to dropbox
fuck I should have known better
take that flag out of your background you poser
even if they had the files they would still have to rename the files one by one to fit numerically and then somehow edit the item frames one by one to display the correct map
I can't even do this programmatically because that would basically mean scanning every block in the map and then changing the map data which would take potentially hours or days to import
and doing it on chunk load would somehow be worse, a chunk has a lot of blocks to scan though
For a map you just scan the height map which is just 256 x calling getHighestBlockAt
Do that async over a seconds and you have like 13 block scans per tick
I'm not trying to make a plugin that creates maps, I'm trying to restore map data to item frames
Why do people keep using configuration files on runtime?
The data is application scoped. This means you load it once when the server starts and from then on you forget your config files.
And you cant do that by generating new maps?
we're talking about admins creating 300+ maps just for this one adventure project
it's a big ask
Does the map data contain only vanilla information?
yes
Then just put a new map into it that has the same x, z and scale
It will render by itself
how do I even make and distribute that
I'd have to make a plugin just for that and figure out a parallel distribution just to get the maps to work
What is the overall picture. You have a map that people are working on right now and has
quite a few maps placed in item frames anywhere in this world. And you want to copy it to another server
but keep the maps intact.
it's just a map of the world
is there anything in particular i should call if a player tries to run a command without the permission node?
sorry just got around to this. all it does is check if the player needs to get an additional level. i just tried some timings for it and i get around 80-90ms when a player only gets xp and increased stat but without leveling up
Just add a permission to the command. Thats enough in many cases.
when a player actually levels up, i got 100-175ms
i mean for it to be logged or picked up by another plugin interested in players running commands without permission
or should i just manually log it myself
That sounds like IO is being done
wym
80ms on the main thread is horrible. You usually get this kind of CPU time when you are writing to files or querying a DB
console already logs all command
is the cache in local memory?
but does it log if someone tried to run them without permission
Then how are you getting 80ms?
What exactly are you doing?
Just updating fields? Because that should be done in < 1 microsecond
one second
Why would that matter?
idk but it might matter to someone or some plugin
Thats just a lag machine at this point
Theyll figure it out. There are plenty of ways.
Sure
?paste
I'm having a problem setting the charges of a respawn anchor. In order to do this I am using the following code:
RespawnAnchor anchor = (RespawnAnchor) block.getBlockData();
anchor.setCharges(2);
I also tried to update the block data after that, but it didn't work. Does anyone know if I am doing anything wrong?
You need to set the BlockData back on the Block after changing it
got it
Alright, thank you.
There are several ways. And it also depends on what you want to execute async and if you want to execute
it async on the main thread or another thread.
Bukkit.getScheduler().runTaskAsynchronously or something like that
I'm probably just not wording this right on Google, but when using a PlayerInteractEvent I am wanting to ignore right-clicks on a block that open an inventory or perform another action. What is the best way to do that?
Basically I have an item that you can right-click with to perform an action, but I don't want the action to happen if the player right-clicks a button or chest, but any other block that can't be interacted with is fine to go ahead and use it.
Use that event and check if the clicked block is one of those types. PlayerInteractEvent#getClickedBlock()
I see, is there a generic "interactable" block type or something?
iirc there's one for "Container," but I'm not recalling one for other interactable blocks
Well, there is a potential option with the Material class. Material#isInteractable()
You should be able to get the material from the block.
Oh I see, yeah that looks like it should work. Thank you!
Just tested, that seems to have done the trick. Thanks a million!
Don't know if anyone pays attention to when threads are created, but I created one yesterday. Any assistance would be appreciated. Figuring this out is going to determine whether or not I have to rewrite my entire language system.
https://discord.com/channels/690411863766466590/991327724918550579
How can i get Warps from a config and put them into a gui with a for loop ik its something like
{
for (String s : warpConfig.getConfig("warp", "warps").getConfigurationSection("Warps").getKeys(false))
{
}
}```
but im not 100 % sure how
?tryandsee
Oh cool
i have been but i cant figure how to seperate all the warps names
s can be the warp name
ass its one long line with Warp1,Warp2,Warp3,Warp4 How can i seperate them
It's just the names?
warps:
spawn: location here
shop: location here
Where are the locations
when u get the keys, you will get a set with ("spawn", "shop")
so u use those as warp name
heres how its setup https://pastebin.com/iuB8rRKL
so im trying to get the warp name to for loop it all to make the GUi Item
this
gets the warp name
so it will get them all 1 by 1 correct
u can then get "Warps." + s as a config section
then do warp.getDouble("X")
warp.getDouble("Y")
etc
Yeah i know how to do that part thats already coded
so what u wanna do?
Hey guys, I had this method configured fine with if else statements, I was cleaning my code and thought it would be cleaner to use switch case, once I did I get this error, any idea how I can fix it? cpp switch(damager.getItemInHand()){ case Material.DIAMOND_SWORD: knockback(damager, damaged, SWORDDMG); break; case Material.BOW: knockback(damager, damaged, BOWDMG); break; case Material.DIAMOND_SHOVEL: knockback(damager, damaged, HAMMERDMG); break; case Material.FEATHER: knockback(damager, damaged, KATARSDMG); break; case Material.DIAMOND_AXE: knockback(damager, damaged, AXEDMG); break; case Material.DIAMOND_HOE: knockback(damager, damaged, SCYTHEDMG); break; default: knockback(damager, damaged, UNARMEDDMG); break; }
Error: https://prnt.sc/XzKVYo6x0ntJ
^ damager is instance of player
your're passing the entire itemstack to the switch statement
but checking materials
passing the entire item stack? shouldn't that return an itemstack obj?
a switch statement only compares the same type of object
you are checking materials, you are passing an itemstack to the switch statement, they are not the same object
get the material of the item instead
so I have to use the .equals with an if statement like I had it before yeah?
no
is there an itemstack enum?
damager.getItemInHand().getType()
that get's the material, which is what you are comparing
U compare type not itemstack
works great thx yall
how do I make the particles stack next to each other and not make an explosion effect? I want them to look a bit like a flat platform
use the correct spawn method where you can specify a speed
there is no speed parameter
there is one called extra
idk what that is for
yeah it should be for speed according to the docs, but the "usually speed" is kinda worrying
what else can it be
@EventHandler
public void onProjectileHit(ProjectileHitEvent e){
if(e.getEntity().getShooter() instanceof Player){
if(e.getEntityType().equals(EntityType.SNOWBALL)){
if(e.getHitBlock() == null){
Location loc = e.getHitEntity().getLocation();
e.getHitEntity().getWorld().createExplosion(loc.getX(), loc.getY(),loc.getZ(),1, false,false);
}else if(e.getHitEntity() == null){
Location loc = e.getHitBlock().getLocation();
e.getHitBlock().getWorld().createExplosion(loc.getX(), loc.getY(),loc.getZ(),1, false,false);
}
}
}
}```
saw that code on the internet, I don't understand why the if statements are equality-checked with null, can someone explain please?
I thought it shouldn't be null
Not good code
== is fine for null checks, but the Enum s should also be == not .equals
if(!(e.getEntity().getShooter() instanceof Player)) return;
instead of
if(e.getEntity().getShooter() instanceof Player){
//code
}
that code seems ass about face
it checks e.getHitEntity() and assumes HitBlock is not null, instead of checking what you actually don;t want to be null
if(e.getHitBlock() != null){
Location loc = e.getHitBlock().getLocation();```
What would be the best way to store data, eg linked accounts? yml files, textfiles or a database? or anything else
linked accounts?
what is dc? I still don;t understand your question
dc is discord but ok lemme explain again
What would be the best way to store data for a plugin. Like saving users time played or perms or any data basically
Depending on where you save it (always save off the main thread where possible) you shoudl save as soon as you can.
How you store it depends on what needs access
on a single server its completely your choice
if external things need access you shoudl consider a DB
also what do you define as external? like things that are written outside your plugin code
things like other servers (Bungeecord), Website or other apps
ok but if i am using discord it should be ok to use what ever?
I'll assume you are using teh Discord spigot plugin
in which case, yes you are fine to use whatever
nope :p JDA
hey guys, sorry for that im so dumb and doublespacind(thanks to Logitech) but when im trying to shade and relocate update-checker(resource) then i get none result. no one new class or something like that and only error NoDefClassFound. theeeen what i should to do?
other good people said that my pom looks goot to him
send your pom
Visit this link to see the note. Giving the URL to anyone allows them to access the note, too.
too many trash but it works i just need to clean some dependency but its not a problem
pom looks good to other developer sooo idk
pom is wrong by the looks. Move line 160 & 161 to above line 143.
teh configuration block shoudl be inside your execution
i tried many methods
and other developer said that i should to get help here
cuz by he's opinion my pom looks good and should work
Not the way it is now
This should be correct, although I've not checked your actual shade patterns https://paste.jeff-media.com/?3b373d968ab66e4e#7RQKLkyyEyDScFduAKKhpBwYSraUhJbWEshqVBJCpd7d
okay thanks, i will check it soon
You could also delete <outputDirectory>${dir}</outputDirectory> as it has a default
What would be the best way to create a new gui page?
you would have to elaborate a bit more
I want a button in my gui to open a new gui/new page
Cant some one tell me what im doing wrong as it is stateing thate Warpsgui is null when it clearly isnt https://paste.helpch.at/anigagohif.java
but i'm afraid the class will become too complicated or not work
How to handle chat mutes from 1.16.4? Like, how to figure out, who is muted by who?
?paste your full stacktrace
?paste
smartest spigot user
coreSpigot.getCoreManager().getGuiManager().getWarpsGUI() returns null so sets warpsGUI null.
Hi could someone tell me how can we replace the class ChatComponentText in the new 1.19 version?
honestly i should set up a privatebin
Hey, I'm trying to save a users inventory into a file but i have no idea how to serialize a item into bytes, could someone help me with that?
look up a base64 serializer. You can serialize any object into a string, then save that string - just serialize the inventory object
Thank you so much
Is there anything else I need to do after I've used player#setPlayerListHeader("yadda yadda") ?? It doesn't seem to be updating
Thank you SO SO SO MUCH
How can I get net.minecraft.world.entity.Entity from a Spigot Player?
Huh funny I'm trying to do the exact same thing but store a JSON version of the inventory's NBT
Cast your player to CraftPlayer
Then call CraftPlayer#getHandle
im trying to save the inventory to a file too
Oh thank you so much I've been trying this for 2 hours π
Well, I should mention I'm sending the inventory I get to an API but still similar
Yep
It just spammed this in console https://paste.md-5.net/elaqezataw.pl
i advocate that u take that up with the people at Paper instead of spigot
i advocate that u use remapped
could be something weird on their end
oh god yeah I forgot this is a paper jar
this too
I am
I'm using remapped with re-obfuscation during compile
What are "extra" and "data"?
look at the java docs
varies depending on the particle
the data for example for BLOCK_MARKER is BlockData. It's all mentioned in the java docs
ty
Where do you get your player from?
are you calling CraftPlayer#getLevel after the player has left the server?
because it looks like you're doing that
no
hm weird because there's literally no other situation I could think of where getLevel returns null
the player gets kicked
well
when I get this
because the server dies
i don't really understand what you're trying to say
I'll send my code
when does this happen?
When this code gets run:
Entity entity = craftPlayer.getHandle();
CompoundTag compoundTag = new CompoundTag();
entity.load(compoundTag);
and when does this code run
Ah I see they crossposted here
I was just getting my code for you https://paste.md-5.net/sizitebayo.java
Lemme grab my response from paper
I mean, you are literally wiping the player data to a complete null. The server expects some data to be there. Exception
Yeah I didn't realize that
N.B. make sure the sender is a player
what is that even supposed to do? it's called "CommandSerializeInventory" but you actually only set the player's NBT data to an empty compoundtag?
not what I intended
I was reading the MC decompile wrong
Well for this I need access to the player's nbt so I can get something like what mc gives with /data get
Then I intend to encode it to Base64
I guess you should be using save() instead load() then
Does someone knows how to solve this?
it's the other way around. You make the player load an empty compoundtag right now π
so yeah just try save(compoundTag)
yeah that makes a lot more sense now I think about it π
are you using maven?
No I just have the spigot in the build path
?bootstrap
Bootstrap 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 the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
the entire contents of the bundler directory
I think i already have all of them let me check
hm seems like brigadier is missing
it works ty π
perfect!
[ERROR] Failed to execute goal on project woolwars-common: Could not resolve dependencies for project me.cubecrafter:woolwars-common:jar:1.0.1: Could not find artifact org.spigotmc:spigot-api:jar:1.14.4-R0.1-SNAPSHOT -> [Help 1]
While trying to compile a opensource plugin
?bt
yeah but wtf did it actually do
what was 1.14
oh my god it was the fucking village overhaul
as far i know, it was already in 1.13 but with wrong name
yeah more or less
Leave the custom tag container alone
1.13 added the CustomItemTagContainer but I think it was not meant for entities
π«
Can anyone help me with setting up commands for the lifesteal plugin
the author of the plugin could probably do that
who is that
how would I know, you didn't even mention which plugin you're using
lifesteal
which one
the lastes version
this is not very helpful
there are 6 lifesteal plugins on teh first page of search
bro how do I check the name
enter /version <pluginname> and then it tells you who the author is
Plifesteal
they have a discord -> https://discord.gg/8sjwaQTHGC
what do I do
you go there and then you write "Can anyone help me with setting up commands for the lifesteal plugin"
I did that but no one is answering
wait
and you think that you get faster answers by asking on a totally unrelated discord in a channel that is about coding questions?
btw have you looked into their documentation at all? https://ls.przemus.xyz/
@still tusk
yea
well every command seems to be explained there
Dude I dont know how to use it
Then READ
you enter the command in chat
then you wait patiently until the CommandExecutor has finished doing its logic
what template?
Somethign is null at TrackCompass.java:24
where did you get that
but I am not here to give you support in DMs for plugins I didn't code
I have no idea what "target" is
All im trying to do is set a ban time for when people lose all their hearts
Dude text english I have no idea what this is
you never check the return of getPlayerExact(args[0])
No
stop spamming
you're in the wrong discord and in the wrong channel
on this server your only chance is in #help-server
You have to make sure you have a valid target
no, thats will never be null
you have to make sure target != null
How do you craft hearts
I'm always happy to help people with their lifesteal related questions
He is obviously not an expert
my knowledge is way above everyone else's
especially when it comes to "how to craft hearts" questions
You're always worrying about the answers. Maybe the key is that you aren't asking the right questions.
what questions do I aak
The journey is its own reward.
yooo not works
at all
idk why
Hm. probably "All I want to do is set a ban time with Lifesteal plugin"
still no changes
isn't friendship the soil on which to sow peace upon?
^^^
what command is it to set a ban time in the lifesteal plugin
idk, ask the author
Are you sure this is a development question?
This should probably go in the #help-server channel.
Bro you said you were an expert
He is not. Did you misread?
I don't remember saying that
someone else must have said that
I think you're making that up.
that's sheer madness
open the produced jar and see if anything has been shaded
you must have edited my message or sth
dude just tell me who knows
the author
Probably the plugin author.
Update Checker not shaded
was bstats shaded?
i wont t code many strings cuz i can use this update checker with only 3 stings
as you have both set to be shaded
ye Metrics class with many $
Who is devPrzemu5
Show your pom to @tender shard then
the plugin author for P-LifeSteal
i've already seen it and I also don't get it
pom looks good to me
seems more like they are using the -original.jar or sth
@eternal night
instead of the shaded .jar
yep I fixed it for him so no idea why it doesn;t work
A lot of build tools are whacky for java
Lynx is not the author of that plugin
Ik
Thank god I am not
i tried shaded and original
How do i craft hearts sir handsome ginger?
Do you know any commands on the P-lifesteal? @eternal night
