#help-development
1 messages · Page 302 of 1
I figured it out, I had an old api-version in my plugin.yml
i made a plugin i setup config and other class with no error but when i start server and see my plugin it load but then i can't see other folder for that plugin pls help
?askgoodquestion
?paste
what?
o
?paste it
😬
you would need saveDefaultCOnfig() on enable and you need di if you want the config in other locations
where i put "saveDefaultCOnfig()"
onEnable
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
pls send a config where you put saveDefaultCOnfig()
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
its quite obviously you on an alt tbh, and your config isnt in the resources folder or you arent building correctly
but i built
Hi, its possible to, when a command is runed with an external plugin, change plauer amont in ping' protocole ? (When player /vanish ) i want remove 1 in server list
?img show how
Not verified? Upload screenshots here: https://prnt.sc/
hideEntity or Player iirc
Name of plugin or spigot expression ?
@sterile breach It’s methods in the player interface
?
that isnot how you are building
Ah yeah but can Anonymous your name but don't remove 1 in ping protocole
you arent building with maven/gradle and i dont think intellij build system can add resource files to the jar
any solution to fix ?
It can u just need to specify it
?learnjava!
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
@severe lava @hearty latch
easiest answer is to use maven or gradle
also you dont have a config there
i got it
show me it
i found a way around that lol
i just changed the format of the config
and it worked
still curious lol
alright so I looked at it, and I compared it to mine
only thing I can assume is that there is something wrong with how you are using/setting the ConfigurationSection object
in all of my projections, I indirectly use that object and not on its own lol
glad you got it working though
okay quick question
ive got a config serializable class, is there a way to make it not write the ==: ItemStack when it saves
ok after I had my smoke
I figured out your problem
calling getConfigurationSection() on the configurationsection object means you are trying to get another ConfigurationSection below it
wouldnt that be the section inside it
no ==: actually has a meaning
==: means that is an object
ah
you can have multiple objects serialized and that is how to separate them
yes, but you didn't define the path to the config section
items, is easy to set because it is at the top
but then you would have to specify the path to the next config section, which isn't just "Enchants"
it would be items.elytra.Enchants
i thought configSection("sectio") would get the section inside of that section
i need help
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
as you can see from the code I linked @remote swallow even though I loop over 2 config sections, I still have to provide the path to what is the Config Section
however the handy thing though is if you started with a ConfigSection object of items, pretty sure you could probably omit items for the starting of the path
not entirely sure
well yeah because thats on a get config not a configuration section
i need to wipe the world each time the server starts (or stop), with that i mean remove all of the blocks and entity
my plugin generates map for players to play in and, when each of them quit, saves everything into file (like one chunk assigned to one player)
after each session there are some unused chunks that i don't need and i was thinking instead of clearing each one separately maybe there is a way to wipe the entire map
well if it did as I stated that would mean you could omit Items from the starting of the path in the next section object
but would still need to add elytra.Enchants
if it just needs clearing on restart disable saving
ah
is there some easy method that overwrite world folder (but not playerdata) ?
probably not
not bad idea but i need playerdata too
ah, you would probably need to have the world saved somewhere else that will never change and just replace the region files or whichever
you actually could clear unused chunks separately, take a look at worldborders code and it will show you how to do that, now such a method would take a while. If you want player data to be preserved then only delete world data and not the entire directory.
i could delete the world, but then when it starts it gets generated again by minecraft vanilla
would work if we could add something that always generates empty void world (possibile with a different biome than void)
you can define the generation of chunks if you wanted
Im doing a simple /setspawn & /spawn plugin, when I set the spawn point, I have an error, how can i paste it?
?paste
wahts line 33 of setspawn.java
the only solution I have for you that would be the easiest would be to have a master world and on restart clear out the old one replace it with a copy of the master
?paste
that soulds great
can you indicate me doc to these methods?
whats Files()
?paste
there is no document for these methods as its just basic file method stuff, but you would either need to do it on server shutdown or in the onDisable() or before the world loads when starting
when I did such things I used bash to do it
but that isn't as straight forward to do 😛
which folder should i overwrite? i dont want to touch playerdata
playerdata has its own directory
could that be a problems?
so its just region folder right?
you dont run setUp spawn on the command class so YamlConfiguration is probably null
can we do it on disable?
most likely
wdym most likely
In main
make a method in your main class to get the spawn from the Files instance you would probably be creating their
Hello! What are implications of this?
the instance wont cross over
you would need to pass the yaml config through from main to get it from that instance of the clas
well if you are wanting to use bash to do this as I said it isn't straight forward because bash is a shell script language, not java
so if you wanted to invoke bash from onDisable() yeah you can probably do that
but you're not 100% sure
also, do region folder contains entities? i might need to clear those too
nope because it depends on your ability to be able to do such things, also if the server takes too long to shutdown it will force shutdown
chunk data does contain entities saved in them
i hope it wont take too long
you sure? bc im seeing another folder for entities
IT WORKS @remote swallow IM GONNA SCK YOUR nevermind
oh that is right, I think entities get their own directory now
btw if you keep removing all chunks, how can players ever rejoin and not fall into the void
the chunk would be regernated or be re-existing before they join
thank you, last thing i need to make sure. will the server support this or will it force shutdown as you said?
it'll be like 100x9x100 or smt close
if I were you, I would probably from the onDisable invoke a cron job that waits a few seconds for the server to stop
does its thing, and then invokes the script to start the server again
this way, you don't have something that might prevent the server from shutting down
hmm
is that how large your world is?
i was hoping i could just make the world generate void each startup
surely you can do that
its dynamic so it always changes based on how the players interact
there is multiple ways to do this
that sounds too much
and no single way that is the best
too much why
playerdata folder gets bigger for each player and never clears
yes that's true but maybe it gets too big to be moved, regions instead get cleared each time
isn't that something that might cause problems?
it will never be too big to move and besides the two things I described doesn't move that directory anyways
we are just trying to clear the world files leaving everything else in place and clearing entities if you want those cleared and lighting since that has its own directory. But everything in the region directory
and then either re-generating your world via code or just copy world files back in
lighting what is that
re-generating your world via code sounds good
is that possible?
like, can a plugin modify the world generation?
it contains data on light level stuff for blocks and the world
yes already stated near the beginning of this that you could do that
just it isn't exactly easy
because it's not java
it is
good luck 🙂
depends on how much control over the generation you need
would be super cool if EventHandler onMapGeneration event
we had something like that
there is a worldload event
i'm looking into that
but I told you the easy ways to do this, going the route of tapping into world generation is one of the hard ways or can be
barrier blocks everywhere, biome forest
is it?
i need very basic starting world
well, just pick a way you want to do it, and do that
you suggest playing with the folders instead of world gen
yep
alright thank you so much
because you don't need world gen for what you are wanting to accomplish although you could use it
if you were wanting custom chunks being generated on the fly
then you would need world gen for that lol
that sounds very cool but i agree its way too much for what i need
is it better to do at shutdown or startup? im not familiar with cron job (also i'm using minehut as hosting service)
but so what do you actually want to do, does the world need to be completely empty or does it need to be filled with a block
because that limits your options
both are good options to me
at shutdown since it will be separate from the server so its not a good idea to do that when the server is running
Hello, is there any way to prevent to being disconnected from the server when using debug with intelij ? debug works very well, but if I'm to slow and don't play next steps, I'm disconnected from the server
No, not really
Only if you have a way to break the execution of the client as well
ok ty
Hey does anyone know how I could increase the distance a Dolphin starts the SwimWithPlayerGoal? I'm trying to make so the doplhin follows the player and can give them dolphin's grace from a longer distance
Hi! i created my first plugin, can i send it here?
Depends why do you want to send it?
because i want to show it to all of you :P
Make a github and share it there
Yes, we do not care about plugins, but if you want someone to point obvious errors in your source you can do that.
I am trying to connect player to another server in bungeecord
Player player = (Player) sender;
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF("main");
player.sendPluginMessage(CommonVariables.plugin, "bungeecord:main", out.toByteArray());
What am i doing wrong?
Many things
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
?pluginmsg
?messaging
?pluginmessaging
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Thanks, but it does not work, i think its too old
no it isn't
You didn’t try did you?
I cant register channel named "BungeeCord"
Retry and show me how you are doing it
Ok
Oh, sorry, i tried to use channel like "BungeeCord:main" and got an exception like "Channel must be lowercase and must contain ":" in its name", but "BungeeCord" works fine
Player player = (Player) sender;
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF("main");
player.sendPluginMessage(CommonVariables.plugin, "BungeeCord", out.toByteArray());
But i still cant connect someone
Is something wrong there?
how about show us the class instead of bits and pieces of code
?paste
You can send keep alives to the player
not sure if that is their issue, think they are running the server through the debugger
in which case you can stop or rather pause at certain points
which this would cause any client to disconnect
Stop netty timeout and send keepalives to the player when debugger is on
well obviously lol but it isn't like the server running in the debugger could do anything since execution of everything is paused lol
maybe I can try this https://www.spigotmc.org/threads/plugins-debugging-intellij.346925/#post-4158152
Is it for me?
Which is why I'm wondering if an intellij plugin can be written to solve this
you can
ik i can call clear but wanna try smth
iterator on the other hand you can't remove while iterating at the same time
basically it comes down to this. You can't read as you remove lol
for iterator
ah
you have an odd setup for your classes that don't make sense
why do you need an interface to just obtain plugin instance?
second the way you are registering your command I guess it works, just never seen it done this way.
I am not entirely sure what the issue is, except the way you are obtaining a plugin instance
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Its just test plugin, dont think about it
you never called next, so it doesnt know what to remove
yeah no shit sherlock
Switch them
the other way around
Goes from top to buttom remember
the javadoc says it all
Is the plugin enabling correctly? The command in plugin.yml?
Code looks more or less ok
Is it for me?
Yes
Yes
Yes, everything is ok in plugin.yml
What does the console log when enabæing the plugin?
Nothing interesting, no errors
Paste your entire latest.log
I tried scheduling the value to return 100 ms later, hell even 1 second later but it's still no use.
try {
return executor.schedule(() -> serverName, 100, TimeUnit.MILLISECONDS).get();
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
return null;
}
Sorry, but the logs are on another computer, so i can't do that.
what are you doing?
Create a Callback<String> and store it in a Map<UUID, Callback<String>> map
ig
It's the same as all other packet sending no?
Cba
click on the reply, then scroll up
To use them rly
@quaint mantle return a new completable future
Store it in a map
When bungee replies
See if the player has a completeable future in the map
And call complete
Ok
looks like async issues
Ok, thanks for all, now it works fine
why storing cfs in a map? cant you just add handlers to them?
Wdym handlers?
::thenAccept
Not for plugin messages
You can send a plugin message
And then you need to wait until bumgee responds
When bungee responds, spigot calls a method telling you there's an incoming plugin msg
ah
does anyone happen to know if player entities on an offline server aren't by spigot considered "Players"
my custom damage system seems to be having issues specifically on cracked servers so im wondering what technical differences there are between offline and online
we don't support offline mode servers
not sure what the deal is with people coming here lately asking for help to pirate something
The only difference between online and offline servers is the players UUID
i dont know either man but a quarter of my users use offline mode and they're all having the same issue
sounds like they should buy mc
and for others to stop supporting pirating
but hey that is your choice, doesn't mean spigot supports it though
ok
@hushed spindle player entities are co sidered players
All my test servers are offline mode so i can join with multiple accs
And my plugins work
hi
public class OnPlayerJoin implements Listener {
@EventHandler
public void onPlayerJoinEvent (PlayerJoinEvent event) {
Player player = event.getPlayer();
PlayerDataStore playerData = new PlayerDataStore(player);
}
}
public PlayerDataStore (Player player) {
this.player = player;
this.status = IDLE;
this.game = NO_GAMES;
this.data.put("AllowPVP", "false");
if (!playerDataStores.containsKey(player)) {
playerDataStores.put(player, this);
}
}```
hi
public class ChunkInvalidateListener implements Listener {
@EventHandler
public void onBurn(BlockBurnEvent event) {
handleEvent(event.getBlock());
}
for how many ticks should i make a player invulnerable so that they won't receive any damage from lighting right after striking it?
public static PlayerDataStore getPlayerDataStore (Player player) throws Exception {
if (!playerDataStores.containsKey(player)) {
throw new Exception("Player not found in store.");
}
else {
return playerDataStores.get(player);
}
}```
is it a custom lightning?
if so you can just do the effect
when i do getPlayerDataStore(player);, it says there is no player with that player object.
or use the damage event to cancel it
just World#strikeLightining
you could just use the effect
which doesnt do any damage
i want it to damage other players
i wanna make only 1 player immune
i am canceling the event
even though when i joined the game, it registered the player object.
i just wanna know for how long should i do it cuz i don't wanna make that player immune from ALL lightinings
probably like 1 tick
1 ticks doesn't work
private static HashMap<Player, PlayerDataStore> playerDataStores = new HashMap<Player, PlayerDataStore>();```
i am storing player data in a hashmap.
declaration: package: org.bukkit.event.entity, class: EntityDamageEvent, enum: DamageCause
how do i store playerData? Can i just store the Player object?
or does it not work when i query for the object later?
the player does not even leave the game.
Yeah I know this event. If I just listen and cancel if the cause is lightning player will be immune from All lightnings forever. I want to make it immune from only one specific lightning. My question is: For how long should I listen to the event and cancel it?
probably
i am guessing he needs it while the player is online, so storing the player is fine
yep.
i have this code right here.
ArrayList takes linear time to search.
same with LinkedList.
a map to search for keys too
what do you mean?
or a set
it is up to a point
yes if you are searching a value with a key
why not?
eventually as you put more objects into the map it is impossible to keep that O(1) time lol
not if the hashes collide
no
it is amortized probably.
At a certain point if you store too many objects in a HashMap it starts to lose its time advantage
the worst case is O(n)
because you can't have infinite time
i know.
does java not resize it?
well yes but time notation doesnt day anything about the actual time it takes iirc
to maintain an amortized O(1) time like Dynamic Arrays?
whether it resizes or not isn't even relevant. You can't instant search with a million or two objects
its just simply impossible
hm ok.
i am not storing a lot of data anyway.
unless my server really becomes popular if i can manage to actually launch this server and minigame i have been working on.
in that case i can use an AVL Tree.
if i find too much lag.
sure, and its fine for small data sets. I was only pointing out to whoever was saying it was O(1) and I was merely adding the caveat only up to a certain point that it is lol
hm.
anyways, storing players as uuid is more space efficient in like most cases
okay, i will just use the UUID.
depends, objects in maps are only references and not the objects themselves
it is a balanced binary search tree.
well yeah i guess
the only thing i remember are BST, quicksort, a bit of hashmaps, queues, stacks, BFS and DFS from my dsa class
AVL Tree is one of possibly many balanced binary search trees.
loll
i suppose in runtime it doesnt really matter
unless you are like copying player objects left and right
storing a string in a map could take up more space then an object
mainly because that is the exception to the rule of object reference
Before lightning strike, set player invulnerabile
time to refactor my code to use player UUIDs now.
just cancel the lightning event?
no cancel entity damage event
ah that.
@vale ember lemme see how you're tagging the player to make them invulnerable
then you would just need a way to determine the origin of the bolt to see which players to cancel
Are you adding them to a set or something?
how i solve ?
Not at all, you just ignore it, as they still didn't provide us with an alternative API for the one they had to mark as deprecated.
ok
It's deperacted because the client decides if it's on the ground or not
Still, the local state machine has to also decide this. Otherwise, you can easily bypass the anti-fly ticker, for example. Deprecating this interface is plain stupidity.
You can easily bypass the anti-fly
hmm yes]
If you spoof the one ground flag every now and then. But it's obvious that that's impossible if you know the coords of the player and the ground-level. How could you ever let the client decide on such an important flag, that's insanity.
my anticheat have many feature
can i create more worlds in spigot?
Yes
like another overworld dimension?
does each world run in its own thread?
or is there a way to run each world in its own thread?
Depends on the version
1.19.2
Then yes some things are handled on their own thread
i am actually running the spigot plugin on a paper server as well.
what about blocks breaks and block placements?
like removing an entire 100x100x100 cube of blocks?

even if a single world has its own thread, it doesn't mean that thread can't be lagged
i know that.
Blocks in a world are not multi-threaded and can only be modified by the server thread
if I remember correctly
that is correct
oh.
because at some point it still has to synchronize
that might be an issue.
What are you trying to do exactly?
its a minigame.
Ah
where a lot of blocks a removed and put back programmatically.
?workdistro
and if there a lot of instances of the minigame running at the same time, it could be laggy.
i know that and even implemented something like that almost.
almost
sounds like you need to have a custom server implementation
a task scheduler, yeah.
Minestom 
even coding a small minigame needs so much code.
Probably too advanced for you though
no, it is not.
This doesn't matter at all as long as the player entry gets removed when the player quits the server
If it gets laggy get more servers and link them with Bungeecord
The hashCode of the player is equal to the hashCode of the UUID
and the equals method is basically just checking the UUID as well
Just to be safe use a weak map
of Player?
Meaning that the Map treats it basically the same as an UUID. The only problem may only occur with it not being flushed properly and thus causing memory leaks
you can hold UUID and still have valid uuid references regardless if the player is on or not
UUID is independent of the player object
If I set the custom name of a mob, but set persistent to false, will it despawn like a non-named mob?
i tried something like that already.
how did it go?
way more work to program.
Yes, you should 100% do that if you want to keep the player identity longer than the player will stay online
anyway, tell me more about bungeecord, how does it work?
Not really? You probably don't have the player base to automate that
Otherwise it'd be better to just keep the player reference itself, especially if you plan to work with it afterwards as well
i dont even have a player base yet lmao.
So then there's no need to automate it
making a multi-instanced system for an island thing is so cool imo
what heppning
yeah, i should probably try to launch the server first.
making a minecraft server is so difficult.
error
Can be spoofed
Check the hitbox of the player. That method can cause issues if you're sneaking at the side of a block
woo AABB
ABAB
isn’t it AABB? (Axis-Aligned Bounding Box)
It is
lol wat
context @fluid river
no context ABAB
ABCABC
EFG
where’s D?
you can get that D later
thank god
children are menaces nowadays
ong
i got it linked on my desktop
proud
I’m taken though. Sorry <3
meow
block em
okay but...
...
who asked
joe asked
i wish joe mama well
joe biden
Yes, this is normal for #help-development
Normal day
always has been
which docs
Any docs
Just like anything else in Java
Just make a bunch of classes
and then use the maven shade plugin or shadow
Guys, how in god's name do you load a list of ConfigurationSerializable objects out of a config yaml?
to put it in your jar and use the classes like normal
Yeah
Yes
And then use the maven shade plugin to include in your other projects jar
Make sure to relocate
You need to shade
Setting scope to compile won't shade without the maven shade plugin
I'm trying to load lists of objects from my config.yml, which looks something like this: https://paste.md-5.net/zeridulivo.makefile
objectA and objectB are both registered ConfigurationSerializable.
If I try to 'getConfigurationSection' on either of them I get null.
What is the correct way to load lists of objects like this?
do you?
why dont you do that for pathetic
cause it takes ages!!
rather letting me do it and complain about my english
then just dont take ages
i get easily distracted. had to go to a coffee shop to get some work done yesterday
Yeah
FileConfiguration.getList() ?
It just returns a list of LinkedHashMap.
Which I can't cast to my type.
The IDE says it returns a list of Objects but if I run it, I get a "java.util.LinkedHashMap cannot be cast to class.MyClass" error
yeah because you dont cast the list, only the type the list is holding
if its configuration serializable ig that shouldnt be a problem
generics are goofy
generics are beautiful
I hate yaml.
generify everything
cpp guy comes in
cpp moment
whats the most compact and fast string storage format
compact is probably the opposite of fast
like format to store objects as a string
compact -> byte array
json probably?
aight
otherwise base64
binary?
have to do that to use redis
Yeah, for (MyClass myClass : (List<MyClass>) config.getList("myObjects")) {} doesn't work.
why not
class java.util.LinkedHashMap cannot be cast to class MyClass
That error doesn't match the code though
youre casting it to a List<MyClass>
how did you save the file
its parsing a normal yaml object while you are taking it in as a MyClass
you need to make sure yaml knows that its your custom object
How?
how did you store the object in the first place?
I wrote it in config.yaml and then verified the yaml.
have MyClass implement ConfigurationSerializable, implement the serialization and just store the objects directly
isnt there a method where you can pass in the type as a parameter
for manual shit add ==: my.package.MyClass or use a method which automatically parses the yaml objects into MyClass
anyone who has used this stuff?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/configuration/MemorySection.html#getObject(java.lang.String,java.lang.Class)
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/configuration/MemorySection.html#getSerializable(java.lang.String,java.lang.Class)
well more or less
declaration: package: org.bukkit.configuration, class: MemorySection
I've implemented ConfigurationSerializable on these types, I'm not sure what you mean by 'store the objects directly' though.
ofc the console says that?
yes
thats.. normal?
what would you like the console to say xD
ngl that code looks copy pasted
did you had fun hitting your enter button or what happened there
doing a new bukkitrunnable in a run method 💀
man just signed up for copilot and spammed TAB
It's a tutorial
I'm not sure I can run that method because my objects are in a list and therefore I can't address them by path.
copilot writes even better stuff
understandable if he has one of those
I gotta get myself one of those
I like bashing empty lines a lot
I swear I'm not the only one making 25 empty lines
?paste your code and yml
resend it lol
you like empty lines?
y?
line between class declaration and first method/field in class
yes
ew
line between last field and first method
line between variable assignment and if checks
line between field and constructor
line between constructor and method
lines between methods
ofc
lines between imports and class decl
and ofc line between imports and package
never had lines between ifs and what's inside/after
if the if is > 3 lines, there is a space between the header and the content
just like with everything else
yeah no
never had this rly
here's a solid example with comments
google codestyle sucks
still a space between the method header and the random
I follow google style but with line wrapping set at 160
there is an indentation change, so I wouldn't put one
also i would probably put bytes and its usecase together
just like the random and characters
well
well the characters could be a constant
and by that let alone random and put bytes and chars together
I don't like to mix functions with regular assignment
i just put newline between shit when i think it does something else
yeah that
💀
I am trying to make a lifesteal system could anyone tell me if the code below is correct?
package me.redstoneroxxstar.lifestealplugin.Events;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
public class PlayerKill implements Listener {
@EventHandler
public void onKill(PlayerDeathEvent e){
Player victim = (Player) e.getEntity();
Player killer = (Player) e.getEntity().getKiller();
victim.setMaxHealth(victim.getMaxHealth()-1);
killer.setMaxHealth(killer.getMaxHealth()+1);
}
}
youre assuming the killer is a player
also ew naming events as e
it'll throw ClassCastException if player dies with other cause
also Player::setMaxHealth is deprecated, you should use attribute modifiers instead
bruh what
also why don't use victim instead of e.getEntity() in killer's assignment
is it possible to drag items from inventory to custom gui?
cus inventory is locked
uh yes?
could you give me a refrence or something pls😅
wdym moving items from your inv to a opened chest or smth?
does MCP usually take forever on copying assets...
yes?
by code?
imagine i want to drag these to the fishing menu
with code yes
but i can't pick the items in inventory up they are locked
drag what to what
those enchantment books to the slots between the yellow and green glass
why are they locked
cuz event.setCancelled(true)
are you cancelling events?
yes i have not done that
can you show the code for this ui?
i assume you also cant drag anyhing from the top menu down or out
tho i might have seen my mistake🤡
with a super random return cus i was getting an annoying error
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
Hi, im using 1.19.2 and in the minecraft class this are missing how i can use them?
damn
in old plugin version, was used to enderchest and im trying updating it
Remake it for 1.19.2
Using pdcs
It’s not that hard
i can't use them because i copy the item with NMS, from 1.18.2 worked fine but not on 1.19.2
public ItemBuilder removeCustomNBT(String key) {
if (!this.is.hasItemMeta()) {
ItemMeta meta = this.is.getItemMeta();
this.is.setItemMeta(meta);
}
net.minecraft.world.item.ItemStack nmsitemstack = CraftItemStack.asNMSCopy(this.is.clone());
NBTTagCompound tag = nmsitemstack.u();
tag.r(key);
nmsitemstack.c(tag);
this.is = CraftItemStack.asBukkitCopy(nmsitemstack);
return this;
}
Hello, how can i build a wool of a specific color from its data value ?
I tried using Material.WOOL (WOOL cannot be resolved or is not a field) as a base but nothing seems to work 🤔
Don’t do that. Rewrite it
Which version?
1.19.3
iirc they just have separate names like BLUE_WOOL
I saw that but i was wondering if there was a way to build them manually as i have the color value but not the material itself
Why?
Just do it the proper way
in my plugin i have a flexcolor enum that has a bunch of colored blocks that I can get by using the enum value
So? Put in the proper values instead of datavalues
well yes
lol
Datavalues are deprecated
thats what I was suggesting
evrything is working but when i run plugin and type a command it evrytime come this
any solution ?
any gud gui libs? (paging and all that shit)
must be shaded, not a plugin
also the smaller the better
Return true instead of false
for me the "datavalues" are just enum constants
IF by stefvanschie
Show me the enum class
not at my pc rn
inventory framework?
but its something like this BLUE("Blue", Material.BLUE_WOOL, Material.BLUE_BANNER, etc..)
for every color
Then u already have the wool
what i do true and false here?
?paste
Full class please
you plugin.yml too please.
Weææ
ops
It only returns true if he has less than 2 args otherwise it breaks
i need to do that false
hello i was trying me make commands and i am using 1.19.3
If you are handling the errors yourself just return true all the time.
?paste
full error
ok
your plugin.yml too
name: Manhunt
version: '${project.version}'
main: io.github.codecraftplugin.manhunt.Main
api-version: 1.19
authors: [ CodeCraft ]
description: a manhunt plugin
commands:
hunter:
description: set a player as a hunter
why are you running "plugin.getCommand("hunter").setExecutor(this);" in the commandexecutor too
why don't u use entitydamagedbyentityevent
Because I didn't know that existed lol
I'm new to plugin development
i have tried doing
type Event in search tab, and voila, you have 99 events listed
getCommand("hunter").setExecutor(new Hunter());``` in main class
disgisting
or take free java lessons from me
so what do you think the error is
remove it from the hunter class and just do it in main
Do it in one place
@fluid river he already posted everything please check instead of blindly giving advice haha
too lazy
yikes
give me second let check if it is a server issue
how to check the version of the server
./version
maybe you just need to rebuild
seems like this server is a 1.19.2
[21:13:09] [Server thread/INFO]: This server is running CraftBukkit version 3636-Spigot-d90018e-941d7e9 (MC: 1.19.3) (Implementing API version 1.19.3-R0.1-SNAPSHOT)
[21:13:09] [Server thread/INFO]: You are 1 version(s) behind```
?contribute (sending for myself)
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
then why is it running craftbukkit 1.19.3
still that shouldnt really matter
like i said have you tried rebuilding the plugin jar?
yeah
hmm
just figured it it was error with the plugin that was runing i think intellij was not able to remove the old one so it failled
oh
once stoping the server and doing it again fixed
nice
I usually just copy the files over instead of telling intellij to put them in the plugins folder automatically
why are you checking the command name in the execution
wttdym
yes
can you try loggin like the command name it found
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
means?
like before the first line of the oncommand function
print the command.getname to check if its correct
Hewwo, there's a way to remove the Honey Block properties for mobs?
so i made som changes to NMS and tried exporting using the package thing in maven as shown in screenshot, but it just gives me error "No Message"
hi so how to give player a permission
hello, having some trouble setting up MythicMobs and ModelEngine resourcepack if anyone wants to help give it a go, i've been stuck on an issue for a couple days now. Can't seem to figure out the problem.
ok i checked it out and it just says systeym cannot be resolved
Black / Purple textures is all i'm seeing for Custom Mobs.
texture pack problem
this is my resource pack
assets and pack.mcmeta
is it not able to find where the textures are or something?
for 1.19.3 ^
hm don't think so.
We cover the big change that happened for resource packs in 1.19.3!
🔵 Discord & Other Links: https://linktr.ee/CloudWolfMC
💻 Website: https://cloudwolfyt.github.io
Watch this
awesome i'll give it a go, thx guys.
so for ModelEngine do you create an atlases folder inside the modelengine resourcepack folder too?
to path ur custom textures from there?
how can i stop BungeeCord from attempting to connect me to a server before i can handle it in my plugin
now its connecting twice, once to the BungeeCord chosen one i think and once to the code chosen one
you make a fancy plugin on bungee that does shit for you
yeah ive done that
how are you handling it in your plugin?
but i assume, since its in post login event, BungeeCord beats me to it and connects first
i cant find any methods in LoginEvent or PreLoginEvent though
ServerConnectEvent
Can't you just set your preferred server in ClientConnectEvent
nah
..why not?
ah
is lower index higher priority or other way around
though ill probably still use server connect event because im not gonna rewrite all this shit
afaik it's as simple as
@EventHandler
public void onConnect(@NotNull ClientConnectEvent event) {
event.getListener().getServerPriority().insert(0, "my-preferred-server");
}
- Your Discord profile seriously threw me off
- Are you on 1.19.3?
Yeah, it's likely an atlas issue. I'm not all too familiar with them just yet, but that's like 95% of the reason peoples resource packs are missing textures 😅
dang this is all i've got
{
"type": "single",
"source": "textures/entity/nocsy_otter_v2",
"prefix": "textures/entity/nocsy_otter_v2/"
},
?paste
that's in atlases/blocks.json
for modelengine
nvm found it
if anyone else is having this issue
Hey guys, what Java version is required to code for 1.8 spigot? (Helping a friend, not willingly using 1.8)
probably like java 8 or 7
that's it couldn't remember which, thank you
j8 is supported ig
Thanks
google says java 8
https://jitpack.io/com/github/Will0mane/ModelMaker/ReleaseOne/build.log could someone help me with this error?
[ERROR] Failed to execute goal on project ModelMaker: Could not resolve dependencies for project me.will0mane.plugins:ModelMaker:jar:1.0-SNAPSHOT: Could not find artifact org.spigotmc:spigot:jar:1.17.1-R0.1-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/) -> [Help 1]
make sure you have the correct repo in your maven file
how strange
lol 🫙
ahahah
wdym?
it was in my message cause i didn't format it
nothing I was distracted
oh ok
The Spigot artifact comes from BuildTools. It does not exist on the repo for legal reasons
You can use spigot-api if you're not using any nms
maybe change spigot to spigot-api in artifactId
... i am
I never tested before what happens what if 2 differents plugins listens for the same event to cancel it, with the MONITOR priority
Well then. Don't use jitpack
because the link shown in the error does not have a org.spigotmc:spigot
do you know any other options?
You can host your own maven repo
Is in alphabetic order?
how?
no probably in the order that the plugins are initialized in
mhhmh
so to have the actual final say I have to load a plugin before the world and have the letter Z
Setup your own nexus: https://help.sonatype.com/repomanager3/product-information/download
do i have to have a server?
Yes ofc
i need this to work 24/7
the alphabet is irrelevant
so its probably not an option
why not
any other online ones?
because its purely based on the order they are loaded
how do i upload the repo on maven central?
this order is based on the pre-world and alphabet I guess
Item not re setting to update lore on click
not really, I think its pretty much random or based on like filesize, you can somewhat shuffle your plugin using some options in plugin.yml https://bukkit.fandom.com/wiki/Plugin_YAML
When Bukkit loads a plugin, it needs to know some basic information about it. It reads this information from a YAML file, 'plugin.yml'. This file consists of a set of attributes, each defined on a new line and with no indentation.
A command block starts with the command's name, and then has a list of attributes.
A permission block starts wit...
like load_before or softdepend
i still don't understand, i am on https://repository.apache.org/#view-repositories
does anyone know what's this and why its consuming so much ram
are sessions IDs sent to the server?
no
so how does the server verify that a player owns minecraft?

