#help-development
1 messages · Page 620 of 1
(x1 + x2)/2
for all 3 coords
hmm
and that's the middle
I'll try it
Make a vec from point A to point B and half it; The spigot API has a method for doing that I believe
na
Is it unmodifieable?
how can i create enchanted book which will works in anvils?
Make sure to use EnchantmentStorageMeta#addStoredEnchantment
i have this itemstack:
ItemStack smite = new ItemStack(Material.ENCHANTED_BOOK, 1);
smite.addUnsafeEnchantment(Enchantment.DAMAGE_UNDEAD, 1);
Doesn't enderpearl throw fire a PlayerTeleportEvent
how else can I prevent it? Eg. if it landed in certain location
Would I manually have to check for all of this in ProjectileLaunchEvent?...
projectilehitevent
Use event#getCause() and check if its TeleportCause.ENDER_PEARL
Ender Pearls don't always do damage tho
How is that relevent
Is there any preprocess event/way to replicate a preprocess event for commands sent by command blocks?
ServerCommandEvent maybe
Unfortunately I haven't been able to get the ServerCommandEvent to get called from command blocks
Hey, I made a PersistentDataType of a MerchantRecipe list and it's working when the results and ingredients for the merchant recipes are ItemStacks. But when I try to use it with a subclass of ItemStack an error is thrown: https://pastebin.com/zxCrjs3L . Here's my MerchantRecipeListDataType class: https://pastebin.com/jBv1qQ0M. Does anybody know how to solve it?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I am trying to build gradel project which I am pluling from git hub
and I am getting this error
Searched in the following locations:
https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/bukkit-1.13.1-R0.1-SNAPSHOT.jar
it is asking for dependancy which I got in my repositories
what can I do to fix that problem
does it have mavenLocal() the dependencies block
I usualluy use maven so this is unknown are for me
drop the github link
it is private project I just got access to it
Does the lore of an item have a limit to what it shows? I have a banner with more than 6 patterns and it's cutting off after the 6th (in the lore), is it possible to show all the patterns?
so link will not help you out
is it multi module
ah
You’d have to add them manually
The game won’t show more than 6 automatically
The data is there I've noticed. I have just to show it manually?
Mhm
Oh so I have to set the lore for the banner, and explictly add in all the patterns. Makes sense, thanks.
is there anyway I can utilize the API to make a custom LootTable for some chests I'm generating or do I just have to make my own system
sadge life
:( i just wanted to finish this commission
now I need to make some loot table system
yay Json parsing! yay randomizing and stuff! Yay learning how tf loottables work!!
do you know how Loottables work I seriously don't get it lol
?paste
Could you just implement loot table to create a new loot table?
Nah you can’t
help for displaying the image of an item on the texture of a block
I mean you probably could hack something together with that, but it's generally not a good Idea to implement the BukkitAPI unless you're creating a server
it'd be more easy to just implement something yourself at that point
So I'm mocking up what I want my loot-table to look like , but I'm curious what would drop-chance really entail. I see it on a lot of loot tables I'm using for example, but what does it really mean, how would I go about implementing it. for example entry one has a drop chance of 40%, and entry two has a drop chance of 30%, How would I setup choosing between entry, one or two, also what would happen if it doesn't add up to 100? would things just not drop? I honestly haven't the slightest clue how to implement this.
I mean I haven't done drop chances in so long I forgot how to do basic weighted percentages, let alone a whole loot table
I thought it was weight based
Is it possible to open the clients chat and prefill it with some command, so that the user only has to complete it (by typing a username, for example) and press enter?
it is, but tbh I completely forgot how tf weight based percentages work
Its been literally 3 years now since I've done weight based percentages, (yeah last time I did them it was in python lol)
Stack overflow had a good post on weighted random
do you know link otherwise I'll just look it up later
my brain is busted so I'm takinga break
Is there a way I can block a specific command
And all its variations
like 'enderchest' 'echest' 'ec', but without having to do each one individually
permissions
hmm yeah
commands and their aliases use a single permission
Anyome mind helping in facing a nnnoying issue
I was at first using paper api, but changed to spigot. The problem is that, even though I changed the stuff in the pom maven file the plugin still generates a paper-plugin.yml file once it compiles. I also did remove the paper-plugin.yml from the resources folder, but it keeps creating one when the plugin compiles (nothing on the ide resources folder though). Any help?
probably using the intelij minecraft plugin
yes
iirc it only creates it on project creation
^
Error when deserializing an instance of a subclass of ItemStack
What is the text shown when you over a banner and it shows what the patterns are? That doesn't seem to be the more. Is that something that can be modified?
you can hide it with an item flag, similar to attribute display and then replace it with custom lore
Can I add to it? I don't want deal with making logic for removing and adding lore lmao
You need to use lore
Probably not going to deal with it right now then. Thanks though.
opened intellij today and its being really weird about importing anything
Try to smack the repair button in the "File" heading
seemed to work, thanks
hi was trying to use eyes of ender with one of my plugins and to cancel the throw event but when trying to use Material.ENDER_EYE or EntityType.ENDER_SIGNAL I get Unknown class: 'Material.ENDER_EYE' and Unknown class: 'Material.ENDER_SIGNAL' Don't have a clue why exactly. Currently using spigot 1.19.4-R0.1
missing import, or you imported the Minecraft Material instea fo Bukkit
its using org.bukkit.entity.EntityType; & org.bukkit.Material;
and all other items work
class StaffChat {
private val statesMap: MutableMap<UUID, Boolean> = HashMap()
private var mm = MiniMessage.miniMessage()
private fun setState(player: Player, state: Boolean) {
statesMap[player.uniqueId] = state
for ((key, value) in statesMap) {
println("$key: $value")
}
}
fun toggleState(player: Player) {
val state = getState(player)
setState(player, !state)
player.sendMessage(mm.deserialize("<${if (state) "green" else "red"}>Staff chat ${if (state) "enabled" else "disabled"}"))
}
fun getState(player: Player): Boolean {
if (!statesMap.containsKey(player.uniqueId)) {
statesMap[player.uniqueId] = false
}
return statesMap[player.uniqueId]!!
}
fun sendMsg(player: Player, message: String) {
for (onlinePlayer in player.server.onlinePlayers) {
if (onlinePlayer.hasPermission("void.staff")) {
onlinePlayer.sendMessage(mm.deserialize("<aqua><bold>Staff<reset> <dark_gray>→<reset> <aqua>${player.name}<reset><dark_gray>:<reset> $message"))
}
}
}
}
I'm attempting to make a staff chat toggle, does anyone know why my toggle function isn't working? Every time it runs it stays as True for some reason
it's just Eye of enders
Actually I was just really dumb, my bad, I was using instanceof to check if two things are correct
what's the best way to make an item that is usally stackable non-stackable
I was thinking of just setting some random key of the item's PDC to a random uuid
Yeah that’s pretty much the way
that's probably a fine idea
alright thanks
?paste for me...
I like the solution, but the creator has a fatal flaw in the design. What happens if I have 2 elements weighted at 50%? The internal design would then fail. I don't necessarily know the math of weights as I haven't looked in a while, but I would think it would be possible to have two elements weighted at 50% evenly
The navigable map one?
Two elements weighted at 50 means an equal chance to choose either
but can't you not have 2 map keys of 50
since its a Double, E not E, Double
the second put call would overwrite the first element no?
I implemented this, on the sides it somewhat works but it's glitchy, on top I'm bouncing the player off from the block in the center of the region. But it's not consistent. Sometimes players will get stuck on top of it, not being able to move, it happens randomly, should I use a different approach to this instead of just checking if player y axis is the same (or lower) than the maximum region y axis?
Here's how I handle it, a code snippet for an example:
@EventHandler(ignoreCancelled = true)
public void onPlayerMove(org.bukkit.event.player.PlayerMoveEvent event) {
Player player = event.getPlayer();
Location from = event.getFrom();
Location to = event.getTo();
// minimalize location checking
if (from.getBlockX() == to.getBlockX() &&
from.getBlockY() == to.getBlockY() &&
from.getBlockZ() == to.getBlockZ())
return;
... // region checking handling, etc..
if (currentYAxis == maxRegionYAxis) { // if player jumped on top
Location middleLocation = regionData.getMiddleLocation();
event.setTo(middleLocation);
// disable fall damage
player.setFallDistance(0);
Vector direction = from.toVector().subtract(middleLocation.toVector()).normalize();
player.setVelocity(direction.multiply(1));
...
// if I attempt to cancel the event, player won't "bounce" back
}
}```
you are having trouble finding the middle of two locations?
No I've calculated that, but the player gets stuck on top of the region sometimes, only on top
Sometimes it would bounce the player away and sometimes, randomly it would just not do anything, the player would be stuck at the region highest y axis
a cleaner return can be if (from.getBlock().equals(to.getBlock())) return;
I'll try that
So basically where do I put that
to replace your current early return
before currentYAxis == maxRegionYAxis?
the // minimalize location checking
Ok!
your direction calculation also seems to be reversed
can I send you a short video of what it does?
depends if you want to bounce them towards or away from middle
ok direction looks fine then
it looks like you get "stuck" if you move during you being pushed when still close to middle
which means you have a short vector
How can I fix it? xD
probably zero
Setting player vector to 0?
multiply by 1 does nothing
debug the vector then. make sure it's throwing you up every time
check the Y value
if Y goes negative then your center calculation is probably bad
Let me test this
you mean the y value as a location, right?
no
yaw?
y value of teh direction vector
looks fine
Then what else could there be
could you be colliding with a block?
nope
don't feel like posting it here
I wasn't colliding with a block
again, glitched at y=0.7
I created an inventory using
Bukkit.createInventory(player, InventoryType.ANVIL, "Custom Title")
But when i now try to get the rename text, when clicking the item (and therefore renaming it)
((AnvilInventory) e.getInventory()).getRenameText()
i get an exception:
ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.inventory.CraftInventoryCustom cannot be cast to class org.bukkit.inventory.AnvilInventory (org.bukkit.craftbukkit.v1_19_R1.inventory.CraftInventoryCustom and org.bukkit.inventory.AnvilInventory are in unnamed module of loader java.net.URLClassLoader @3b764bce)
Why / How to solve this?
what event are you listening for?
onInventoryClick
anvils have their own events
oh, which is it
ok ill try to google it
?jd-s
PrepareAnvilEvent
the only one i can see is PrepareAnvilEvent
thats called when u edit the item?
oh wow
what a weird naming then
how?
the doc says "Called when an item is put in a slot for repair by an anvil."
I dont think its called when you edit the item (by clicking on the result)
But i can try.
you can edit the item in the prepareanvil event
no but i want to detect the player editing the item, by clicking on the result on the right
when you put an item in the item + item thing, the event is called
and you can put items in the output
idk if you can chekc if the item was picked up
maybe checking if an item has been added to the player's inventory
i need to detect when this is clicked
yeah idk
the item on the right
it fires the onInventoryClick
but yeah, classcastexception ..
anvil prepare item event
thats also in prepare?
yeah
how can i fix this error:
16.07 00:12:46 [Server] [INFO] java.lang.NullPointerException: Cannot invoke "java.sql.Connection.createStatement()" because "this.databaseConnection" is null
16.07 00:12:46 [Server] [INFO] at dev.bentech.statisticsplus.StatisticsAPI.createTables(StatisticsAPI.java:22) ~[StatisticsPlus-1.0-SNAPSHOT.jar:?]
16.07 00:12:46 [Server] [INFO] at dev.bentech.statisticsplus.StatisticsAPI.onEnable(StatisticsAPI.java:82) ~[StatisticsPlus-1.0-SNAPSHOT.jar:?]
16.07 00:12:46 [Server] [INFO] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[purpur-api-1.19.4-R0.1-SNAPSHOT.jar:?]
16.07 00:12:46 [Server] [INFO] at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[purpur-api-1.19.4-R0.1-SNAPSHOT.jar:?]
16.07 00:12:46 [Server] [INFO] at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugin(CraftServer.java:577) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugins(CraftServer.java:488) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:643) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:442) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:345) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1120) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:325) ~[purpur-1.19.4.jar:git-Purpur-"6886272"]
16.07 00:12:46 [Server] [INFO] at java.lang.Thread.run(Thread.java:833) ~[?:?]
16.07 00:12:46 [Server] [INFO] [StatisticsAPI] Disabling StatisticsAPI v1.0-SNAPSHOT`
heres my code: https://paste.md-5.net/ahodameziz.js
get the result item
because you create tables before establishing a connection
Does not seem to get called with fake anvil inventories, only with real ones :(
When i change the name of an item in a real anvil, it triggers PrepareAnvilEvent every time
But when i change the name of the item in the fake anvil, which i made with Bukkit.createInventory, the event doesnt trigger once .... hmmmm
and i also cant take the resulting item out, whenever i click it, it just resets to the default again
im getting the same error with a playerjoinevent
@EventHandler
public void onJoin(PlayerJoinEvent event) {
if (event.getPlayer().hasPlayedBefore()){
try {
Statement statement = databaseConnection.createStatement();
String createUser = "INSERT INTO `" + tablePrefix + "statistics` (`player_name`, `player_uuid`, `playtime`, `blocks_mined`, `kills`, `chat_messages_sent`, `deaths`, `xp`, `balance`, `blocks_placed`) VALUES ('" + event.getPlayer().getName().toLowerCase(Locale.ROOT) + "', '" + event.getPlayer().getUniqueId() + "', '0', '0', '0', '0', '0', '0', '0', '0')";
statement.executeUpdate(createUser);
statement.close();
} catch (SQLException e){
getLogger().warning("Error creating Player Row: " + e.getMessage());
e.printStackTrace();
}
}
}
thats what i mean with "resets to default"
Not cancelling any event, so idk what causes this... is this normal with fake inventories?
Do fake inventories created via Bukkit.createInventory not trigger their respective events when stuff happens in them?
do you know how i can get an AnvilInventory from the CraftInventoryCustom?
the connection is null, use a database class that has all of the sql code inside
because its cleaner
e.getClickedInventory().getItem(2) is null, anyone got an idea why? (getItem(0) returns the left item as expected)
e.getCurrentItem() is null too, so its not in my hand either, ig
Am i doing something wrong, or is Bukkit.createInventory(player, InventoryType.ANVIL just completely broken and unusable?
(if so, maybe mark it as deprecated?)
Is there a click called when you shift click an item?
declaration: package: org.bukkit.event.inventory, enum: ClickType
called SHIFT_RIGHT or SHIFT_LEFT
theres more in there too.
ItemStack item = player.getInventory().getItemInMainHand();
ItemMeta itemMeta = item.getItemMeta();
itemMeta.getDisplayName();
what reasons would make the displayName return nothing?
Btw u can use
item.hasItemMeta()
Or smth like that
thats the thing, I check if they no name on the command. if it doesnt then it wont work. but this goes on, it gives me my ticket with a blank display name. like that item didnt have one, when i know it did because i held it.
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
I added a maven-shade-plugin to my pom.xml (because the AnvilGUI wants to be included in the Jar) and now i'm getting this error: java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.addPacketListener(com.comphenix.protocol.events.PacketListener)" because the return value of "com.comphenix.protocol.ProtocolLibrary.getProtocolManager()" is null
Why is that?
I'm also getting this warning then clicking "install" in maven:
[WARNING] MapMenu-1.0.jar, ProtocolLib-4.8.0.jar define 1 overlapping resource:
[WARNING] - plugin.yml
?paste
for me ^
https://paste.md-5.net/awobemonuj.http
I'm pretty sure this all that is relevant.
Fixed it, had to set
<scope>provided</scope>
for ProtocolLib
I didn’t realize those click were types lmfao. Ok yeah that’s easy.
Can someone please help me? I am using SuperiorSkyBlock2 and the /is upgrades are not showing
Is there an docs about client-side items :l?
Love how I take a break for ONE WEEK and basic java breaks.... what???? Why the fuck aint this message firing it 100% should be
like... wha?
And my logs are acting up too.... Its like certain things (Lets say MongoDB's logs, but in my case its Spark rest logs) arent showing up either, wtf going on with my CLI?
wtf even if i empty the convertToOgg method to empty with only the log it doesnt fire.... what???
Why is java ignoring my instructions? Arent computers supposed to execute instructions i give them?
? What the actual fuck?
No errors no nothing...
Could be some file permission issue
what is ffExecutor?
IE My package structure? I did recently reformat my entire project and these 2 packages are on the same level but, i would get an illegal access error in my console (I would assume)
Its just a class i sent it in the screenshot above ^ i even emptied that method out to only contain a log and it has same behvaiour, see recent screenshot
lmao what ???
even a new method does nothing??
something aint right here...
Why blockPhysicEvents called like 6 times ?
Yea, not sure that is strange. Is your runtime log level set to display warnings/errors?
IIRC That event is just like that by default + it has to update verticle blocks for verticle cactuses (assumption ofc)
idk how to even do that
so it should be default
same with sugar cane
but that look legit
try Bukkit.getLogger.severe() to see if that shows in the dofuckingsomething method
tried everything nothings fired
even raw System.out.prinlnt and throwing exceptions, it just acts like they dont exist
yee
If so try a maven clean build/package (whatever you're using, clean is the important part), maybe restart IDE as well. Could be some weird caching thing
havent tried invalidating caches since my refactor ill try that
clean will delete all previously compiled files, forcing maven to recompile everything, may be worth a shot as well
thats what clean does
yea...
same behavior sadly
:\ ok out of ideas
/killyourself
and it just kills U
oh wait ur having code issues
not a creative burnout
woops
more like a java is absolutely dumb issue
absolutely n oreason a error or my message shouldnt be logged rn
kinda bullshit ngl
Java is annoying sometimes
it rly is
i would really like to know why my cli is so fucked and not showing my spring, spark or mongodb logs though
thats prolly like 40% of the issue tbh
never upgrading my gpu again smh
I can bet the issue will be like you missed one letter or something lol
im suspecting that ffmpeg isnt initialized for some reason
but, i should be getting an error
im not catching this anywhere or using sneaky throws so not sure why loggings fucked
well i immediately throw any catches i grab and i dont catch generic Exception i specify the exceptions i want to catch
yep, that was the issue
Now the big question: Why the fuck didnt that throw an error during runtime? Is it possible my global java logger is set to ignore errors for some reason?
when attempting to use a class thats not initialized its always thrown errors
Well, everythings possible, this is java
idk i just want my console how it was a week ago
its like this on any java application i open too
Doesn't java have like a settings panel?
well
yes
but its pretty ... strange
ive only ever used it on mac (and i honestly forget why), i think the button to access it on windows is hidden away in Control Panel
Do I need to call save on a fileconfiguration file after setting smth?
possibly
Wait if I am accessing a FileConfiguration from another plugin is there any reason that they would be overriding my changes?
it does and logging got unchecked somehow smh ty
oh god im horrible at this, was gonna make the file size for this smaller and i ended up making it 4x the size (was like 133mb)
Question why are you accessing FC of another plugin
And let alone editing said file
I am writing an addon for smth and just need to set a value inside their player's yml file
fair enough
Yes, depending on the plugin though your changes will get overwriten
You need to actually make the plugin support addons & support modifying player data
As most just periodically flash theyre HashMaps of PlayerData (If you find this, you can edit data this way possibly)
But, likely not since most decent plugins are gonna make a Data class, and not just store a bunch of FC's in a HashMap
Ideally I would use that but I don't believe they do, its not my plugin and im just devving something simple, if needed Ig I can just implement a barebones system myself
im trying to make a multiplier system and im using TimeUnit to save the time the player has for the multiplier inside the database but how can i check two times between now and the time saved in the database?
How to remove blockdrop from BlockPhysicsEvent?
event.getBlock().getDrops().clear() but no luck
[04:44:51 INFO]: /103.166.13.64:52843 lost connection: If you wish to use IP forwarding, please enable it in your BungeeCord config as well!
Whats This eror
How to enable It
in the config of bungee
oh xD
Line 16 spigot.yml
Also, isn't this a #help-server question?
Ok
Does Spigot Interaction entity return it's data properly?
I'm getting 0.0 width and height
setting it seems to work though
sorry for the really late ping but that's something the only thing i realized and probably i need it to instant and instant already supports "placeholder" like this there's a method for that, TimeUnit cannot be saved inside mongo so this creates some problems and for clarification im using it for a multiplier system
You parse the time as seconds and add it to the current epoch
what?
time from java.sql?
found a way to translate them via Duration.parse("PT" + duration)
Problem, i wated 10 minutes the system should work after 10 minutes but it doesn't
Runner: https://paste.md-5.net/azovohujag.cs
Multiplier Class: https://paste.md-5.net/ularidoqew.java
How i set it up: ```java
UserManager.setMultipliers(commandSender.getUniqueId(), new Multiplier(1, Duration.parse("PT10M").toString()));
This is what it logs in console as an example when i tested the if it worked
[09:17:11 INFO]: multiplier: 2023-07-16T07:18:11.204696100Z
[09:17:11 INFO]: Instant: 2023-07-16T07:17:11.274935900Z
every time the multiplier value goes 1 minutes after the instant one
piston push break the BlockPhysicsEvent ?
how do i change the player's nametag
With Scoreboard
with team prefixes?
Yeah
It's best if you write a wrapper for it so you can then use it further on
How did you try to change it?
How would I teleport the player around the certain area that is x and y in width?
ill try it again
Hi there,
I have made a hologram with an item name, and have some item names in my GUI.
The only issue that I am having is that I would like to show the clients language item names.
So if I have set my client to German it will use the German item names and so on.
How would I be able to do this?
you can use localizedName()
Uhh components
If you're using paper this is like 15x easier
Wouldn't suggest this but eh
The issue is that the whole project has been made with spigot.
Changing it to paper will take a long time and time that I don't have XD
as much as I love to do it tho
paper API is compatible with spigot API, you literally just swap out the dependencies
Like, you are probably gonna get clapped with a shit load of deprecation warnings for all methods that should be using components
but it'll compile
It keeps saying this
No idea why and because of what
The whole dependencie is good
Hi, does anyone know if Bukkit.getPlayer(uuid) works for players joining via Geyser (bedrock edition)?
the team appears with /team list, but the player doesnt get the prefix or suffix
i didnt add display name while trying it
You never set the player's scoreboard
ok thanks
dead chat
Ugh why are you using a static collection on your usermanager
static abuse
?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.
I've ran out of patience
me personally
i love static electricity @echo basalt
but i guess others may finding that... shocking...
lol
i fixed that on the Manager for the Multiplier but i forgot on the usermanager
omg i hate so much when i'm abstract programming
no I write all my guides by hand
only making the structures/signatures
but not implementing anything
it's so much pain
hmmm XD
You need to say static "state" not just static
I was writing the static guide on discord and it crashed so I wrote it in notepad++ and did a couple word changes here and there
Java is inherently OOP, but not enforce you to use OOP, it is a Multi paradigm you can also FP
so after this, any fix for the problem?
I can use all functions as static in point of FP paradigm
I'm not looking for feedback
i know static abuse etcs
No need to show how smart you are
I'm not to show you about that
I'm just saying your comments seems "static" is bad
The guide's audience is beginners so talking about paradigms is just going to overcomplicate things
Static has use-case scenarios
And I touch on that
You gotta shift the paradigm
Yes I just concerend that it can make people to think "static" is bad, not just static, static "state" the other side your comments helpful
i started a war. only for counting time
This is for all paradigm static state is bad in most cases
Not just for single paradigm
a wild md_5 appeared
chilling in offline mode xD
Hi, sorry for inconvenience.
I would know if the programmation of creation of an inventory customise is different between minecraft 1.8 and 1.18 ?
I'm a minecraft developper begginer, i start yesterday
thanks illusion again for the class i missed to add lazy and i fixed the issue
i already develop on C++ and when i check the syntax and other thing very similar and i know the particularity between twice.
So click components dont work in 1.20.1 anymore? Spigots component api and minimessage both dont work
client says
Not allowed to run command with signed argument from click event:
Any workarounds or ways to fix?
you cannot force a client to run a command that requires signed arguments
e.g. /whisper
Tbh, I think it's always better to learn programming while having a project. Something concrete, something in which you just don't learn theory, but also usecases
But then when you have a project, people blame you for not knowing the language
otherwise you'd be able to force them to write a "chat" message (e.g. whisper command) to another player
🤷🏻♂️
But any workarounds? or are click commands just over and should be deprecated?
click commands are perfectly fine
they simply do not work for a specific set of commands as you'd otherwise be able to force a player to chat against their will
workaround would be you implementing a command that mirrors the functionality yourself
What command are you trying to run
Oh okay so it depends how the commands are implemented, my plugin commands work fine
yes
literally just /say and /whisper should "fail"
I might be missing a command, but those were implemented by mojang to support chat signatures, e.g. they can be reported to them via chat reporting
I love it how minimessages docs has only examples with non working commands for the stuff l0l
True
The whole adventure wiki is pretty empty imo
ye i hate navigating it:D
Are you gonna shoot them a PR ?
But that's still something, paper Dev tools have no documentation
otherwise, I'd quickly give someone overthere at least a heads up
paper dev tools ?
do you mean paperweight 
Paperweight
I prefer documentation than code
I mean, wwe are not gonna give you a documentation on the entirty of gradle plugins ??
Isn't it written in kotlin btw?
I still have to guess what it does
there is no use for a full blown docs page
if you are gonna dive into the codebase because you wanna do hacky shit
that is up to you
otherwise the only thing you do in userdev is
A) Add the plugin
B) define the depdency in the dependency block
C) run reobfJar
Paper API has also no documentation the last time I checked there were like 2 pages
You are free to contribute
Not when I don't know how it works either?
I mean, we don't add any terribly extensive API that is hard to understand
not yet at least
between javadocs and method naming, it should be trivial enough to figure out
like javadocs or
bc paper has javadocs, its a bit wonky to navigate to but its there
probably talking about https://docs.papermc.io/paper/dev
yeah
they really gotta link their javadocs somewhere on that page, the amount of times i click on Documentation on the papermc.io landing page expecting to see JavaDocs
idk I just have it bookmarked 😅

feel free to do it:)
oki 🙂
ill probably end up making something MM-like so i can use spigor components
and dont feel like depending on adventure
yeah its pretty large shaded
plain adventure api is large shaded ?
the serialisers are annoying af given they shade gson
yeah I always have to search for them instead
in the old site it was quite easy to find
||t||
How do you determine if player is online or offline, just by having their name
Thanks!
doesnt spigot already have gson?
Yea but adventure serialiser isn't spigot specific
Got a question, Why are the DisplayBlock a little dark or lighter sometimes? And is there a way to make it the same brightness as the blocks around it? If i place a displayBLock next to some normal blocks, you can see which one is fake
displays have their own light level
Isthere a way to change the light level?
Because it also seems that some sides have different light levels
?jd-s read the javadocs
at plugin.whiteplus.Utilities.Utils.hasItemEnchant(Utils.java:15) ~[WhitePlus-0.1.jar:?]
at plugin.whiteplus.Utilities.Enchants.CustomMending.MendingListener.customMendItem(MendingListener.java:72) ~[WhitePlus-0.1.jar:?]```
```java
public static boolean hasItemEnchant(ItemStack item, Enchantment enchantment){
if(!item.hasItemMeta()) return false;
return ((EnchantmentStorageMeta) Objects.requireNonNull(item.getItemMeta())).hasStoredEnchant(enchantment);
}
What im doing wrong?
declaration: package: org.bukkit.inventory.meta, interface: ItemMeta
Poll: In 2023, for a good code base and good design, should lombok be used?
personal choice, but using lombok makes code less readable to anyone who doesn't use lombok
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
i mean you can always google, but it doesnt make it that much clearer
Lombok is a must have. Classes become cluttered and hard to read without out it = bad design
boilerplate code != bad design
What's lombok
I need some help figuring out how to spawn custom mobs I made on given locations (7 locations) and the amount of mobs cannot exceed 14. I was thinking using an invisible armor stand to check the mobs count in a 50 block radius.
That's wrong. Complex code is bad design
And with many getters and setters, the complexity increases
boilerplate != complex
Still wrong
which is exactly what lombok replaces, boilerplate code
how does WorldEdit achieve multiple strings separated by comma in one command parameter and still get tab suggestions
tab suggestion is a list of strings yeah? So how?
Well, It's done by checking for that stuff in tab completion
The whole definition of boilerplate is that it makes things unnecessary complex
Yeah but if I have values eg.
["one", "two", "three"]
and if I type /command one,
will i get suggestions for one two three
Yes I think
No, I suggest you go read what boilerplace code actual is
Explain
Go learn what boiler plate code is
So you can't tell yourself what boilerplate code is
Why are you having this discussion then?
Basically, what you usually do is
if(strings.length == 1) return new List<>();
Or something like tgat
yes I can, you just seem to be arguing over something you don;t know
You can't even form arguments lmao, just be silent if you don't have anything to say, thank you
Stop being an ass.
Dito
oh? so how about this case? how would I do checks here? xD
ok as you are too lazy to even learn what you are arguing about. Boiler plate code is NOT comp[lext codeIn computer programming, boilerplate code or boilerplate refers to sections of code that have to be included in many places with little or no alteration. It is often used when referring to languages that are considered verbose, i.e. the programmer must write a lot of code to do minimal jobs.
lombok replaces that boiler plate code. It's not complex nor confusing, It's the basics of classes
ie. construtors, getters/setters
You just described complexity, congratulations
wrong
"must write a lot of code to do minimal jobs"
quantity of code != complexity
please learn what you are arguing about. Use a dictionary and lookup th edefinition of conplex
Google the definition of complexity and paste it in, and compare your other copied definition
why don;t you as you are the one calliing basic boilerplate code is complex
Because you are the one who has to do search for the definitions lmao
"no ur wrong" is not an argument btw
only because you refuse to learn what you are trying to argue
This is exactly what you are doing. I'm the one providing definitions.
You split it by commas, get the last elemrnt and well you just suggest it according to the already typed in letters ig
I'll try that.. Thank you
It worked but if you press TAB with 2 or more suggestions it'll just remove all and only keep the one I typed
I guess that has to do something with packets?
You need to add the existing text to the start of your suggestion
Yes
Okay, let me sum up you responses:
"wrong"
"Go learn what xyz is"
If you want to have a proper discussion then please at least form proper arguments, as I have already said.
Apart from that, I have searched up the definition of complexity "The intuitive criterion of complexity can be formulated as follows: a system would be more complex if more parts could be distinguished, and if more connections between them existed.".
Now, you have already spend the other half of the work, all you have to do is to read both
This is going to my nerves, if you have something to say then do it properly, thanks.
Seroiusly give up, you are completely wrong. Read lonbok's own page. It replaces boilerplate code like constructors and getters/setters. Boilerplate is NOT complex its just repetitive. Repetitive is not complex, it's the most basic of Java code you can have.
You are doing it again. I literally already gave you the definition for you
An incorrect definition
It is literally copied from wikipedia lmao
No you typed a generic statement about complexity. No relation to programming.
the number of "connections" has no relation to complexity or the application of lombok
In the context of algorithms it's a different definition. But it's about code, text
lombok has no relation to algorithms either
And if something causes you to spend more time than you should have to, then the thing is complex. Even a child could tell you that
time taken to type basic Java boilerplatecode is not complex, just time consuming
Repetetiveness is not complexity
you seem to be associating time taken with complexity.
I literally gave you the definition and you are still thinking that? Okay.
Because complexity almost always leads to more time. Simple
Literally what lombok does is replace you having to type repetitive sequences of code. That code is not complex in any definition.
In the context of algorithms, the complexity is the same. But in the context of code, the complexity has decreased.
Exactly this, you are stating longer duration = complex. Which is completely wrong
you are twisting it around, complex CAN mean more time but more time does not mean more complex
Seriously WHY are you bringing up algorithms again? lombok has nothing to do with them
Hey im getting this error when trying to pass my config file to another class: https://paste.md-5.net/upufedegam.apache
this is the script im using to pass it:
FileConfiguration config = getConfig();
getServer().getPluginManager().registerEvents(new XPListener(config), this);```
and this is my xpListener class: https://paste.md-5.net/luyepibeya.java
My prior argument has no relation to time at all. Wasted time is just a good indication of complexity.
Just stop, none of your broken arguments apply in any way to lombok
Because you seem to mix the both definitions
Why are they broken? Because you can't say anything against them?
I have broken down every one of yoru statements proven you wrong. You are simply unwilling to learn so I've no more time to waste talking to a wall.
No
Let me quote you
Quote all you like I'm done talking to a fool
Just accept that you are wrong.
That you don't even understand the difference between algorithmic complexity and generic complexity says it all. Please don't be a douche in the future and start discussions by forming proper arguments, thanks. This would save us both time
lol
How to store uuid in database? Im new to this.
You can store them as strings using uuid.toString(). And as the data type for the column you may use char(36)
Ok tks
Some database types even have native support for uuids, but that's not many. Rather use strings
bump
So I'm back for some help. I'm trying to use ChatComponents to send a hyperlink, but my plugin doesn't load at server startup if I use that API instead of using player.sendMessage(""). Here's my code:
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String [] args) {
Player player = (Player) sender;
TextComponent message = new TextComponent("[!] Pulsa aqui para unirte a nuestro Discord");
message.setColor(net.md_5.bungee.api.ChatColor.LIGHT_PURPLE);
message.setUnderlined(true);
message.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Únete al Discord de --------- (enlace externo)").create()));
message.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "(discord invite link)"));
player.spigot().sendMessage(message);
return true;
}
Note that variables get initated before you construct the object
what do you mean it "doesnt load?"
And thus your config variable is null while your other one already tries to access it
ah, do you know a way to fix the issue? i did it before but cant remember how i did it
/plugins shows that my plugin hasn't been loaded (shows its name in red)
You can simply set the value within your constructor. E.g.
private final String beans;
public BeanObject() {
this.beans = "";
}
well let me check again cuz i forgot
mhm
your command doesnt seem to be registered in your plugin.yml
What's the best recommended event/method to get the tnt entity dispensed from a dispenser?
The javadocs page has a search feature, makes things a ton easier
I saw that event, the issue is I don't get the entity from that
My guess would be that you would have to listen to the entity spawn event as well
Why doesn't this teleport the player to the location, which is in another world?
Location tpLocation = regionData.getFirstLocation();
player.teleport(tpLocation);
I've checked and world is not null
right now I'm in the nether and player.teleport() isn't teleporting me anywhere
If I am in the normal world, I'll get teleported
anothe rplugin preventing it?
No actually it's the only plugin I have
Then there is no reason for it to not teleport, unless you are performing muliple teleports
One sec I might have found the issue lol
why is Messenger.MAX_MESSAGE_SIZE == 32766?
wiki.vg says that it's 1048576
in PacketPlayOutCustomPayload's constructor it's also 1048576
Not sure. Give me like 15 minutes and I'll look a little more in detail for you. Could be intentional, could be that it hasn't been updated since it was introduced in like 2013
larger size will error on Bungee
Mmm, ty
Is it possible to suppress "... moved too quickly!" messages when teleporting players? why does it happen in the first place?
eg. happens on this:
Location middleLocation = regionData.getMiddleLocation();
Location tpLocation = new Location(middleLocation.getWorld(),
middleLocation.getX(), regionData.getHighestYAxis() + 2, middleLocation.getZ());
player.teleport(tpLocation);
fixed: player.teleport(tpLocation, TeleportCause.PLUGIN) and set player vector to 0
thanks, that worked, however im not sure how to get around it here:
error: https://paste.md-5.net/ononahiboc.apache
code: https://paste.md-5.net/agadayeyum.java
blud 💀
thats just wrong
boilerplate can be not complex
for example
can I bypass this limit?
like why would I care about this bungee limit while running a server without bungee
1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+1-1+1+ this is boilerplate
You could also just split the message into multiple
but not complex
its just a series of additions and substractions of 1
most 2nd graders can solve this
but its boilerplate, since u can just do 8.5*2
therefore, length isnt complexity
your argument is both inaccurate in real life and in practice, and in coding
why can't I send the message as is?
why is there a limit just for people who use bungee
That's literally complexity. Complexity doesn't mean that it is hard to solve, but it instead means that it takes more effort to solve than it should
i dont think u would say thats boilerplate 😅
My guessed would be that they just limited it to whatever they thought was enough for anyone. And 32kb is a lot for its main and expecred purpose
thats actually the definition of boilerplate though
Boilerplate adds complexity, but complexity doesn't necessarily add boilerplate
no
wrong
they are not covariant by any means
You just did it again
yes because I got fed up explaining things to you you refuse to understand
Of course they are
na
you just blindly argue with everyone when you are incorrect.
That's not the case, but okay
Then explain
well can you counter prove it, that is can you prove this is always the case for all programs semantically written?
not really
it depends on the definition of complex
im assuming youre using the standard definition of complex
"difficult to analyze, understand, or explain "
most boilerplate, at least in java, does not make it harder to understand, or explain
I mean sure if you have an extreme amount of boilerplate it will make it more complicated to understand, and possibly read (although that relation is by no means covariant), however that does not imply the program itself is of a more complex character
most boilerplate make it easier to understand over an annotation many people have to lookup to understand what its doing.
we can talk about complexity in terms of different views; that is readability, testability, statefulness and so on
but saying boilerplate always leads to more complexity is erroneous
and because of the way lombok behaves
its just more of a pain to debug
if something goes wrong
yes additionally its a 3rd party lib
using any 3rd party lib makes ur program more complex
btw @ivory sleet does tap water in sweden actually taste amazing
yeah
damn
its scrumptious
well it doesnt taste anything in principle
but thats why its so good lol
tap water in Ramsgate (east of England) tastes amazing too
looks tasty
average #help-development topic 
looks like Cola on tap 🙂
bump ;D
if you drink it you will like it, but only once
"Complexity characterises the behaviour of a system or model whose components interact in multiple ways and follow local rules, leading to nonlinearity, randomness, collective dynamics, hierarchy, and emergence.[1][2]
The term is generally used to characterize something with many parts where those parts interact with each other in multiple ways, culminating in a higher order of emergence greater than the sum of its parts. The study of these complex linkages at various scales is the main goal of complex systems theory.
The intuitive criterion of complexity can be formulated as follows: a system would be more complex if more parts could be distinguished, and if more connections between them existed.[3]"
=> Basically something that is more complicated than it could be. It does not automatically mean that it is more difficult to understand, but that's usually the result of complexity.
"In Java programs, DTO classes are often provided with methods for getting and setting instance variables. The definitions of these methods can frequently be regarded as boilerplate. Although the code will vary from one class to another, it is sufficiently stereotypical in structure that it would be better generated automatically than written by hand. For example, in the following Java class representing a pet, almost all the code is boilerplate except for the declarations of Pet, name, and owner: ..."
Boilerplate in this context adds more things that takes way more effort to cognitively understand what it is about than a single @Getter or @Setter.
Thus, and as there is a known easier alternative, it is complex
Free coca-cola.
Although the code will vary from one class to another, it is sufficiently stereotypical in structure that it would be better generated automatically than written by hand.BETTER does not imply complexity
auto generated makes it harder to modify.
Its shortening code but not removing complexity
else we'll start counting lines of code towards complexity
It's not about the lines, but about what you have to go through in your mind when reading a method. With a @Getter you immediately know what's up and also immediately have the connections. With getters and setters you have to go through its properties, name, visibility and internal logic. And that for any method that is likely spread around the class.
=> Added complexity
No you only know IF you know what lombok is and does
you can also argue that lombok just hides the complexity, it doesnt disappear
na bro
@Getter I would wonder wtf does this do
what access modifiers does this add
is this thread safe?
is this tested properly as its a 3rd party lib
I mean, this could also be said the other way around
Then consider if this is lombok or some other annotation system
how exactly?
@Getter just gets field and field type, then on processing generates:
public Type getField() { return this.field }
Or Am I wrong?
yeah see here
In the context of not knowing, for instance what a private mofifier does. Surely less likely, but what I am trying to say is that "not understanding" isn't a factor that should be a factor in this.
In that case complexity would be completely subjective, however neither the visibility attribute nor lombok's getters/setters are difficult to understand
yes sure marcely, but we have to at least suppose the program's author knows the semantics and grammar of the how the program is implemented
however that cannot be said about 3rd party libs
as they are just that; 3rd party libs
if I used lombok, it would take me some time to understand what it does
Lombok is so widely used, I am pretty sure that it is safe to assume that the common experienced deceloper knows what it is
not at all
But yes, the complexity surely differs depending on the perspective. We can agree on that
I used lombok many years ago. Today I dislike and never use it
I do not know it's annotations today
but straying off topic
the end is boilerplate does not inherently add complexity especially as it is the default, and as such neither can it be said lombok removes complexity.
yeah lombok takes away boilerplate
thats quite literally the reason for its very existence
yep
I think that's a fair summary. Neither was fully right
myea lets call it a day
yeah
I need some help figuring out how to spawn custom mobs I made on given locations (7 locations) and the amount of mobs cannot exceed 14. I was thinking using an invisible armor stand to check the mobs count in a 50 block radius. Anyone got ideas?
bump 🥲
economy seems to be null, no?
it shouldnt be null, and thats what im confused about
well where do u create it?
in the onenable
getServer().getPluginManager().registerEvents(new BalanceListener(economy, config), this);```
private Economy economy;
private boolean setupEconomy() {
RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager()
.getRegistration(Economy.class);
if (economyProvider != null) {
economy = economyProvider.getProvider();
}
return (economy != null);
}```
send ur entire main class
it wont let me save it to paste.md-5.net
is it that big?
how many lines lol
164 lines
nope
alright
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
getServer().getPluginManager().registerEvents(new BalanceListener(economy, config), this);
117
remove that line
alright lemme build it again
theres no longer that error but it doesnt save to mysql and theres no errors
~~https://pastebin.com/Q5mLsu7p~~
nevermind im dumb and set it to on join 💀
Help find the error in the SQL query: "CREATE TABLE IF NOT EXISTS essentials_party (id INT AUTO_INCREMENT primary key, leaderName VARCHAR, leaderUniqueID VARCHAR(36), memberName VARCHAR, memberUniqueID VARCHAR(36), joined BOOL)"
Is there a way to set the player's attack cooldown? It doesn't need to be a specific value, just to force the cooldown to trigger
you never specified the length of the varchar for leaderName and memberName
"CREATE TABLE IF NOT EXISTS essentials_party (id INT AUTO_INCREMENT primary key, leaderName VARCHAR(16), leaderUniqueID VARCHAR(36), memberName VARCHAR(16), memberUniqueID VARCHAR(36), joined BOOL)"```
this is the correct sql query
since the maximum characters for a username are 16
Thanks
It really worked
how can I can set ItemDisplay rotation as player head
i know about it but how do i use yaw,pitch to set itemdisplay rotation
I thought something like this, but for some reason it changes size, and the rotation is strange
What exactly are you trying to set the rotation to be? A constant transformation or changed based off player's view?
If you know how to represent your transform as a matrix you can use setTransformationMatrix
¯_(ツ)_/¯
Just a static function that changes the ItemDisplay Transform once. It changes the rotation to the same as that of the player's head
Ahh okay, let me take a look at your transformation then, one sec.
You might want to try setting the third argument to 1 (currently getScale()) and fourth to 0 (currently getLeftRotation). Not sure if you want to be applying those changes again in this transformation if they're already applied to the display... (idk if transformations can stack that is)
heads apply yaw then pitch
yaw = x, pitch = z?
doesn't really translate like that
if I remember right, Yaw is XZ plane, roll is XY plane, and pitch is YZ plane
so rotations in yaw affact where it's looking for X and Z locations, etc.
who know effective metod for search a flat non-leaky zone (a set of locations or, roughly speaking, a piece of land) than this method https://paste.md-5.net/upiwifadur.cs
or at least write which plugin is supposedly looking for a specific zone (location set) for its event
omg automically cola machine
epic CPS
actually it's neither
well yes pvbble is correct, but not in this instance as this is matrix math
I need some help figuring out how to spawn custom mobs I made on given locations (7 locations) and the amount of mobs cannot exceed 14. I was thinking using an invisible armor stand to check the mobs count in a 50 block radius. Anyone got ideas?
Just do math
There's world.getNearbyEntities
Anyone that worked with build tools well enough that can tell me if that tooling has an option to only reset spigot-api and spigot-server to the local CraftBukkit and Bukkit dirs ?
It is messing around with my branches and I am not a fan
I don't want it to default them
if you run a custom branch of spigot and run that with "clean install package" for example you install your custom stuff
Yea but I am not mutating spigot
I am mutating the craftbukkit repo which the Spigot stuff applies it patches on top of
if you dont use "install" on your craftbukkit repo you wont overwrite anything else
maven install has nothing to do with that unless I am mistaken ?
I basically need build tools to just, jump straight to this line
Clone over my mutated Bukkit and Craftbukkit repos
apply spigot patches on top
compile spigot
oh you want to keep your changes in craftbukkit / bukkit and compile spigot with that ?
yes
then i did not understand your msg first
Yea sorry maybe I wasn't clear enough on that
wheres choco at
you can create a spigot-fork and apply your craftbukkit/bukkit changes there and maven install the spigot fork then
Hmm true, I guess I can directly edit in the spigot dir 
and then manually applyPatches and mvn package
I guess a somewhat workable solution
Well I am proposing a PR to craftbukkit and I'd like to test it on a spigot server ?
if it works on craftbukkit server it will work on spigot too i guess
Yea but I'd like to avoid running a craftbukkit server 
testing dead software is not really the vibe
why exactly isn't spigot just merged into craftbukkit? what is the point of keeping the 2 separate?
i think spigot wants to allow more custom stuff while craftbukkit is just the API with no custom stuff
what is "custom stuff"
for example spigot has the configuation to change the structure-salt for structures like mineshafts to spawn in a world
or changing crop-growth speed
so? there's a bukkit.yml settings that let you change stuff too, like spawn caps, ticks per spawn, disabling the end
those are "custom things", not just API
how custom ?
well MM, this way I can smack my head against the wall until I fix PDC YAML representation
Does anyone have idea if there is any other way to prevent the player from picking up experience? As of now I used PlayerExpChangeEvent and then just changed the amount of XP player can get to 0 but it's still picking up the XP
@EventHandler
public void onSkeletonSpawn(EntitySpawnEvent event) {
if(!(event.getEntity() instanceof Skeleton skeleton)) return;
Random random = new Random();
double chance = 0.07; // 7% chance
if (random.nextDouble() <= chance) {
skeleton.setCustomName(ChatColor.GOLD + "Jackal");
skeleton.setCustomNameVisible(false);
skeleton.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(250);
skeleton.getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(3);
skeleton.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE).setBaseValue(12);
skeleton.getAttribute(Attribute.GENERIC_ARMOR).setBaseValue(10);
// Create a golden axe
ItemStack goldenAxe = new ItemStack(Material.GOLDEN_AXE);
// Set custom display name
ItemMeta itemMeta = goldenAxe.getItemMeta();
itemMeta.setDisplayName(ChatColor.GOLD + "Jackal's Golden Axe");
// Set lore
itemMeta.setLore(List.of(ChatColor.GRAY + "A powerful golden axe",
ChatColor.GRAY + "enchanted by a legendary jackal"));
// Add sharpness enchantment
itemMeta.addEnchant(Enchantment.DAMAGE_ALL, 6, true);
// Set base damage to 12
itemMeta.setCustomModelData(12);
goldenAxe.setItemMeta(itemMeta);
// Give the golden axe to the skeleton
skeleton.getEquipment().setItemInMainHand(goldenAxe);
skeleton.getEquipment().setItemInMainHandDropChance(0.03f);
}
}
My item is never being set in the Skeletons hand. Don't get an error either. setItemInMainHand can produce a null exception, but it hasnt.
is there already the method player#setEXPCooldown or smth ?
Just check for each PlayerExpCooldownChangeEvent and PlayerJoinEvent and set the exp cooldown to -1 ig?
is the name changing ?
the Skeleton name?
Thanks for that
yes
It's used in regions
What i can think of is that in the spawn-process the default entity equipment calculation overrides yours
try running it a tick later
nope they still spawn with their bow
sure ?
I spawned 300 of them. all the jackals still had bows
i just got an error for an attribute so i fixed that and now checking agian.
Okay they are spawning with their axes now.
PDC Yaml representation?
even without tickdelay ?
Ye
Idk, I left that in there.
sounds interesting but why ?
hi, how can I set a text to show in every player's actionbar?
do a for loop for every online player
but how can I change the actionbar text?
what's the issue with that
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("§aHello World!"));
oh, sorry, I have found the way,
can you use ChatColor instead of the strange s character?
Don't you literally have an issue open about it XD
yes
I always use ChatColor
Storing JSON like strings in PDCs saved to yaml explodes
you can build it completly with a Builder and use all RGB Colors ...
the json string stuff? oh yeah
I don't think I'll need to use very specific colors, but it's useful to know I can do that
Not a bit?
not a nibble?
and the text disappears very fast, how can I do so every tick the actionbar command is run again? is there some event for that?
an event for what?
something like a tickPassEvent
?scheduling
I'll check that, thanks
is there an event for when like an item is burned? yk how netherite cannot be burned. is there a way to put that on every single item?
i am not sure but i think EntityDamageEvent could be something
I look into that one.
actually this works
wtf
ooh perfect
xD
lmfao
proof of concept is all it is
now where is the confidence my boy
yo not sure if this is the right chanel but i need urgent help with a server
are you developing plugin for your server?
?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!
nvm it belongs in help-server
I love the Fleet IDE i think its nice an all, but god there are so many problems with it.
why teams no change color
What are the problems
I was actually planning on switching from Eclipse to it lol
dont get me wrong its a good IDE. but like theres a lot of Ghost sysntax errors. it showing a syntax error when there is none, also just the smart feature, for predicting what you want to type. unlike IntelliJ it doesnt select the one the best fits your need. most of the time its alphabetical. sometimes its what you need but not really, and the terminal is sometimes very buggy.
its very clean tho and extremely light weight. I cant wait for the plugins.
yes xD
It looks very nicely designed
my MacBook starts to struggle with IntellIJ indexing my entire project and running a server.
very Simplistic.
Yeah
getting Maven to work on it tho was a pain.
it didnt want to save my maven home location. took me almost an hour.
got to finish the projects i have left then im throwing eclipse in trash and switching to it
Moving up the ladder hahaha
oh lol
I haven't worked with maven much though
in eclipse i can just export the plugin with 2 clicks its kinda easy
but i want to get to know other ways
mine is 1 click lol.
really? isn't there like some sort of commands you have to type or something

