#help-development
1 messages ยท Page 226 of 1
Then I don;t believe you can use player skins on Mobs
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ItemStack.html#addEnchantment(org.bukkit.enchantments.Enchantment,int)
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ItemStack.html#addUnsafeEnchantment(org.bukkit.enchantments.Enchantment,int)
declaration: package: org.bukkit.inventory, class: ItemStack
how do i send packets to player? i googled it but they are for older versions of nms
How can I create a team with command and set custom prefix in tab?
well
im gonna use the NMS way
but my current problem is i cant import ServerPlayer
That method doesn't require third parameter LAMO
no like
if you are depending on spigot you should have ServerPlayer
ItemStack.getItemMeta().addEnchant(Enchantment.CHANNELING, 1, true);
this @quaint mantle
i am, and it doesnt idk
it only allows me to create a type for it
this is my plugin part
my depending part
?paste your whole pom
you cant just add a param
wdym
Oh It works Thank youuu!
๐
You have the specialsource but you are not using a remapped dependency
so what do i do
no
classifier
ad a classifier tag of remapped
I don;t have my ide open so going from memory
you then need to run BuildTools with the --remapped switch
ow
so
<classifier>remapped</classifier>
``` instead of
```<classifier>remapped-mojang</classifier>```
when i add this classifier
im getting the error
Unresolved dependency: 'org.spigotmc:spigot:jar:1.19.2-R0.1-SNAPSHOT'```
Somebody can explain this for me?
๐๐๐
this is my first time trying NMS so its pretty confusing
can i use EntityPlayer @eternal oxide
not on 1.19.2
I can open my ide in about 15 mins
is this correct tho?
gives me this error for some reason
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>${project.spigotVersion}</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>```
๐
import net.minecraft.server.level.ServerPlayer;
im having this error
removing the remapped-mojang kinda works, but like i cant get ServerPlayer
its asking me to add a jar
yes, you need to run buildtools with --remapped
ok lemme try
java -jar BuildTools.jar --rev --remapped 1.19.2
?
btw can i run it in the same directory as the previous install?
so it just updates itself
or should i do it seperately again?
yes, and no that command is wrong
can you correct it
Hi, I'm getting an error that I can't understand. Every time my plugin is disabled I get the following error:
?paste the error
@Override
public void onEnable() {
instance = this;
this.clanManager = SimpleClans.getInstance().getClanManager();
this.settingsManager = new SettingsManager(this);
this.dataManager = new GsonManager();
new LVExpansion(this);
this.manager = new LVCommandsManager(this);
this.registerEvents();
this.logStatus();
}
@Override
public void onDisable() {
this.dataManager.save();
}
The thing is that every time the plugin is enabled the variable datamanager is initialised and there is nothing in my plugin that turns it into null
can you check
so I can't understand how it could be null in the onDisable method
If it doesn't matter when it's initialised you can try using the constructor
yes thats correct
Yo do anyone here have an idea how to make a plug in which makes the player get the resistance 5 Potion Effect when he wears a full set of armor and all pieces are enchanted with protection 4?
the plugin's constructor?
the order in this case does matter
ok
Yeah
ok perfect that did it
btw if i were to use another plugin which is not remapped
will i need to install it again without --remapped?
or it should be fine?
no, you have both in your local repo now
ok tysm
How can I change max slots bungeecord with command?
/slots 1000
this isn't the place to ask for services
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
how do I add custommodeldata for a potion this doesn't work for some reason
How do I send packets to player? I googled it, but they are for older versions of NMS
NMS is wild n wacky
Just cast your bukkit player to an nms player
by doing ((CraftPlayer) bukkitPlayer).getHandle()
how
and look for any methods or fields regarding connection
Usually
nmsPlayer.connection.send(packet) is the go-to
while they might be for older versions, for the most part it really hasn't changed much
might be nmsPlayer.connection.b.a(packet)
or whatever
but it has to do with the player's connection
and takes a packet
only thing that might have changed is the obfuscated method names
just apply the same logic to all other nms troubles and you'll go far in life
I still need to work on my nms tutorial
have had it stalled for the past month
when ever I get a better PC setup I think I am going to start making some Java Tutorials
how do i get playerconnection from player
๐คฆ
the ones I want to make are of things that no one else really talks about
CompletableFutures and concurrency?
reflection?
More like the nuances of like in some situations how your code is styled actually does make a difference
Or the appropriate way to use some things
don't care, niche is what I am going for ๐
for that one developer named illusion
You talking about reactive programming and principles like humble objects? Or wym exactly by coding styles (just curious)
that sometimes likes to be adventurous
and extend a LinkedList
so I don't need to have fields in my class ๐
for example, nested for loops for example might be better if you didn't nest them. There is certain scenarios where the JVM can't optimize or unwind the loops and thus performance on such things will suffer because of it. Most of the time you won't run into this problem
Ah
but, no one really gives information on this either
Myea, those kinds of scenarios would be interesting to have a little bit more insight into
make sure to record it with the shittiest mic
mans got the apple headset
steelseries
apple is shit af
respectable
I still prefer external mics and a good pair of headphones
but I got literally 3$ to my name and can't buy a good pair of headphones
stuck with this corsair headset whose cable is too long and keeps making me fall
ANC for gaming lmfao
so you can finally drown out your wife/mom screaming in the back calling you a useless sack
lol
there is other niche things I want to make videos on that are simply are not discussed or they are brought up but like not touched on further then just being mentioned lol
or talking about JVM things
like for those who love to optimize
How can i get the type of Chest (Not Material.Type) i want to get this https://prnt.sc/KcAUwEH_G1yR
type: single, right or left
Hi guys im new to paper plugins. It's my first time using kotlin and i tried to make some simple listeners with help of tutorial, the one I made was for detecting jumps. Even tho my code is 100% the same i get error code while running it on the server. Plugin is loaded properly but it makes errors. If you think you could help pls dm me
?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!
?paperdev
Make sure to ask in the appropriate server concerning development towards different JAR types such as PaperMC. (Tip: Google them!)
So many things wrong with that statement. DMs, Paper, No info on the error. Sigh
it's too long
?paste
help
ive got no idea if there is any kotlin devs even in here so its probably best to head to the paper discord
Ok thx man
Looks like an issue with Kotlin either not being shaded in or a dependancy?
wdym?
Block block = ...;
BlockData blockData = block.getBlockData(); // you might need to route this through the state
if(!(blockData instanceof Chest chest)) { // import org.bukkit.block.data.type.Chest, not org.bukkit.block.Chest
return;
}
Chest.Type type = chest.getType();
Thanks
oh heh
https://gyazo.com/088c92b05f8c1e88e5bb76aec5a4ecd6
Can some1 explain why I need to put return true after
because that method has as return type boolean
compiler error
try it and see
?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.
what about false?
returning false in this case would print the command usage message to the sender
returning false, on this particular method, will just print the usage defined in the plugin.yml to the sender
me?
nah
nah we playing
sorry i had to
im not blind im slow
luv u

have fun ig
check dms
god

when you want it to show the command error message/usage
I typically always return false at the end of my command methods because then it means something wasn't accounted for and not caught by one of the conditions that would return true
@remote swallow bro P-Lifesteal plugin ma heart Ka recipe kya hai
What?
yeah the above ^
@vagrant stratus bro P-Lifesteal plugin Ka heart Ka recipe kya hai please say me the recipe of heart in P-Lifesteal
Why are you just pinging random people asking something they dont understand
well good news they pinged the perfect person ๐
maybe next they ping Choco ๐
I love that they ping me and staff
does anyone have an util to draw particle line between locations?
my vector is a little messed up XD
uh fuck
wait wait i think i got it
my logic was reversed
but the particle is messed up (it just flies around), how did you set it so that particle doesnt move
and what is extra for?
speed
๐

idk
I haven't done particle work in a while
we have a dedicated vfx guy working on our particle & model engine
i need to sit down and write utils for all that crap so i can forget about it
and my particle line engine is a bit over the top
it applies workload distribution and was made for client-sided minigames
is there a chance a particle has hardcoded physics?
doubt
as long as you're setting all values to 0
Most particles should one
I remember flame being wonky but I got it to work somehow
lava and water drip downwards
so that's hardcoded
portal? idk
yeah portal falls downward
In this video I will show you every single particle available in minecraft 1.18!
If you liked this video, please be sure to hit the like button and let me know in the comments why you liked it! If you really love my content, please consider subscribing!
All particles shown in...
try using reverse_portal
Does anyone know how Block#getDrops behaves in BlockBreakEvent? It's giving me different drops just when calling it multiple times
And often none of both match the actual dropped items
how do i get the damaged entity in the EntityDamageByEntity event?
getEntity()
ty
Variable used in lambda expression should be final or effectively final what dis
(bukkit task)
you cannot use a variable that mutates after you create a lambda/inner class/etc that captures it
well either that
you ur you just create a final copy
unless you explicitly want to mutate that
then yea, atomic
I just have a reference class
basically an AtomicReference
but it really depends, most of these cases can be avoided (using for loop instead of forEach, avoiding streams etc)
BlockDropItemEvent
you will be disgusted when looking at their impl
How can I create a team with command and set custom prefix in tab?
why is my table misaligned and has no borders? (my first time using tables in javadocs lol)
css in javadocs :stonks:
:stinks:
Hiiii guys, I need a suggestion OwO
I'm making a plugin with a lot of weird cursed things, and on of them is that you can milk any entity to gain a type of power
Its gonna be used for matches, like in manhunt
For now, you can milk chicken and gain slow falling, milk pigs and gain the ability to shoot pigs, that give slow to players, and milk sheep so you can eat grass
Now I wanna do some type of power associated with cows
I know they already have a default milk ๐ but Its kinda of boring
What would be a cool cow power?
Help me brainstorm please
XD
summon a creeper when you try to milk a cow
Somebodyy
Have ability to eat wheat ๐
hmmm... that may be a good idea
but idk, the sheep milk makes you able to eat grass
so I think It would be kind of repetitive
Xd
cows give a milk gun
you shoot your white substance at other players for extra damage and poison effect
it may be a good idea :o
You will also be able to milk blocks, btw ๐
milking bedrock will give you extra armor
and unbreaking on tools
milk the slime block for a thicc slimy substance
oh thats a thing too
It seems that the border problem is coming from here (https://youtrack.jetbrains.com/issue/IDEA-192270), but i still don't understand why the columns aren't aligned
nevermind, I was just confused, they are indeed aligned, but the spacing is so small i didn't even notice lol
why is there no config.getConfigurationSection("x") in bungeecord?
why getUID()? Instead of getUUID()
Bungeecord config api is more bare bones
is .getSection the same as configsection?
yikes
If im not wrong
I havent used Bungee api since 1y tho
theres also no paramaters for also .getKeys() so does it get like getKeys(true) or false?
Maybe have to you test it
i cant rly test rn since my plugin doesnt have any commands or anything
hard to explain
You can always harcode to test things
๐ค
I dont know if you want to mean that or not
does anyone have development configurations for IntelliJ? I'm new to java and really need examples/correctly setup files
Also i would recomend some plugins: Material icons, Git plugin (In case you use git), and some others
Let me open Intellij and figure which plugins i use tho, i think they are around 25-30 plugins
You really don't need to customize things that much
Doesn't intellij have integrated git support?
Pretty sure I don't have any plugin for it
It does
There is any way to set the font for Bossbar, as I know, SpigotAPI doesnt support TextComponent for Bossbar yet?
yeah, but its pretty simple
I added a plugin which is pretty much similar to github platform but from IDE and enable git support (if you have the git program already installed)
PlayerItemDrop if im not wrong
You can also use the javadocs, to see all the api events, which methods they have, etc
package index
could anyone help me with a egg swaper when u throw a egg at a player, u swith spots will anyone help?
Location npcLoc = this.npc.getBukkitEntity().getLocation();
Location targetLoc = tree.getWoodLoc().get(1);
npcLoc.setDirection(targetLoc.subtract(npcLoc).toVector());
float yaw = npcLoc.getYaw();
ServerGamePacketListenerImpl ps = ((CraftPlayer)player).getHandle().connection;
ps.send(new ClientboundRotateHeadPacket(this, (byte) ((yaw%360)*256/360)));
why does it work everyone else, but not me ? ๐ญ
i'm trying to npc look at something... and it works maybe in 2 locations otherwise it rotate head up and down... even when im going around it
theres 2 packets
you need
to make an npc fully rotate
youtube tutorials tell u that
yeah you mean this
ps.send(new ClientboundMoveEntityPacket.Rot(this.getBukkitEntity().getEntityId(), ((byte) ((pitch%360)*256/360)), ((byte) ((yaw%360)*256/360)), false));
yes
wait so whats the problem
just the head going wrong
inverted?
but it goes around too ๐ idk how to say it .... im going around and it goes slowly up and around same time xD
yes ๐
it doesn't move the body ... I didnt notice that ๐
how would i run a console command on a specific server w/ bungeecord
Can probably do this with plugin messaging channels
There are good tutorials on the forums for this
havent seen any
Your just doing a bad job googling then
Legit one google search https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
But PMC (Pluging Messaging Channel) would not be the best way, cuz the command wont be executed if there is no online players
here is quick video about what it doing
sorry for ping tho, just to letting you know
okay ๐
Its just discord platform which doesnt pre load/display them on the chat
Sorry for losting your time tho
don't worry ๐ its okay
I had yaw and pitch overlaid at the second packet ๐คฆโโ๏ธ๐คฆโโ๏ธ๐คฆโโ๏ธ
if you are at the point that you need a pathfinder: https://www.spigotmc.org/threads/how-pathetic.578998/ 
I did my own PathFinder thanks ๐
but I'll take a look of course ๐
Hi! On my plugin I force the player to return to spawn when he dies, is it better to use the DeathEvent or RespawnEvent?
@EventHandler
public void onPlayerPickupItem(PlayerPickupItemEvent e){
Player p = e.getPlayer();
if(Pirate.getPirate(p).isHoldingLoot()){
e.setCancelled(true);
return;
}
SlotLock sl = SlotLock.getLock(p);
Loot loot = LootManager.getLoot(e.getItem().getItemStack());
if (loot == null)
return;
ItemStack item = loot.getItem();
p.getInventory().setItem(8,item);
sl.forceSlot(8);
e.getItem().remove();
}
this somehow always gives me the item w/ amount + 1
s
prob Respawn
Ok thanks you!
@EventHandler
public void onInteract(PlayerInteractEvent e) {
if (e.getAction() == Action.RIGHT_CLICK_BLOCK && e.getClickedBlock().getType() == Material.OAK_SIGN || e.getAction() == Action.LEFT_CLICK_BLOCK && e.getClickedBlock().getType() == Material.OAK_SIGN) {
// events
}
}
I am a complete dumb. .-.
What I want to reach is when a player clicks a sign, it should execute the event. Should I locate the sign with a Location (Bukkit.getLocation())?
how to make a placeholder in the config.yml ?
wha
wdym placeholder in config
if you mean PlaceholderAPI support, read the PAPI Wiki
and just replace("%player%,"x")
You should do it how you like it, and then when send the message do:
Player#sendMessage(Config#getString("Somet.Path").replace("%placeholder%", "some value"))
replaceAll is for regex
.replace loads heavily
lol
he?
a cpu is fast enough to handle that
well than you should do your own string parser
if .replace is computing heavy
OK, how do I do this if I get a list of strings?
just load your string with replaced placeholder to memory
and access it everytime u need
no need to .replace it everytime
foreach loop
You should loop over the list, get each message and replace
tried commenting setamount?
Static please ๐ฎโ๐จ
(yes make it comment if not yet tried)
why??
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
for (String s: lore) {
s.replace("{remained}", String.valueOf(Contrabandist.remained));
}
like this?
hahaha i was looking that video tho, you win me
xd
result of string s is ignored
then aswner is no
I mean, sorry if i sound rude but have you learn basic java?
Oh ok, sorry for asking my bad
just tell me what to add please
Javaly this is correct, isn't it? I just messed up the Spigot part, right? xd
even with comment, the same thing
loop through the list and add the result of the replace method back into another list
alright then I got no idea
and there is no way to replace the old one with new values?
you could probably do that with a stream
but its the same result
that will also make another list
get the Click Blocked
get Block Meta
getLine
if line is ==
the only thing that might work is removing 1 item out of all from the player
line is not needed
-suddenly trying to remember how to do that lol-
what, casting?
is it not check if block is instanceof sign?
I found out, that I get current amount + amount I set in the method
if I use block instanceof Material.OAK_SIGN it return an error, so I geuss no
block#getState() instanceof Sign
you dont use Material. you check if its this class https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/Sign.html
declaration: package: org.bukkit.block, interface: Sign
and then cast it to this
ah yes now it works
Thanks :D
-checking console-
CraftPlayer{name=NeonOwlGery} - aww man.. xd
(jk i know how to fix)
only if you use java <=8, but then its also a you problem
relational dbs be like ๐
oh ok
let me explain really simple about tables
table is like a record where you just store key-value pairs
someone said to me it is kinda like execl
yeah pretty much
Excel is a good comparison.
You have columns that define what kind of data goes in the table, then each row is a record with data in those columns.
not sure how to make arrays
I would recommend school3 for sql
2 options, serialize them to/from string or make relations
Hi guys, do you know how to check if an item is a food item? I thought there would be some time of ItemStack subclass like FoodItem, but apparently It does not
like
UUID
Kills
Something like:
Users (where UUID is primary key, and kills_id is foreing key)
Kills
And kills im not sure how should, be i havent used sql since 2021
hmm

foreign keys are used to make relations
woah nice key!
on bungee, does ServerConectEvent get called if you attempt to connect to an offline server?
Also better example which point forward to what you want to achive
is there anyway to update a static variable from an inherited class statically-
Why using static? Just to know haha
I ask because many ppl these days are using static for things which they are not neccessary to
I know that static should used mainly for utility things - If im wrong correct me please
I wanna know if there's a shorter way to do this java ItemStack item = p.getInventory().getItem(0); ItemMeta itemM = item.getItemMeta(); itemM.removeEnchant(Enchantment.ARROW_DAMAGE); itemM.removeEnchant(Enchantment.ARROW_FIRE); itemM.removeEnchant(Enchantment.ARROW_INFINITE); itemM.removeEnchant(Enchantment.ARROW_KNOCKBACK); itemM.removeEnchant(Enchantment.DAMAGE_ALL); itemM.removeEnchant(Enchantment.DAMAGE_ARTHROPODS); itemM.removeEnchant(Enchantment.DAMAGE_UNDEAD); itemM.removeEnchant(Enchantment.DIG_SPEED); itemM.removeEnchant(Enchantment.DURABILITY); itemM.removeEnchant(Enchantment.FIRE_ASPECT); itemM.removeEnchant(Enchantment.KNOCKBACK); itemM.removeEnchant(Enchantment.LOOT_BONUS_BLOCKS); itemM.removeEnchant(Enchantment.LOOT_BONUS_MOBS); itemM.removeEnchant(Enchantment.OXYGEN); itemM.removeEnchant(Enchantment.PROTECTION_ENVIRONMENTAL); itemM.removeEnchant(Enchantment.PROTECTION_EXPLOSIONS); itemM.removeEnchant(Enchantment.PROTECTION_FALL); itemM.removeEnchant(Enchantment.PROTECTION_FIRE); itemM.removeEnchant(Enchantment.PROTECTION_PROJECTILE); itemM.removeEnchant(Enchantment.SILK_TOUCH); itemM.removeEnchant(Enchantment.THORNS); itemM.removeEnchant(Enchantment.WATER_WORKER);
ps : this is 1.5.2
actually
static {
BaseClass.SOME_STATIC_VAR = 1;
}```
that?
there is
why not just have a loop?
bc I am un-experienced with them
it gets called when that subclass is loaded
for(Enchantment ench : Enchantment.values()) {
itemM.removeEnchant(ench);
}
ok thank you
Yes
it isn't much practical..
to copy and pasting like many times
loops is cleaner and better
Hey guys, I'm making a thing where you get plus 4 food levels when you eat something, however, since you can also consume milk, and potions, etc, I'm getting these extra food levels on them as well
I want to be able to check if item is a food item
A list of Enchants to be removed, loop the list, check if the item contain the enchant, and finally remove t
wanted to look into CraftMetaItem but its horrible in there
Oh they are basic java tho
exactly
YOU musnt be using an api, without knowing the basis from the lang
Sorry for uper cases letters discord is weird it does what his fkng ass want
well i kinda already know alot of spigot now ;- ;
and i'm to lazy to learn full java
ik but dont do that
i'll just learn as I go
ok
it's a little to late
How do I set the Name above head ? 1.8.8
?1.8
Too old! (Click the link to get the exact time)
I say it as personal opinion cuz you wont understand when ppl explain smth it will sound really technical for you and wont udnerstand it. Also it will be really diff for you to code without knowing the most important things about the lang
instead of bukkit?
what sorry?
shity discord i cannot toggle out the reply pings i need to do it on every reply
just thinking about the old versions
well I mean I KNOW what a loop is I just don't know how to a create em
hmn ok, its kinda the same
i have pings turned off lmao
oh ok, because zacken gots mad that why ๐
people are sensitive wus
on discord sometimes
if you dont like pings just turn it off lmao
dont just get mad at random people
Opinions?
this lib seems cool!
alr i got one more code that I wonder how it can be shorter
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Player p = (Player) sender;
if (sender.hasPermission("eagle.multisummon")) {
if (args.length >= 2) {
try {
EntityType entity = EntityType.valueOf(args[0]);
int amount = Integer.parseInt(args[1]);
for (int i = 0; i < amount; i++) {
p.getWorld().spawnEntity(p.getLocation(), entity);
}
p.sendMessage(colorize("&aYou've spawned &e" + args[1] + " " + args[0] + "s"));
} catch (IllegalArgumentException e) {
p.sendMessage(colorize("&4This is not an entity."));
}
} else {
p.sendMessage(colorize("&e/multisummon [mob] [amount]."));
}
} else {
p.sendMessage(colorize("&4You don't have permission to do this."));
}
} else {
sender.sendMessage(colorize("&4You cannot do this. "));
}
return true;
}```
Some code ideas, where taken from Ilussion private library
I like it, but personally id have the MenuAPI object closer to the top so you arent doing a ton of library.getApi
Theres a few simple ones, not really maintained tho
Also them i can use it asa portfolio project
simplifying things awesome!
great for new people or laziness + efficiency
Also its pretty much well organized
?paste
use early returns
it looks like a mess in discord thb
instead of heaps of nested statements
Is there a way for me to make so a mob doesn't drop any items?
I have a skill that makes the player able to spawn pigs and launch them
but I don't want them to abuse It for free food
this is an arrow anti-pattern, you can read this: https://blog.jeff-media.com/avoiding-the-arrow-anti-pattern/
doing everything with a library object?
i mean it works
Keep track of the entities and just check when they die. If they are one of the ones you spawned, remove the drop items.
imagine you have 10 more if statements
it's not readable lmao
its unreadable
I could see people wanting to create the MenuItems and PaginatedMenu objects with actual objects, not MenuAPI#newMenu etc
Ah, this makes sense
^^
well I don't
yes it's not a matter of if you do or don't
it's just good programming practice and will make your code shorter
This is how my menu lib works https://cdn.rackdevelopment.tech/img/jZ7Zi4sBlG.png
also this is my only code that has turned out as a arrow
MenuAPI.Delete ("menu")
top laziness
do you want more?
if not then please refactor it
thought you came here for advice
to make it shorter...
this will... make it... shorter
shorter code does not make it better
or more specifically, thinner
Cleaner code is what you want
^
he's stealing mine tho
I know but my code can be shortened I know that
my menu lib lol
hmm?
works a bit similar to yours
Add an inventory Solver ๐
but it's just... more polished
oh lol
I never planned for mine to be released, I just got so fucking tired of making stupid guis lol
Can i dm you them? sorry pinging tho
lol
well technically you can but I'm not willing to go into a deep conversation about my menu util
as I am planning on making a v3 which basically turns my menu util into a very low-resolution graphics engine
its not for asking help nor fucking up, i just want to ask something private and see if you agree or not
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instasnceof Player player)) {
sender.sendMessage(colorize("&4You cannot do this. "));
return true;
}
if (!sender.hasPermission("eagle.multisummon")) {
p.sendMessage(colorize("&4You don't have permission to do this."));
return true;
}
if (args.length < 2) {
p.sendMessage(colorize("&e/multisummon [mob] [amount]."));
return true;
}
try {
EntityType entity = EntityType.valueOf(args[0]);
int amount = Integer.parseInt(args[1]);
for (int i = 0; i < amount; i++) {
p.getWorld().spawnEntity(p.getLocation(), entity);
}
p.sendMessage(colorize("&aYou've spawned &e" + args[1] + " " + args[0] + "s"));
} catch (IllegalArgumentException e) {
p.sendMessage(colorize("&4This is not an entity."));
}
return true;
}```
look how much nicer that is
ew
<insert command framework here>
just make your own
without a framework
always looks horrible
eh
that wont even work will it?
yeah
you do cast it as player
nooo you have to shorten it
but then name it as p
also
command frameworks are the best
quick flaw I noticed
didnt know this emote existed lol
switch to acf this instant
yeah acf will make that much nicer
or any framework
ive been meaning to redo my command framework at some point
acf be like
I like it but some parts of it I dont like
can I check if a server is online in bungeecord?
yeah i love the context gimmick ngl
you have to ping it iirc
Yes
How can I do so?
acf is fkng painfull and also bloads your pl, from being 4.23mb full core, to being 6.70mb
you have to ping it iirc
acf is a bit too wasteful
I still need to polish my framework to auto-validate wildcards n all
yeah totally with you
Yeah I dont like how it makes you shade it
i had so much issues with it cuz the docs are trash
i mean, it's not 140KB -> 2.5MB
if you had 4.2mb this is rather fine
yeah i had to ask around the aikar's server
140kb is rather small
same
yeah that's why i'm saying that acf is overkill then
because of it being polluted
but if you already have 4.2mb, acf is not much more
also the 4.7mb the guy referred are probably other shaded deps
and by 140kb is kinda small
++
I mean in terms of code size
yeah
not including shaded code
agreed
custom senders good too
do you are have stupid
uh yeah thanks cap
Please english english i dont understand spanglish
wtf are you even talking about why tf did you bring up 14mb
wait
๐ค
im stupid tho
I write what ever on the conversor
I mean full core shaded with mongo and some custom libraries is 4.23mb and the same core but adding acf is 6.70mb
my stuff shaded is 2600kb
Brontobyte
what the fuck is a nibble
half byte
why
1 terapist = 1024 gigapist
thers a word too (16 bit)
done, what next?
(โฏยฐโกยฐ๏ผโฏ๏ธต โปโโป
โฌโโฌ ใ( ใ-ใใ)
nibble sounds funny
yeah
Why 1024? When analog values goes up to 1023
cuz 1024 bits which go from 0 to 1023?
oh my bad, that why i always say im really bad with maths
did Java 17 just mess up how I can get a string out of the config?
shouldnt
do you mean yaml?
They added shity annot to getters on newer api versions
The most annoying one is the @urban grotto
I wanted to get a sting "General.Data.Players.AllowChat"
(yes I use strings instead of booleans)
Why? ๐ค
result? chat got disabled until I removed the feature, as of "chat was disabled"
if (plugin.getConfig().get("General.Data.Players.AllowChat").equals("true")) {
config file completely contains the same value lol
basically if value is true, chat should be enabled
and if false
chat should be disabled
result? chat is always disabled lmao
nullable
feature got disabled
getBoolean?
But why? #getBoolean is a thing.
๐
personally I don't trust booleans
don't ask why
personal opinion
๐
I SAID DON'T ASK WHY!!! ๐น
I hate them returning null... ๐
so no usin' booleans
booleans be dead
null be dead
What kind of booleans are you using then? lmao
it only returns null
Youโre basically using a boolean with extra steps. Just use a boolean.
if it is can't get it
Not any kind of booleans, AH-HAHAAA
I am not even using Booleans :D
if null
set Line
sigma rule: dont trust anything
yeah let deniel reality
we're living in simulation
lets break out
๐คฃ
mmmm
Making fun of Denying objectivity
if (people.liveIn(simulation)) {
people.escape;
}
people object
I'm making a plugin for manhunts, except everything is either cursed or funny. I need some cursed ideas for It
Haha
for now you can Milk any entities and there is water in the nether
oh, and milk BLOCKS
you gain powers with the different types of milk
But I want to add more cursed stuff
Me too
You hold the bow backwards and can only shoot yourself
Didnt you ask that already some weeks ago?
Yeah he is reposting the text
or in escape runs
He sent the same message some weeks ago
Noooo, I asked for milking ideas
now I'm asking for general ideas
but I'm glad you remembered!!
WAIT, is there a way to actually make that????
like as said make tnt explode instatnly upon destroying
It is already in the game
or make all villager gollams attack you instantly
ooooh, cool
no matter what
If you spectate from the perspective of a spider, enderman, or creeper you see through their eyes
oooooh
it can be fishies, tnties, iron gollamies, anythingies
once the hunted one wins
he gets killed by fireworks
i made a gui, that when a player clicks an item it starts a task for the player using BukkitScheduler. how can i make it stop when the player clicks other item?
The compass for the manhunt only points in the exact opposite direction of the hunted
Make Random Events
hashmap
:)
Thank you, these are some great ideas you guys are suggesting
like I said, 10 minute loops, and every 10 minutes a random mob spawns upon all players (a few blocks above ofc)
which ofc can be ABSOLUTELY ANYTHING
All pants and leggings are worn in the head slot
ROFL
ender dragon spawning in front of you
that would be so epic
YES ๐คฃ
The crafting table and furnace recipes are reversed
not just epic but very funny as well ๐คฃ
Hahaha
Imagine being inside the mines, and a random ender dragon spawns above you ๐คฃ
ahahaha, woah
hahaha ๐คฃ
is it even possible?
Yep
I've seen plugins that add and remove recipes
So you must be able to change their output
o.o
yup you can!
i have done it in the past
for anvils, craftingtable and... etc
How can I make clickable only part of TextComponent? I tried something, but format stay and second part still have Hover and Click event. public static TextComponent sendMsg(String text, String cmd) { TextComponent changeName = new TextComponent(text); changeName.setColor(ChatColor.GRAY); changeName.setItalic(true); changeName.setUnderlined(true); changeName.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(text).color(ChatColor.GRAY).italic(true).create())); changeName.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, cmd)); String testText = " test"; changeName.addExtra( new TextComponent(ChatColor.RESET + testText) ); return changeName; }
2 components, and then put them together with TextComponent#addExtra()
ComponentBuilder
I tired that isnยดt I? I mean this: changeName.addExtra( new TextComponent(ChatColor.RESET + testText) );
You should use the component builder for that whole thing. Child components inherit formatting and events from their parents, but you can change that behaviour more easily with the builder
public static BaseComponent[] sendMessage(String text, String command) {
return new ComponentBuilder(text)
.color(ChatColor.GRAY).italic(true).underlined(true)
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(
new ComponentBuilder(text).color(ChatColor.GRAY).italic(true).create()
)))
.event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, command))
.append(" test", FormatRetention.NONE)
.create();
}```
(the FormatRetention.NONE is what tells it to not take events or formatting)
I tired this and its working too. Im just stupid, I dont think that will inherit everything from base one.... TextComponent comp1 = new TextComponent("green"); comp1.setColor(ChatColor.GREEN); comp1.setUnderlined(true); comp1.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("toto je zelenรก").color(ChatColor.GRAY).create())); TextComponent comp2 = new TextComponent(" red"); comp2.setBold(true); comp2.setColor(ChatColor.RED); comp2.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("toto je ฤervenรก").color(ChatColor.GRAY).create())); comp1.addExtra(comp2); player.spigot().sendMessage(comp1); this is working to
what is better way?
ComponentBuilder is easier, but either works, really
Plus one is a TextComponent, the builder produces a BaseComponent[]
(though practically all methods in Spigot take a BaseComponent[] anyways)
I shoudl put return on first line in method?
With a ComponentBuilder you can, yeah, because you're returning the result of its .create() method
You could in theory write that whole thing on one line, it just helps readability when you newline some of the calls
So BaseComponent is better? Ok soo Im gona use that than
thanks for help, I hope I understand that now
sql table of tables?
What? can you elaborate a bit more pleaser
1 sec lemme draw it
Didi I make something worng? BaseComponent[] testBuild = new ComponentBuilder("Hi") .color(ChatColor.YELLOW) .event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("hover text").color(ChatColor.GRAY).create())) .event(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "click")) .append(" test", FormatRetention.NONE); player.spigot().sendMessage(testBuild);
Are u using legacy versions?
Of spigot? Im using 1.17
doest spigot api 1.17 already add support for sending components with Player#sendMessage(component)?
Hey how to stop a scheduleSyncRepeatingTask
How would I use getConfig() in a different file that does not have extends JavaPlugin. Im getting an error when I start my plugin because I have 3 files using extends JavaPlugin
is this looking right?
top 10 diagram
Im not sure ๐ maybe?
cus i got no clue..
I gess so, If I look on bunge doc is looking like this: so it should have
how the fuck do i delete a directory it doesnt wororork with Files.walk because it liiek wlaks over the directoryies before theyre empty or something it throws error
rbrhyrburburburbrur
better way to put it: how would I use getConfig() without using extends JavaPlugin
you need to provide your plugin instance (the one extending JavaPlugin) to your other instances
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
This method works, but my not. Im confused
Got it.... .create() I need add in the end
My bad sorry.
So I would implement this:
private final JavaPlugin plugin;
public craftycore(JavaPlugin plugin) {
this.plugin = plugin;
}```
into the other files I need the JavaPlugin in?
yes exactly
and then when creating those instances from your plugin class you pass in this, so like new craftycore(this)
not in your main plugin class tho
private final JavaPlugin plugin;
public craftycore(JavaPlugin plugin) {
this.plugin = plugin;
}
right, but there is a whole bunch of errors putting this in my code
can i have an example?
where are the errors?
id assume where you create this instane
instance
variable plugin might not have been initialized
invalid way of declaration; return type required
can you show your code
i meant of how i could use it with events but thx
He is passing JavaPlgin instance tho
shouldnt be hard
wrong reply 
ah
true
If not, you will only able to access JavaPlugin obj methods
that fixed that, but did not change the fact that every getConfig() lines are broken :/
He?
That doesnt exists thoยฟ?
getConfig().getString("Prefix") + ChatColor wdym
you need to do plugin.getConfig() in the classes which dont extend JavaPlugin
no its been there for a while
ah thank you
lol i never seen that, and i have coded on many versions 1.8, 1.12. 1.16 and now coding on 1.19
Always use own FileHandler class
Ok, how would I reload a config with a command,
how would I implement this into a commadn
if (sender.hasPermission("craftycore.reload")) {
plugin.reloadConfig();
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("Prefix") + plugin.getConfig().getString("reload-message")));
return true;
} else {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("Prefix") + plugin.getConfig().getString("no-permission")));
return true;
}
}
return true;```
something like this?
plugin.reloadConfig();
oh i havent fixed that in this file yet
the FileConfiguration config; or the File cfile; one
so both
ok
I want to learn to make Minecraft mods, but I don't know where to start. I know java and programming, but not modding so I'd like to find a project idea to make.
where would I put @Override
implement is red
also ```Java
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
if (cmd.getName().equalsIgnoreCase("reload")) {
if (sender.hasPermission("craftycore.reload")) {
File file = new File(plugin.getDataFolder(), "config.yml");
FileConfiguration config = YamlConfiguration.loadConfiguration(file);
plugin.reloadConfig();
for (String reloadmessage : config.getStringList("reload-message")) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', config.getString("Prefix") + reloadmessage));
}
return true;
} else {
sender.sendMessage(ChatColor.RED + "You do not have permission to use this command!");
return true;
}
}
return false;
}
something github copilot generated me, does it do the same thing?
in config yea
one string
FileConfiguration config = YamlConfiguration.loadConfiguration(file);
plugin.reloadConfig();
what would do this
idk copilot can be stupid
yea idk
anyway looks like it works
ty
Hey, I have a question. I spawn particles that I want to slowly (clean) move to a location in x seconds, what is the best way to do this?
would the string list produce the string in the format of hello this is a list or would it do this:
hello
this
is
a
list
so the bottom one
ok good to know
er, so there is an error saying expected 1 args but found 0,
getCommand("Reload").setExecutor(new Reload());
this is when I register this command in the main class
Is possible to use ChatColor.translateAlternateColorCodes in BaseComponent[]?
quick fixing it with intellij just breaks this.plugin = plugin; in the other one
yo i want to unload a world, replace the data and reload it again
i can see it copying the files, it copied some shitty text document and unloaded the world but when i join back the world data isnt there
heres a shitty 5fps video if youre wondering what is happening (the command i ran: /copyworld world1 world): https://streamable.com/d4hs7u
my code: (- the copying part but i know that works): https://pastes.dev/zHfueMCOUm
copying and deletion logs
https://paste.md-5.net/onatoqucov.cpp
main class if that helps
Yes but you need to feed to TextComponent.fromLegacy
also just a little nitpick on my part, you're adding just straight 'reload', while the game already has this as a command, one may overwrite the other
so what would i add
what event for killing entity?
getCommand("Reload").setExecutor(new Reload(this));
ty
I have the command be craftycore:reload, how would I change this into craftycore reload
ok
Sorry for ping, but like this? TextComponent textComp = new TextComponent(text); textComp.fromLegacyText(text)
No it's a static method
The wiki page describes this
Use it instead of constructor
I could not find that on wiki there is no searchbar
Google works too


