#help-development
1 messages · Page 1001 of 1
Technically yes but at some point you might just want to generate them and cache them
doesnt mc or spigot just reuse keys if you make new ones with the same key?
like serialize and deserialize into binary?
They map to the same result yeah
I assume no since someone told me that throwing key.fromString here and there instead of just passing constant key is a flawed approach
that's why im trying to figure out a way to declare and store those keys
I would atleast create it with your plugin instance
new NameSpacedKey(plugin, "key")
just throw passed plugin via dependency injection?
wait if I have to use passed plugin I cant keep that class Keys static, right?
unless your plugin is static 😉
isnt making everything static like that not recommended at all?
yeah
is there a way to listen for when a player right clicks air or just water? PlayerInteractEvent doesn't get called when a player right clicks anything that isn't a block with an empty hand
I'm assuming the client just doesn't send anything to the server when right clicking air with an empty hand so it might not be possible
Not possible as no packet is sent from the client
😭
package chiru.generatetest;
import org.bukkit.*;
import org.bukkit.block.Biome;
import org.bukkit.block.Block;
import org.bukkit.generator.BlockPopulator;
import java.util.Random;
public class Generation extends BlockPopulator {
@Override
public void populate(World world, Random random, Chunk chunk) {
//Check
System.out.println(ChatColor.GOLD+"Generating a new chunk.....");
//Geting the cordenates of the chunk (the multiplication by 16 is because the chunks in mc are 16x16)
int x = chunk.getX() * 16;
int z = chunk.getZ() * 16;
//Randomizing the cord of the chunk the bound is all the chunk 16 x 16
int cx = x + random.nextInt(16);
int cz = z + random.nextInt(16);
//Check if that cordenate is a plains biome
if(world.getBiome(cx, cz) == Biome.PLAINS){
//Get the highest point in that cordenates
Integer highestPoint = world.getHighestBlockYAt(cx,cz);
//Check if is grass
if(world.getBlockAt(cx,highestPoint,cz).getType() == Material.GRASS_BLOCK){
//Generate a cherry tree
world.generateTree(new Location(world, cx, highestPoint,cz), TreeType.CHERRY);
}
}
}
}
``` This code doesnt generate any cherry tree
i want to generate one per chunk
Well, does the grass check pass
Let me check
I added the grass thing because without that
it generated the trees only in the water that was wierd
Let me check tho
Yep
it pass the biome check
and grass
it has problems actually generating the tree
It cant generate inside?
I added 1 to highest value
let me try
Nop
It still dont work
package chiru.generatetest;
import org.bukkit.*;
import org.bukkit.block.Biome;
import org.bukkit.block.Block;
import org.bukkit.generator.BlockPopulator;
import java.util.Random;
public class Generation extends BlockPopulator {
@Override
public void populate(World world, Random random, Chunk chunk) {
//Check
System.out.println(ChatColor.GOLD+"GENERATING NEW CHUNK...");
//Geting the cordenates of the chunk (the multiplication by 16 is because the chunks in mc are 16x16)
int x = chunk.getX() * 16;
int z = chunk.getZ() * 16;
//Randomizing the cord of the chunk the bound is all the chunk 16 x 16
int cx = x + random.nextInt(16);
int cz = z + random.nextInt(16);
//Check if that cordenate is a plains biome
if(world.getBiome(cx, cz) == Biome.PLAINS){
//Check
System.out.println(ChatColor.GOLD+"PLAIN CHECK PASS");
//Get the highest point in that cordenates and add one
Integer highestPoint = world.getHighestBlockYAt(cx,cz) + 1;
//Check if is grass
if(world.getBlockAt(cx,highestPoint,cz).getType() == Material.GRASS_BLOCK){
//Check
System.out.println(ChatColor.GOLD+"GRASS CHECK PASS");
//Generate a cherry tree
world.generateTree(new Location(world, cx, highestPoint,cz), TreeType.CHERRY);
}
}
}
}
This is the code
It prints every message
But the trees arent in the game
Do not use world#get-anything in a populator. Use the chunk provided
are there docs for the new protcol changes from 1.20.2?
Anyone know the correct way to add custom crafting and smithing recipes in 1.20.6?
I get packet errors on join that kick the player.
Code Context: the MobHead.getHeadItem is a unique never-null itemstack.
The smithing recipe is to attach an identifier onto a weapon.
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.
Server console output when connecting
https://pastebin.com/QFDtwbZq
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.
will try thanks
Can you try making a very simple plugin that adds a smithing recipe?
And be sure you're on the latest build of Spigot as well. It's either you've found a bug in the API, or maybe you're just doing something else wrong. But if you can reproduce it with a very simple smithing recipe, then you know it has to be a bug
Oh, wait, nevermind lol. You're just inserting air into your smithing recipe
There should probably be some better validation for that in Bukkit so it throws an exception earlier
why doesn't a text opacity of -127 for text displays set the text to be see-through?
127 might be a better value for semi transparency
But that's only going to be 50% transparent
how come you can't do 100% like you can with the background
You should be able to. That would be 0
The text opacity is an unsigned byte, but Java doesn't have unsigned bytes. So 0 is 100% transparent, 127 is 50% transparent, -128 is 49% transparent, -1 is fully opaque
The default is -1
Middle is zero, left is 128, right is -127
These are text displays? 
Are you trying to make the text transparent? Or the background?
1 did not work either PensiveCowboy
Actually, wiki says
Similar to the background, the text rendering is discarded when it is less than 26
So maybe you need 26 or 27 😄
25 worked! 26 and 27 were almost but not quite
that's so odd
do you know why it works that way?
I suppose they're just so transparent that they say "fuck it, you're probably not gonna see it anyways"
25 being about 10% of 255, the maximum opacity
o/
Is there a way to get the packet status from a BlockDamageAbortEvent? the goal is to get the status value and send a packet for that block so mining progress can be saved
I don't think so usually people use the arm animation event to keep track of that stuff
do you mind linking that to me in the docs? im new to mc plugin development so sorry if i seem ignorant, couldn't find that in the docs
Pretty sure theres an actual event for that
Wait there IS
It's just under a different name
declaration: package: org.bukkit.event.player, enum: PlayerAnimationType
theres the actual BlockDamageEvent but pretty sure thats one time
Yes
listening to an animation is pretty hacky
That's what people have had to do for a while now
Though aren't you supposed to be able to change the break speed attribute in newer versions
1.20.5+? Or is that coming soon still
yea, that's what I've been trying to use, calculating time between damage/abort time, found an older spigot plugin (Better Block Breaking) that does something similar to what I'm trying to make so I decompiled it and trying to learn how it works
If you can be bothered use a apcket listener
listen to the Block break animation packet and you can get the block damage level
there should be a block metadata one aswell
mmm ill have to get caught up on packet listeners, only packets ive ever learned to pass was a basic npc without any functionality
but ill give that a shot thx
I have a code snippet from way back i can try and find it
That's essentially modifying packets instead of sending right?
that'd be great if you don't mind
well more just reading it in your case yeah
no need to modify
ye makes sense for the most part, still only a few days into learning java so i've been on a struggle bus
cant find my old code, but look into ProtocolLib. Might be a bit complex but it will be most robust
yup i just added it in my depencies actually lol, thx for the help
there is two kinds of listeners, incoming and outgoing. You can also choose to send packets yourself as well. In regards to the listeners all you are doing is injecting into the network manager and you listen for whatever packets you are wanting to listen for.
got one more question for you if you don't mind, do you know where I can find docs on block break animation? seems like most stuff in minecraft has loose documentation/none at all
private void packetListener(){
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
manager.addPacketListener(
new PacketAdapter(this, PacketType.Play.Server.BLOCK_BREAK_ANIMATION) {
@Override
public void onPacketReceiving(PacketEvent event) {
event.getPlayer().sendMessage("packet obtained c:");
super.onPacketReceiving(event);
}
}
);
}
i believe this should work, I'd just like to have a better idea of what BLOCK_BREAK_ANIMATION gives me
really good explanation thanks for that
There's an API method for that
Hello, I am trying to build a plugin from source code but I get the following error, how can it be solved?
A problem occurred configuring project ':v1_20_R4'.
> Failed to create service 'paperweight-userdev:setupService:a77b6b7fc970a2fc1fc285d4820d0a5fcdd3f00801c4a47eda3632746be3d0cc'.
> Could not create an instance of type io.papermc.paperweight.userdev.internal.setup.UserdevSetup.
> The paperweight development bundle you are attempting to use is of data version '5', but the currently running version of paperweight only supports data version
s '{2=class io.papermc.paperweight.userdev.internal.setup.v2.DevBundleV2$Config, 3=class io.papermc.paperweight.tasks.GenerateDevBundle$DevBundleConfig, 4=class io.papermc.paperweight.tasks.GenerateDevBundle$DevBundleConfig}'.
?whereami
oh
declaration: package: org.bukkit.entity, interface: Player
how possible is it to change the camera prespective of a player
so basically move the player's camera
I don't think you can do that. I believe this is client side
They might be moving the player itself
in some parts of hypixel they show u that ur camera is going backwards (u cant move ur head) and ur player is still there
unless there's a non straight forward way
They might be moving the player itself back and cloning the player model
like spam sending movement packets to the player, that prob will work
how tf do u clone a player model..
and that would most likely cause game breaking bugs if the server crashes cuz i'd have to make the player spectator
https://www.spigotmc.org/resources/✅-api-player-npc-✅-1-17-1-20-1.93625/
The same way this is achieved
the only idea in my head rn is faking a spectator packet to the player and spam sending a movement packet and create an npc at where the player was at their place, this makes it fully clientside and others would see the player as if they were standing still
Yeah spectator sounds reasonable
tho u would need some sort of dummy entity u can control, but that’s fine
Yeah that sounds like a good way to do it
Have we tried spectating display entities yet?
sorry i was out for food with a friend, is this just done with packet.getMeta("status")
im just a bit lost when it comes to reading the data that i get from the packet i suppose
They want to get block damage, not set
Im not at pc rn, can send an example in a bit
what the flip is a packet meta
idk lol
i got it figured out, for some reason it didnt click that it was the fields I was getting from the packet for some reason lol. im just a bit slow, since it's a byte it should realistically be packet.getBytes().read(0) im assuming for the field index
any can help me to make a commandlistener for my limbo server? (auto command trigger send server)
this is my code
BungeeUtils.java:
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
import dev.jay.limbocore.LimboCore;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public class BungeeUtils {
private final LimboCore plugin;
public BungeeUtils(LimboCore plugin) {
this.plugin = plugin;
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "BungeeCord");
}
@SuppressWarnings("UnstableApiUsage")
public void sendPlayerToServer(@NotNull final Player player, String serverName) {
ByteArrayDataOutput byteArrayDataOutput = ByteStreams.newDataOutput();
byteArrayDataOutput.writeUTF("Connect");
byteArrayDataOutput.writeUTF(serverName);
player.sendPluginMessage(plugin, "BungeeCord", byteArrayDataOutput.toByteArray());
}
}
CommandListener.java:
public class CommandListener implements Listener {
private final LimboCore plugin;
public CommandListener(LimboCore plugin) {
this.plugin = plugin;
}
@EventHandler
public void onPlayerCommand(PlayerCommandPreprocessEvent event) {
Player player = event.getPlayer();
String command = event.getMessage();
if (command.startsWith("/")) {
command = command.substring(1);
}
if (shouldSendToLobby(command)) {
sendToServer(player, "lobby");
}
}
private boolean shouldSendToLobby(String command) {
boolean autoLobbyCommand = plugin.getConfig().getBoolean("auto-lobby-command", true);
return autoLobbyCommand && (command.equals("lobby"));
}
private void sendToServer(Player player, String serverName) {
plugin.getBungeeUtils().sendPlayerToServer(player, serverName);
}
}
cant u just use normal commands?
dont really see the reason to listen to commandpreprocess
like what
With what? when we type "/" or the slash substring command
have you ever used the spigot api
you can implement CommandExecutor
and go into ur main class
then getCommand("commandName").setExecutor(clazz);
here
full tutorial
for commands in bungee
u dont need a listener
infact you shouldnt use a listener for that
NEVER!
btw, i can recommend redis for cross server communication
then you dont need pluginmessages
BlockDamageEvent maybe needs a percentage added to it
Havent used it in ages so might be wrong but doesnt it on get called at the start of damaging a block?
Not continuously
I thought it was continuous but maybe I'm wrong
anyone making plugins for people? il pay decent
?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/
Pretty much yeah
ow thx
Is it bad practice to use a singleton class to store references of multiple objects in a repository like manner?
For example if I have objects that are instantiated on start up from a config, would it be bad practice to put these in a list inside of a storage class, and access this storage throughout the application?
Nah not really
Same thing as storing them in the JavaPlugin class, just modularised a lil
Sounds good, thank you!
one of the common applications of singletons is manager classes
where you don't want multiple instances of said classes
so you use a singleton for it
Ahh okay, I wasn't too sure of the naming of these sorts of classes. I spent a long time googling wtf it was called what I was doing
lol
well now you know
and also have your answer that your usage of singleton is acceptable
perfect, thank you
what about the factory factory manager manager registry registry
RegistryRegistryManagerFactoryBuilder
AsynchronousSocketChannelStreamFactoryFactory.Builder
I need a provider for that
AsynchronousSocketChannelStreamFactoryFactory.BuilderProviderRegistryStrategy
can i get manager for them
certainly, you can have a AsynchronousSocketChannelStreamFactoryFactory.BuilderProviderRegistryStrategyManagerSingleton and a AsynchronousSocketChannelStreamFactoryFactory.BuilderProviderRegistryStrategyManagerSingletonObserver
Shortest class name in java
does some1 know how big servers have a robust system for all their cross server stuff? when using a messagebroker (what i think they use) how do they ensure this stuff is received on the server the player is on? or even that it is received, when the player leaves at the same moment?
Lots of locks and atomic operations
help
im on oracle ubuntu and my ssh has stopped working
when on the console I try ssh localhost it says connection timed out
i want to save a history of transactions for each player, using a shop, /pay command, or whatever. up until now i have been using just the essentials economy. i tried to look for alternatives but apparently there is none that continues to be updated, or at least i couldnt find any (free, i mean)
so i guess ill have to implement my own economy provider. any idea how to do it? i know it has something to do with vault, but nothing else
ok but i specifically need a transaction history, does iconomy have that?
the spigot page is not very descriptive apparently
You could probably do something hacky by creating a proxy class
and what does it mean by uuid support?
using uuids instead of player names i guess?
thats a fork of the original iConomy 5 I did long ago
it says it requires towny but It doesn;t
ok, does it have a transaction history or something?
it has logging yes
not sure how to do that, not really a java developer, i use other languages
it has a depend towny in plugin.yml
ok ill try it out
um, seems Llama added it back
I removed it when I came back
Yeah I remove the depend 4 years ago, odd how it got back in with no commit message mentioning it
mm seems like I have to manually migrate from essentials to iconomy, do I?
looks like you can;t use Ico unless you remove the depend in its plugin.yml
im using it rn and i dont even know what towny is, so
you sure? its got a depend so it shoudl error and not start
yes, unless i have it installed as a dependency from something else, but its a dev server so i dont think so
Yeah don;t use it. an Eco shoudl not be depending on Towny
um, that should be impossible
if its working for you use it, but it should not work at all
it doesnt seem to have any dependency on the plugin.yml inside the jar itself, the one i downloaded from spigot
frconomy is better than iconomy @eternal oxide
# General Data
name: iConomy
main: com.iCo6.iConomy
version: 6.0.10b
# Command Data
commands:
money:
aliases: [iConomy, iCo]
description: Distrobute, Check, Use Currency.
# Generator Data
generators: [bukget]
categories: [ECON]
description: Simple, easy, and intuitive economy for minecraft.
maintainer: Nijikokun
authors: [Nijikokun, SpaceManiac]
website: http://ico.nexua.org
thread: http://bit.ly/iConomy
location: "http://mirror.nexua.org/iConomy/Latest Build/iConomy.jar"
conflicts: []
required: []
optional: [Permissions]
engine:
craftbukkit:
min: 0
max: 1100
glowstone:
min: 1
max: 100
ah thats ico6
not 5
btw i dont think it should be called SpigotPlugin.jar
frconomy is what iconomy wanted to be
I forked iCo5 as it was simple and just worked. iCo 6 was a nasty monster
@eternal oxide rate this https://github.com/Fr33styler/frConomy
why is it a nasty monster
You can no longer use the iCo5 fork though ans thats been locked to Towny
I don;t remember now but I remember everyone hating it
mmm then, back to implementing my own economy provider?
it was a lot of years ago
it shouldnt be that hard, i mean
i just dont know which classes to inherit and all that
is there any docs for it?
the same as the basic essentials economy provider + a history
from vault?
yes
ok so extend from that class, implement all its methods
but how do i register it, i need some docs or something
i guess like this https://github.com/iconomy5legacy/iConomy/blob/master/src/main/java/com/iConomy/iConomy.java#L210
ok so, if i want to withdraw from a player from another plugin, and i want to add details to my history thing, is there a way i can do that?
like, when i implement withdrawPlayer, can i add a third optional parameter or something like that, just for some plugins to use (meaning my own)
bc if i manually create an entry in the history after withdrawing, how can i know from the economy provider side that i will do that, and not create a log from there bc of that?
or maybe i can "prepare" the provider for the transaction, giving it details about it beforehand
assuming its all a single thread and synchronous, if there is a plugin that does the withdrawal or the payment in another thread, that could break it, right?
Just syncronize it with the scheduler then
yes, remember commands are async
yea but i mean, the other plugins that i didnt make
really? didnt know that
then i dont know how could i achieve that, without having to reimplement the withdraw logic from all other plugins, like quickshop, plotsquared, and all of that
at least it could be nice to know which plugin initiated the transaction, is there any magic way to know that?
like looking at the call stack or something
What people tell you here is to use Vault for economy, afaik, both Essentials and Plotsquared rely on it (I might be wrong)
You replace Essenatials economy with your own implementation, hook it into Vault and it will just work
(theoretically)
yea, i know that, but the vault methods for withdrawal and all of that
only have the player and the amount
nothing else, like details or something
not even the plugin that called the method
and thats what i wanna know, a transaction history of only the amounts is not very informative imo
I mean, the point of using the interface is decoupling the consumer and provider
i could at least show the plugin, like quickshop, plotsquared, the pay command, whatever, and then specify a bit more, doing some weird stuff, on the transaction originated by my own plugins
your plugin doesn't know what calls these methods, and callers don't know who handles the calls
So you're able to swap them all hovewer you wish
yea, that makes sense for making them all compatible with everything
and not having to add every single economy provider as a dependency
but, it would have been nice to add something, even just a string that you could parse as json or whatever
to do stuff like logging, i dont think thats a niche feature
Eh, the author of Vault didn't think about that back when was designing it. Good news is that it's opensource and even updates once in a couple of years
Though, I don't think you can do much here, even if the Vault updates the interface, plugins have to adapt to it first
yea, you would have to update all consumers
but thats why i was thinking about checking the call stack
to even get just the jar file name of the plugin that used the withdraw or pay method
can i do that? maybe getting a class by name somehow, and then getting the jar that contains it? is that possible in any way?
Hmm, I'm not that good ||(aka I suck at)|| in metaprogramming in Java
Maybe someone else knows
There is some magic stuff you could do
not entirely reliable
i thought either u could walk through the stack trace and get the class loader and if its the plugin class loader… bingo, or maybe grab whatever class through the reflection thingy that gets the caller class
I think these might be useful
Yeah, I though like
Get the previous caller > Get it's class > Get the name of .jar file
No need to get the jar file?
You can probably grab the plugin instance from the plugin class loader and then fetch the name
classname = Thread.currentThread().getStackTrace()[2].getClassName()
Uhh
Class.forName(classname).getProtectionDomain().getCodeSource().getLocation()
I think something like this, I might be very wrong though
I mean there is StackWalker also
@ivory sleet I talk about jar file because of this
I mean
I've already told I'm not good at it
Yea well I was just suggesting java’s built in class for traversing a callstack ^^
All what I just wrote
I learned less than 10 minutes ago
By lurking the documentation
I have no idea if it will work or not
yea, doesnt matter if its the jar filename or not
StackWalker?
so if i understand correctly, i get any class from the consumer from the call stack, and then i can get the plugin that contains that class?
and from there just get the plugin name
the thing is i know nothing about metaprogramming in java, and idek if thats the right term to use
so ill have to try all that, but before that i need to implement the economy provider
I'm not sure but something went wrong
both
use spark
can i prevent a player to break an end crystal with an event
because interacevent didn't work
Yes, call the BlockBreakEvent and check if the block is an end crystal
then set setCancelled to true
isnt end_ crystal an entity?
PlayerInteractEvent and EntityExplosionEvent didnt work?
Is Brewery made of tick function?
Try EntityInteractEvent
okay i try
everytime i change the pvpmanager config from this
Anti Border Hopping:
Vulnerable: true
Push Back:
Enabled: true
to this
Anti Border Hopping:
Vulnerable: false
Push Back: true
Enabled: true
and i save it then i refresh the page and its just goes back for some reason
i rly need help
and i cant even use the spawnshield plugin because it just tells me and inernal error occured
Hello Guys
I am currently programming a spigot plugin where I need PlayerConnection. However, this is not found
repositories {
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://libraries.minecraft.net/")
}
dependencies {
implementation("org.spigotmc:spigot-api:1.20.6-R0.1-SNAPSHOT")
compileOnly("com.mojang:authlib:1.6.25")
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
Those are my build.gradle dependencies
And there is spigot-api
I wanna change the skin of the player
how can i cancel an event if a player interact with an entity in PlayerInteractEvent
PlayerInteractAtEntityEvent
what interaction?
punch a mob for example
EntityDamageByEntityEvent
i have error in PlayerInteractEvent when punching an end_crystal
can i like see if the block is an end_crystal and cancel the event?
An end crystal is an entity
in playerInteractEvent
not a block
then share code and error :p
event.getClickedBlock()).getType())
There is no block if you're clicking on an entity
It shows syntax errors if i change spigot-api to spigot
Have you run BuildTools yet
Yes
Also I recommend using one of the Remapping plugins
So you don't end up working with an obfuscated environment
yes
if (event.getMaterial == Material.END_CRYSTAL)
So I can't just type in the dependencies?
you can but that would make everything harder for yourself
Good luck writing nms code with methods such as a(), b() and c()
nop cause end_crystal is an entity
there isn't a getMaterial method, but there is a getRightClicked
it work but
.
getMaterial return Material.AIR and after the material so don't use it
use event.getClickedBlock().getType()
END_CRYSTAL Link icon
public static final Material END_CRYSTAL
Material.class
so get the material and check
you can try EntityDamageByEntityEvent
and check if the entity is a crystal
and the damager is a player
then cancel the event
problem is i need to use playerintercat event
apart if an event who only check block exist
but i don't think
like the same event but with block only
its just check de material
and cancel
End_Crystal when place is an entity
you can do it this way
@EventHandler
public void onPlayerInteractAtEntity(PlayerInteractAtEntityEvent event) {
if(event.getRightClicked().getType() != EntityType.ENDER_CRYSTAL) {
return;
}
event.setCancelled(true);
}```
Hi, I'm having a lot of trouble try to do this as I'm quite bad a coding. I was wondering if you could give me a code example that does what you say. I'm sorry if this is too much to ask
your better off attempting it yourself and then showing your code here. This way, even if I am not here as well as I am not always the best, it gives others the ability to help you 🙂
I typically don't spoon feed and instead give you pseudo code or concepts 😄
lol
pretty sure someone around here has some kind of library for tasks in fact
just can't remember who that was
aikars task chain?
maybe? Thought someone else had one that wasn't as complex
im wondering how creating a new object for every block would help but thats another story
not quite but actually that guide may help them understand regardless
maybe
their issue from yesterday in a code piece they showed, they were creating tasks but they never died and they never bothered checking if a task already existed
and thus eventually their server crashes and burns
so I suggested that they implement a check for an existing task as well as implementing in the task code a check that would kill the task
so now you know their issue, anyways reason I brought up a task library was merely so they could see how it could be done
not exactly to be used but I suppose they could lol
then just keep a reference of the task and stop the old one if you want to make a new task
also does that task need to keep running forever?
don't believe so, it was a task for items in their inventory when they were used to provide effects?
Then one task is enough
but I will let them explain since they are here 😄
I think so as the player will always have this custom item "Relic"
and there is some helpful devs about
No need to create more than one task
I thought so too that only a single task was needed per player
or they could go with a worker queue
You don't really need a task per player
yeah
What is a Worker queue?
it works like the task scheduler in the api, you put the things you want done into a queue, and then you have worker threads that spawn to clear out the queue and do work on those tasks. Handy to distribute work load and keeping track and what have you
there is a variety of ways to implement it depending on your needs
Async Await
CompletableFuture<T>
This is what ive got so far:
extends ItemStack oh no
server isnt gonna respect your itemstack
also so much mismatched responsabilities
I love 500 line listener classes
I'd definitely start splitting up your concerns though... no reason to have 20 different functions in one class
Something you did not ask for:
On each case statement, you can extract
meta.setDisplayName("§aʀᴇʟɪᴄ ᴏꜰ §4§lᴄᴏᴍʙᴀᴛ 1");
lore.add("§f§lᴄᴏɴᴛʀᴏʟ §4§lғɪɢʜᴛɪɴɢ");
To before the switch statement so it always gets added regardless of the level
Also, avoid writing comments, they are something that can confuse you in the future, as if you change a line of code for which you have a comment, that comment would be now "outdated" with the new code, and the compiler won't even tell you about it because comments are not code
Why extending item stack?
Probably he's trying to create a custom item
If you try push instance of it to inventory you may get a exception
Plus the compatibility for future versions
It might break
Allright, so that might be the problem
public void sphereTask(Player player) {
Location loc = player.getLocation();
player.getWorld().playSound(loc, Sound.BLOCK_BEACON_ACTIVATE, 10f, 0f);
final int[] i = {0};
final boolean[] f = {false};
int id = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(WardenRelics.getInstance(), new Runnable() {
@Override
public void run() {
double radiusSquared = 40; // Radius squared, adjust as needed
for (Player players : loc.getWorld().getPlayers()) {
if (players.getLocation().distanceSquared(loc) <= radiusSquared) {
if (players == player) {
players.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 20, 4)); // 20 ticks = 1 second
}else {
players.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 40, 9)); // 20 ticks = 1 second
}
}
}
createSphere(loc, 0.03 * i[0], (i[0] + 1) * 0.03);
if (i[0] <= 1) {
f[0] = false;
}if (i[0] >= 20) {
f[0] = true;
}
if (f[0]) {
i[0]--;
} else {
i[0]++;
}
i[0] %= 33.333;
}
}, 0, 1);
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(WardenRelics.getInstance(), new Runnable()
{
@Override
public void run() {
Bukkit.getScheduler().cancelTask(id);
sphereEnd(loc, player);
}
}, 200);
}
You are creating a 1 tick delayed repeating task
whoa
And you schedule it for 10 seconds
This is good for 1-4 players
When there's 20 it might go wrong
@tardy delta you didn't mention the lambda method as oppose to the anonymous methods haha
But it is unlikely multiple people use it at the same times as there are othere relics and not everyone will have upgraded their relic to level 4
Btw ty for suggesting this to me because it really cleaned up the runnables haha
@gentle inlet first thing I'd work on is seperation of concerns
wdym
Search Uncle Bob on youtube
The fact you have like 10 different functions in one class is already clogging enough, that being said start moving your specific functions to specific classes... this helps you avoid 500 line monsters that are incredibly hard to maintain and read through
Ok so should I create like a base class for all the relics
I mean it depends on your whole structure, I like to keep my classes function specific
https://www.geeksforgeeks.org/separation-of-concerns-soc/
https://www.digitalocean.com/community/conceptual-articles/s-o-l-i-d-the-first-five-principles-of-object-oriented-design
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
ie: a group of methods that work to achieve one thing should be in it's own class
Keep your concerns separated like this^ and you'll begin to have a way easier time maintaining
to then watch one of his four hour talks, ahhhhh
🥺
It's an hour talk of good things
There's no reason to write everything out in a single class when di exists lol
hey i got an error with playerInteractEvent when i right click an end_crystal with an item in my hand, the "event.getClickedBlock().getType()" is null and i got an error, did anyone know why?
Oh i see what you mean alright
end crystal is not a block, it's an entity, that's why
you are clicking an entity, not a block
ye but i got an error
private boolean isOnCooldown(Player player) {
return cooldowns.containsKey(player) && System.currentTimeMillis() < cooldowns.get(player);
}
private boolean isOnCooldown2(Player player) {
return cooldowns2.containsKey(player) && System.currentTimeMillis() < cooldowns2.get(player);
}
private void startCooldown(Player player) {
cooldowns.put(player, System.currentTimeMillis() + cooldownTimeMillis);
}
private void startCooldown2(Player player) {
cooldowns2.put(player, System.currentTimeMillis() + cooldownTimeMillis2);
}
private String getCooldownMessage(Player player) {
if (isOnCooldown(player)) {
long remainingTimeMillis = cooldowns.get(player) - System.currentTimeMillis();
long remainingTimeSecs = remainingTimeMillis / 1000;
return "§6" + remainingTimeSecs + " Secs";
} else {
return "§aReady!";
}
}
private String getCooldownMessage2(Player player) {
if (isOnCooldown2(player)) {
long remainingTimeMillis2 = cooldowns2.get(player) - System.currentTimeMillis();
long remainingTimeSecs2 = remainingTimeMillis2 / 1000;
return "§6" + remainingTimeSecs2 + " Secs";
} else {
return "§aReady!";
}
}```
Like this bit could be put into it's own "Cooldown class" of sorts
and i didn't know why
yeah because you're trying to get the clicked block
but there is no clicked block
because it's an entity
hasCooldown*
...
can i like add a if(someting) to prevent that?
That was incredibly nitpicky of you sir
check the event action
there's also an event for interacting with an entity? PlayerInteractEntityEvent I think? I don't remember the exact name
ye i know
but i wan't to use PlayerInteractEvent because i need to check if the block is a chest, an anvil , etc
check the action to make sure it's a block
umm
with action you can only check if it's right or left click ?
OMG thx you i'm finally free from this problem

Emily already making good use of the new emote by threatening those asking for help

"or else >:("
Why don't spigot have more emotes
Nobody's suggested any :D
We need a cat being pet
If you can find one, propose it to md when you see him next and he may add it :p

weeb
weeb


imagine waiting for md to appear out of the wilderness
Yeah but that's only a 15 minute window kek
@worldly ingot do you know of any display entity drawbacks? General ones rather
They're not interactible. That's really the only flaw with them imo.
I saw someone doing some funky omni color blocks the other day and I wanna know how easily achievable that is
something something interaction entities
can we add mdthonk
Idk I just want to expand with display entities but idk what to do to the damageHolograms plugin
(past damage indicator holograms anyway)
is EntityCombustEvent work for end_crystals?
It only works for engines unfortunately :p
It would be the explode event, yes
I already gave you the code?
I mean, assuming you're looking for an explosion lol

Combust event is for entities being lit on fire
what do I cast to org.bukkit.block.Sign? can I cast a Block?
what i wan't to do is when the player left_click the end_crystals, nothing append
no explosion, nothing, the block stand in place
no, you'd cast the BlockData
and what about right click?
right click doesn't break end crystal...
oh right
x)
I totally forgot :-:
I think you're looking for EntityExplodeEvent then, yes
but the code you gave me is (i think) gonna be usefull for me for later 😄
That's always the hope aint it
replace the PlayerInteractAtEntityEvent with EntityExplodeEvent use event.getEntity instead of event.getRightClicked, you can also use event.getEntityType for the check instead of calling getType on getEntity
hope that makes sense :p
wooork 😄
but the end crystal disapear
just have to get the location and place another one, i hope i'm not going to create a duplication glitch lol
oh right that just cancels the explosion, cancel the EntityDamageByEntityEvent on ender crystals instead then
If you cancel the explode event that should be enough shouldn't it?
it cancels the explosion but the crystal goes away
nope the end crystal disapear
@EventHandler public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); ItemStack relic = new ItemStack(Material.ECHO_SHARD); ItemMeta randomItemMeta = relic.getItemMeta(); randomItemMeta.setCustomModelData(102); relic.setItemMeta(randomItemMeta); if (player != null) { player.sendMessage("join"); } }
Why is the playerjoin event running multiple times when i join i got 8 messages saying "join"
I guess that makes sense yeah
adding to that, you are cancelling the explosion not the destroying of the ender crystal
if player != null???
Kek haha no worries I just assumed you'd see it since you were here otherwise I prolly woulda ❤️
For some reason if i dont have that it disables the plugin on startup the plugin :/
dafuq lol
There's no way
yeah right :>
😛
yep ill remove it and send the error if you want?
Please cuz that makes no sense
it just returns
that what i thought too
The player can't be null, because if the player didn't exist the event wouldn't have triggered
Yeah im a bit confused
org.bukkit.block.Sign, cast Block#getState()
org.bukkit.block.data.type.Sign, cast Block#getBlockData()
it's the first one, will try
State contains NBT data about the sign, so if you're wanting to edit lines and whatnot, that's the one you want
ty
@sullen canyon sir could you help me with my plugin?
He's not casting the player either so how in the hell would the if (player != null) break the plugin...
I think you have another plugin doing something stupid that it shouldn't be
There's no reason your PJE should be firing more than once, or for your Player to be null for that matter
Maybe it's that
no idea :p
It smells like AuthMe or something
What would help is the stacktrace because it would tell you what plugin called the event
keep it english
@gentle inlet send the whole error
was that optic or choco 👀
prob choco
choco
I thought that was the whole error
Well error + stacktrace
Im sorry whats a stacktrace :/
Is that supposed to be in the console?
The error you get on startup, yes
Yes
Is isnt
Well there's an error somewhere if your plugin is red
check the latest log file maybe?
uuh another question with end_crystal
Ow can you set a end_crystal in the world? loc.getBlock().setType(Material.END_CRYSTAL); didn't work (loc = event.getLocation();)
THis is the only thing in console that mentions warden relics
ctrl F and search the name of your plugin in the log
oo ok
That's the error we want. What does your RelicOfCombat class look like?
Show us
someting like spawnentity?
Yes, spawnEntity() or spawn() would work fine
can i spawn a 2nd choco
umm
And can we see your onEnable() and registerEvents() methods?
The Player you're passing to that constructor is null
I'm unsure how you're getting a Player at all from your onEnable() to begin with
It's coming from before the player has actually joined so that's weird
This right here
i think this is not possible but can you make the little bedrock thing disapear...
pm.registerEvents(new RelicOfCombat(0, null), this);
I assume the fact you're passing "null" here is the issue
i see
That being said, you have to get the player some other way within relicOfCombat class
But anyway can someone actually help with what I asked for lol
What did you ask for?
Try fixing the null thing first then test it again
And then we can see if it's still trying to trigger 8 times
someone know if it is possible to have only the end crystal and not the bedrock thing?
You need to set
setShowingBottom(false) to the Ender Crystal Entity https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/EnderCrystal.html
declaration: package: org.bukkit.entity, interface: EnderCrystal
I wonder if you could map it to an offset
idk
if you're using spawnEntity then cast it, if you're using spawn then you don't need to cast
kay i try
How would you save a location with it?
So you don't need a location?
the methods for spawning an entity takes a location (where the entity will be spawned)
I thought he needed to like cache a location though lol
Didn't realize he was simply just spawning it
haha
How much have you worked with display entities?
I haven't worked with them
I will probably give it a try some day :p
Quite simple as well
Anyways I've got damage indicators, what do I do with em now...
stuff ig
SEE that's the issue D:
Say hello to GPT-4o, our new flagship model which can reason across audio, vision, and text in real time. Featuring Sal and Imran Khan from @khanacademy
Learn more here: https://www.openai.com/index/hello-gpt-4o/
How lovely
@EventHandler public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); ItemStack relic = new ItemStack(Material.ECHO_SHARD); ItemMeta randomItemMeta = relic.getItemMeta(); randomItemMeta.setCustomModelData(102); relic.setItemMeta(randomItemMeta); player.sendMessage("join"); startTaskForPlayer(player); }
Fixed null thing and now for some reason it says join 2 twice not 8 times now
Is that the only onPlayerJoin method you have?
@echo basalt is life going zaebis?
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
}
this is in your main class btw
Try removing that
ok
Still twice
Also, after removing that you can take away ", Listener" at the top as well, you don't need your main to be a listener
Ok send me the whole class
The relic of combat?
Uh wherever the onPlayerJoin method is
yes ok
what was the paste website again?
?paste
?paste
Are you creating multiple instances of that class?
Im not sure what you mean sorry im not very good at this im trying to learn
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
Ok and secondly, you should move all the eventhandler methods to another class
So make a new class that handles the event listeners
After you do that, go to your main class and redo the event registry method to match the appropriate listener class
how to delete entities?
should be entity#remove
What are you trying to delete? The crystals?
yep and it work
yep
Test it now
the java doc say that is mark the entitie as remove so i was thinking it didn't remove the entity
but it work
what about the errors in the class that handles events
Ah ok, so you need to move the cooldown logic either to that class, or to another class that will be your cooldown class or wtv, you use di (dependency injection) to get an instance of that class + it's methods so you can access isOnCooldown(player), startCooldown(player), etc. Or if you wanted to do it lazily, the first option, you just move the logic to that listener class
The second option makes this project easier to expand on when it comes to cooldown related stuff
^
woah
when did spigot add that method
1.21
lol
epic
atleast youll remember it now
bruh it doersn't gonna work in EntityExplodeEvent
event.getEntity() instanceof Player player
like 100 years ago XD
i dont think endcrystal is a player x)
That's because a player doesn't explode (that I know of)
1.22 update!? The Exploding Player Update
x)
maybe the endcrystal knows what hit it
maybe the handler?
Jetpacks perhaps?
event.getHandlers()
btw you get it working?
i think i can't get the player
maybe if i do entityDamagebyEntity and then instanceof EntityExplodeEvent?
The 1.22 update no, but the relic thing no aswell still sayll join twice
You made all the changes?
Im pretty sure
Send me pastes of the main, relics, listener, and the cooldowns class if you made one
it happens man
?paste
whats a namespace?
maybe i have trouble understanding because i dont know what it means in english?
What are you trying to do?
persistentdata
?pdc
again what is namespace?
"Represents a String based key which consists of two components - a namespace and a key. Namespaces may only contain lowercase alphanumeric characters, periods, underscores, and hyphens."
it literally starts talking about it
NamespacedKey key = new NamespacedKey(plugin, "your namespace")
lemme rephrase my question. does namespace mean anything in english language?
A way to assign names to certain "spaces" (Groups of Objects)
ex
NamespacedKey myCustomItemIdentifier = new NamespacedKey(plugin, "myCustomItem")
if(item.getItemMeta().getPersistenDataContainer().get(myCustomIdentifier, PersistenDataType.BOOLEAN)) return isCustomItem = true;
return isCustomItem = false;
nice npe
look dm
change .get to .has and just return
I wrote that without code reference, but thats probably better
Anyone know how to change the server name, like when doing Bukkit.getServer().getName()?
i believe its packets
change it in server impl
or that ye
So they must have gotten rid of the way in the server.properties
yeah, its hardcoded
came across this, dunno if its related https://github.com/zubiden/F3Name/blob/master/src/main/java/ua/coolboy/f3name/bukkit/packet/ReflectionPayloadPacket.java
?xy
Well, I had just gotten confused I thought Bukkit.getServer().getName() would return Unknown Server or whatever it would be in server.properties since when I last used it.
I had just thought it was moved somewhere else, sorry for the confusion tho
I don't think you want the same generic param for both generic parms of PersistentDataType
but you would just add another parameter of the "value" generic type
like that?
This is my proposal of adding a cat getting pet emote to spigot
Z def
what does def stand for?
default
btw why u returning T
I see you seem to be overloading this method quite a lot. You can still use generic for the second parameter if you understand how to use it.
?paste
hey i was wondering if anyone knew how i could change the amount of xp in the xp bottle i spawn.
https://paste.md-5.net/hijocesodu.py
#general with emoji
Wdym by overloading
I dont use another method with same name
You can have many methods have the same name but different parameters.
yeah
Why would I make several methods to get pdc
uh k, so it's fine for u
You said im overloading it, I looked up the definition and it doesnt seem like Im doing it
I really dont understand you
It's just that I see above that there are 2 methods with the same name but different parameters, so.
So with that cleared, is there anything else wrong with it?
Nothing
🤔
hello, I come to ask if it is possible to call a function from a datapack in a plugin, is it possible?
Should be possible
If nothing else you can run the function command
How should I go about preventing the block break animation destroy stage from resetting? i.e. whenever its on stage 5/9 and mining stops it resets to -1. I want that stage to remain at 5 when mining stops (essentially saving mining progress)
I try to set the destroystage to the status of the current animation, but since it resets it doesn't retain the packet info.
my code
@Override
public void onPacketSend(PacketSendEvent event) {
// Cross platform user abstraction
User user = event.getUser();
// whenever player receives a block break animation packet
if (event.getPacketType() == PacketType.Play.Server.BLOCK_BREAK_ANIMATION) {
WrapperPlayServerBlockBreakAnimation breakAnimation =
new WrapperPlayServerBlockBreakAnimation(event);
Byte status = breakAnimation.getDestroyStage();
// doesn't work
breakAnimation.setDestroyStage(status);
}
}
BlockDamageAbortEvent -> Player#sendBlockDamage
The only issue is I don’t think there is a way to get the damage progress of a block, so you’d need packets for that
Yea, that's what I was trying to do with the break animation packet with the packetevents lib
You’re just setting the destroy stage to what the destroy stage already was…
That’s not going to change anything
If the server sends the packet to reset it to -1 you can just cancel that
But I assume the client handles that
Who wants to hate themselves for a lil?
Trying to write either a python or Java program for https://www.reddit.com/r/Minecraft/comments/mjvwc7/minecraft_full_enchantment_guide/ (specifically bows) in which said program tries to find the most valid combinations of using the least amount of bows & enchanted books/combination. It should also print each valid combination too
pass
wtf
Yea, ChatGPT didn't figure it out either LMFAO
Ya boi has problems and they need solved
If you want infinity I’m pretty sure you can get everything in a single enchantment use
Otherwise you need 1 enchantment and then 1 anvil use to add mending
Ah I see
why in python and not just java
yea idk what i was thinking LMAO ill try to cancel the -1 packet
Yes, but given the mess that is my storage the fun is
- Finding every valid combination
- Preferably doing it in the least amount of books & bows while providing the most amount of valid combinations
I'd throw them away but server econ 👀
either or
Grindstone them, then throw em away
.
Eh. I have a bunch enchants & bows, might as well throw automation at it
plus, if that specific issue can be figured out then it can be expanded to the other items on the list lol
Gotta make everyone broke LMFAO
I don't understand the prompt
that means you passed the Turing test
prompt?
Hello, I have an error, I want to lose half a hearth each time I activate a totem with EntityResurrectEvent, but sometimes it removes half a hearth and others an entire hearth
show your code
private int totemCount = 0;
@EventHandler
public void onEntityResurrect(EntityResurrectEvent event) {
if (event.getEntity() instanceof Player) {
Player player = (Player) event.getEntity();
totemCount++;
// Check if every 3 totems are activated
if (totemCount % 3 == 0) {
// Calculate the new max health after removing 1.5 hearts
double currentHealth = player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue();
double newMaxHealth = currentHealth - 1.5;
// Ensure the player's current health does not exceed the new max health
if (player.getHealth() > newMaxHealth) {
player.setHealth(newMaxHealth);
}
// Set the new max health
player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(newMaxHealth);
player.sendMessage("You lost a permanent cora and a half due to activating 3 totems!");
}
}
}
if (player.getHealth() > newMaxHealth) {
player.setHealth(newMaxHealth);
}
this isnt necessary
and 1.5 is 3/4 of a heart
not half
Yeah
I know this is a Java question, but it could apply here as well.
If my plugin is using an SQLLite database, and say 2 players do something at the same time, will it lock and choose a victim, or will they be queued?
For example, someone joins and it say adds a coin to a table, but someone else joins at the exact millisecond, will one of these error, or will it queue? I know SQLLite does database locks, so I'm not sure what entails in this scenario.
Additionally, what if a player say runs /coins at the same time someone is writing to their coins on server join? Will it queue this, or will it throw an error on read?
I have no problem using MySQL, but with the scale of this I would like to use SQLLite to save resources
no two players will ever join at the exact same millis
That's a true point, and I understand that. Just the off chance. I guess it shouldn't really be a concern as SQLLite is pretty fast
Why is that?
because it doesn't support async
Oh it's one of those kek
Doesn't it just mean the database itself is synchronous?
I believe it will throw an access violation or some other error if you try to use it async from two threads
lol nothing in java ever synchronises.
Its a bitch. I still get it wrong myself
True. I didn't know if the driver itself would queue it to be synchronous or if it was just a DYI thing if you truly want multi-threaded
nope they driver will just throw an error
sources perhaps?
Ah okay
oh boy oracle source
thats nice for handling sync access from many async threads
We love oracle
it will basically make all other threads wait until it's free
So like a queue pool ?
yes
Theres many ways to do it, but basically you have to expose a thread safe API to hide your SQLite access
With Spigot so long as you are not on the main thread you can block
funny how the description changed fonts
Ah okay makes sense. Wouldn't work well then with my scriptable bot plugin.
I'll add MySQL functionality to it
void
clear()
Does nothing. ```
...
Sigma function
boolean
isEmpty()
Always returns true.```
There are a couple of them haha 😅
"Does nothing"
I did that the other day kek
Just use thread.sleep(-1000) 4head
Quantum Java
ew
I prefer scheduling a date for yesterday and changing the system date 😏
That's such a performance pro tip that the professionals just don't teach you
What do I work on other than smoke weed and wonder what I want to work on
make a weed farm plugin?
Now that is just
brilliant, i know
Why hadn't I thought of that
Where do we start with this is the question
It'd be cool to get some models but I have no clue how to work with those
model engine
Last time I tried playing with meg, I just ran into a lot of frustration
I want to mess with display entities more, have you any ideas?
custom models with resource packs
will save you a lot of time
maybe switch to #general
god what am i doing wrong with skulls?!?!
spiralBlock.setType(Material.CREEPER_HEAD);
BlockState blockState = spiralBlock.getState();
Skull skull = (Skull) blockState.getBlockData();
skull.setRotation(blockFace);```
I think skull is depreciated too but i cant find the new one
If I add NPCs (via packets) that have custom logic and they display to all players on the server (within a specific range), will this tank performance heavily?
well as long as ur logic code isnt pure dogwater id say nah ur probably fine
you dont really have to check for distance, if the client receives the packet and it's outside of the render dist, it will be discarded
which is generally more performant then checking it serverside
you're like my resident spigot helper lmao
thanks homie
for (Display display : ItemRotator.Displays.values()) {
Slime hitBox = PersistentDataUtils.getHitBox(this, display);
System.out.println(PersistentDataUtils.getDisplayItemName(this, hitBox));
hitBox.remove();
display.remove();
}```
somehow this code doesnt remove itemDisplay?
i have this in ondisable
i even debugged it above
So i implemented NMS, runned the BuildTools and imported local dependencie.
Why can i not call the function getProfile()?
Entity#setPersistent(false)
WIll try that out
I think i found why it was not getting removed
maybe because that code was for bungee api or something?
setPersistent worked
Is there a special event that monitors whether a player sets fire to blocks? To protect me from arson and similar things
https://github.com/SpigotMC/BungeeCord/blob/master/api/src/main/java/net/md_5/bungee/api/connection/ProxiedPlayer.java#L228
Is getLocale() nullable? I'm facing an issue where https://github.com/GeyserMC/Floodgate/blob/master/bungee/src/main/java/org/geysermc/floodgate/util/BungeeCommandUtil.java#L66 fails as the locale appears to be null?
Hey guys, what happened to reflection? Nothing seems to be working anymore.
[06:05:33 WARN]: java.lang.NoSuchMethodException: net.minecraft.network.chat.Component$Serializer.a(java.lang.String)
I doubt reflection stopped working
Everything changed because no method is working, I would like to know from someone who knows what changed
What is that
?nms
I am using reflection and this is since 1.20.5 spigot update
u have to look at mappings to see what that method name changed to ¯_(ツ)_/¯
There are some online mappings but idk link
isnt there a general rule of what changed?
Because everything dissapeared on this version
No, as they are obfuscated names
Dunno where it is anymore
Are there any plans to add getPipeline() methods to players or something similar?
the spigot api is not very useful
Tbh doubt, that is pretty much internal api

?mappings
Compare different mappings with this website: https://mappings.cephx.dev
Yeah that is the link ^