#help-development
1 messages Β· Page 842 of 1
The projectile
Check for instance of ender pearl
Get the shooter
Which Id provided by the casted entity
guys, i have a skull modified by NBT-API, but when i change its slot it seems to lose the tags i created on it. why?
would it be possible to obtain a Projectile's landing location before it has landed?
Something like Projectile.getLandingLocation
Not that I'm aware of
Rip
You gotta do the math yourself
There are a lot of potential sources, what other plugins do u have?
I only have mine, which uses DecentHolograms, ProtocolLib, XSeries, NBT-API
Why is there an official SonarLint plugin for eclipse π
More to the point, if eclipse gets one, why isn't there an official SonarLint plugin for netbeans.
Why I use sonar or why I use netbeans?
IntelliJ best
Is it possible to have RGB Colors as the color of the displayName?
yeah sure
Can this be done using scoreboards? Because I only found sources that said, that it does not work with scoreboards.
yes you can have hex color scoreboard text
you need to set the teams prefix
since that can have all colors
I tried that but it didn't change the name behind the prefix
The prefix works fine but the displayName is not getting the correct color
this is what I use for my scoreboards https://github.com/Steaf23/BingoReloaded/blob/main/BingoReloaded%2Fsrc%2Fmain%2Fjava%2Fio%2Fgithub%2Fsteaf23%2Fbingoreloaded%2Futil%2FInfoScoreboard.java
how do i create a jar that contains both specialsource and dependencies in maven?
when i apply the plugin using specialsource-maven-plugin, the nms work normally, but ClassNotFoundException occurs in those included in the dependency.
ok so i am useing oraxen plugin to add a invis block i need for a custom gui but what would i put here
Both?
Okay, how does this affect the color of the displayName?
yes, specialsource+dependencies
do you want me to send you pom.xml?
Well did you shade the dependency or provide it in any way?
Because code that doesn't exist cannot run
?paste and yes send pom
so i am trying to get rid of the map so i made a invis block in oraxen plugin but what would the id be for it sorry i am not a dev my quit from life issues
jar produced by maven-shade-plugin does not have nms working normally, but the dependencies work.
what jar do you use
The model data would be whatever you told it to be in the resource pack
Also not the material
ok so it would just be invisblock in the material space
Do not use the jar with a prefix or suffix
??
If ypu don't know what you're doing you should pay someone to do it
If you pay well getting a new dev should be 0 issue
ya thats the prob i just payed this one lol a lot of money then he had to leave
i so confuses
where do i put the item id
it would be custom model data
thanks
do i have to pass in ClientInformation inside the ServerPlayer?
oh, ty
that isnt custom model data
its a number
and your resource pack would that number with an invis texture
hmm
java.lang.NullPointerException: Cannot invoke "net.minecraft.server.network.PlayerConnection.l()" because "player.c" is null
its probably trying to send packets
hm
ah l is tick
where would this be in the resource pack like i said i am not a dev my left for life issues
assets/minecraft/models/item
now you have to create the json file and add the info for custom model data, then create the invis texture
π this hurts my head lol
you have a example
{
"parent": "item/generated",
"textures": {
"layer0": "item/map"
},
"overrides": [
{"predicate": {"custom_model_data":1234567}, "model": "item/map"}
]
}
heres a guide
A fake player does not have a connection
Do yourself a favour and use Citizens
<inputFile>${project.build.directory}/${project.artifactId}.jar</inputFile>
are you telling me to delete the suffix here?
No
Maven will create more than one jar
Use the correct one
kotlin is underrated
Kotlin is definitely not underrated
anyone can help me with this?
amount was 10.00 I tried many amount but still same error
Currency amount must be non-negative number, contain exactly 2 decimal places separated by '.' (JPY contains 0 decimal places), optional thousands separator ',', limited to 7 digits before the decimal point and currency which is a valid ISO Currency Code
why cant I
get things from the PluginDescriptionFile thingy
?learnjava!
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
if I have a tilentity furnace I can make it burn all the time
so I was expecting just the display name "Bow of Ender" when I log an item's itemMeta.displayName, but I get the entire TextComponent instead
TextComponentImpl{content="Bow of Ender", style=StyleImpl{obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, color=null, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}
I thought I could use the .contains method to see if the name was in it, but it requires a TextComponent to compare
?whereami
lol okay
Not sure of context, but as error says, no decimal places allowed
and is it possible to forbid opening the furnace, I need to make it burn and use it more as a decoration
public class FurnaceTileEntity {
static BlockPosition getFurnacePosition(Location BlockLocation) {
return new BlockPosition(BlockLocation.getX(), BlockLocation.getY(), BlockLocation.getZ());
}
static NBTTagCompound getNBTOfFurnace(TileEntity furnace) {
NBTTagCompound nbt = new NBTTagCompound();
return furnace.save(nbt);
}
public static void setTileEntity(World world, Block block) {
WorldServer nmsWorld = ((CraftWorld) world).getHandle();
CraftFurnace craftFurnace = new CraftFurnaceFurnace(block);
craftFurnace.setBurnTime((short) 10000);
craftFurnace.setCookTime((short) 10000);
TileEntityFurnaceFurnace furnaceTE = (TileEntityFurnaceFurnace) nmsWorld.getTileEntity(getFurnacePosition(block.getLocation()));
NBTTagCompound nbt = getNBTOfFurnace(furnaceTE);
furnaceTE = (TileEntityFurnaceFurnace) furnaceTE.create(furnaceTE.getBlock(), nbt);
nmsWorld.setTileEntity(getFurnacePosition(block.getLocation()), furnaceTE);
}
}``` ```@EventHandler
public static void playerHandleEvent(PlayerInteractEvent event) {
Player p = event.getPlayer();
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
Block bl = event.getClickedBlock();
if (bl.getType() == Material.FURNACE && p.isSneaking()) {
FurnaceTileEntity.setTileEntity(event.getClickedBlock().getWorld(), bl);
event.setCancelled(true);
}
}
}``` code
Confused why there is nbt involved
is it possible to use it to give some interesting properties of the furnace?
Pretty sure it's all in the API
then what can tile entity be used for? I want to explore this
and if it's in the api, how do I do it?
Block.getState and cast to Furnace
can you please answer this question
I don't really understand the question
if it is in the nms spigot, then it can be used for what that is not allowed in the api?
what's wrong with experimenting with this
Sure but this is in the API
You probably could use Furnace#setLit
Furnace in block.data.type inherits that method from Lightable
Iβm still learning, so that might not be the proper use but I just wanted to share what I found
I have a question how to determine if a block is a tile entity?
if (nmsWorld.getTileEntity(getFurnacePosition(block.getLocation())) != null) { now working as excepted
public void blockBreakEvent(BlockBreakEvent event) {
Block block = event.getBlock();
WorldServer nmsWorld = ((CraftWorld) block.getWorld()).getHandle();
TileEntity tileEntity = nmsWorld.getTileEntity(new BlockPosition(block.getX(), block.getY(), block.getZ()));
if (tileEntity instanceof TileEntityFurnaceFurnace) {
event.setCancelled(true);
}
}```
same
tilentity for me will be like custom furnaces that cannot be broken, for example
?xy
not clear why you are using nms
well, to create nms entities, for example, NPCs.
i can't do this with the of a spigot api without a citizens api
This is tile entities though
won't you provide support for them?
pretty general java question but how could i setup scheduler which would be ran every real life day
Better to use a shorter period and save the last time it was run
Iβd google for a crontab library
or just a simple scheduledexecutorservice or whatever it was called if you don't need to persist the scheduled task
What if the app/plugin/whatever it is restarts?
Restarted*
well my plan was to run executor onenable which would get time in ticks until midnight and then execute smth, then it would self reset(starting over again)
Just use a Date and an async thread that checks the time every minute then
well sometimes the tasks don't need to span over application restarts
indeed if i would use this it could work ig
If you just wanna run it on midnight, just use a scheduler and check the time every few seconds
Ticks are not a reliable time unit
should i use normal java executors then isntead of bukkit runnables stuff
i'd just use a normal runnable with the scheduler
You can use a Bukkit Scheduler to check every minute, but donβt calculate any time in advance using ticks
better check every few seconds, otherwise it might run on 23:59:59 and 0:01:00
what if that doesn't run exactly on that nanosecond
I'd just do sth like this
/**
* Schedule this to run every few ticks
*/
class MidnightRunner implements Runnable {
private boolean hasAlreadyRun = false;
@Override
public void run() {
if(shallRunNow()) {
// do stuff
}
}
private boolean isMidnight() {
LocalDateTime time = LocalDateTime.now();
return time.getHour() == 0 && time.getMinute() == 0;
}
private boolean shallRunNow() {
if(hasAlreadyRun) { // if it has already run, it can't run again until next midnight
if(!isMidnight()) { // it's not midnight anymore, reset hasAlreadyRun
hasAlreadyRun = false;
}
return false; // do not run again this midnight
}
if(isMidnight()) { // it's midnight and it hasn't run yet, so run it
hasAlreadyRun = true;
return true;
}
return false; // it's not midnight yet, so don't run it
}
}
then you could also later just replace isMidnight() with isCorrectTime() and supply hour and minute through the constructor to make it reusable
I would use a single-thread scheduled ES with something like executor.scheduleAtFixedRate(() -> { /* stuff */ }, initialMillisUntilMidnight, TimeUnit.DAYS.toMillis(1), TimeUnit.MILLISECONDS)
nihaoma
the main implementation works based on System#nanoTime I believe, so changing the system time wouldn't have an effect
it'd run at 11pm once per year and at 1am once per year (at least in countries that have daylight savings time)
*creates a thread and waits it the amount of time he wants to wait π
that's exactly what's causing the above mentioned issue
im curious, let's say you use an api that returns the current time to nano second, by the time the request is returned the the page, wouldn't it be de synced? then how would you sync it?
long ms = System.currentTimeMillis();
//do your work
long now = System.currentTimeMillis(); //or it was smth like that
long elapsed = now - ms
That's what most people do
And it's kinda effective
Is there anyway to have a team account on spigot?
create a new account and send an email to get it approved as alt account
Now this is in milliseconds, you can use TimeUnit API provided by the jdk to convert it to nanos
Is there a way to make a player entirely invisible to another specific player, including armour, but without hiding them from tab?
Use the spigot hide player method and send the player info add packet
the item is automatically removed if they pick it up?
any way to clean this up other than making a seperate method
why is all that code more or less duplicated?
yeah
i made method
for repeating code
nw
i was asking if therewas a way to clean it up without doing this
volume and pitch
I'm writing a small plugin for the New Year and I want to add fireworks to it that will appear around the player, fly up a little and explode. It seems like I did everything, the fireworks donβt fly up but immediately detonate. How to fix it?
private void spawnFireworkAroundPlayer(Location location, Player player) {
Firework firework = location.getWorld().spawn(location, Firework.class);
FireworkMeta meta = firework.getFireworkMeta();
Location playerLocation = player.getLocation();
Vector direction = playerLocation.getDirection().multiply(1.5);
Random random = new Random();
FireworkEffect effect = FireworkEffect.builder()
.flicker(false)
.withColor(Color.fromRGB(random.nextInt(256), random.nextInt(256), random.nextInt(256)))
.with(FireworkEffect.Type.STAR)
.trail(true)
.build();
meta.addEffect(effect);
meta.setPower(100);
firework.setFireworkMeta(meta);
firework.setVelocity(new Vector(0, 1, 0));
firework.detonate();
}
don't call detonate()
I would also give random power and random detonate delay, so it gives a better effect
also you should use the consumer method to set the FireworkEffect before spawning it
^
When you want to spawn a custom entity, e.g. with a custom name or certain items equipped, you must use the method World#spawn(Location, Class, Consumer) unless you give a shit about compatibility with other plugins. Iβll explain why. The shitty way Usually, you can easily spawn entities like this: That is fine, as...
location.getWorld().spawn(location, Firework.class, firework -> {
firework.addEffect(effect);
});
You can also remove brackets
location.getWorld().spawn(location, Firework.class, firework -> firework.addEffect(effect))
btw you don't have to create a new random everytime
just create it once and reuse it
(or just directly use ThreadLocalRandom.current())
its expensive to create rught
yes
You could also use Math.random and use multiplications
It gives a number between 0.1 and 1, so multiply it by 255
ThreadLocalRandom is easiest as one can just keep using nextInt
I'm very bad at this.
just use ThreadLocalRandom.current() instead of creating your own Random
||use SecureRandom πΏ ||
thx
like this
private void spawnFireworkAroundPlayer(Location location, Player player) {
Firework firework = location.getWorld().spawn(location, Firework.class);
FireworkMeta meta = firework.getFireworkMeta();
Random random = ThreadLocalRandom.current();
FireworkEffect effect = FireworkEffect.builder()
.flicker(false)
.withColor(Color.fromRGB(random.nextInt(256), random.nextInt(256), random.nextInt(256)))
.with(FireworkEffect.Type.STAR)
.trail(true)
.build();
meta.addEffect(effect);
meta.setPower(100);
firework.setFireworkMeta(meta);
firework.setVelocity(new Vector(0, 1, 0));
}
yeah but you should still use the spawn method that takes a consumer
private void spawnFireworkAroundPlayer(Location location, Player player) {
location.getWorld().spawn(location, Firework.class, firework -> {
FireworkMeta meta = firework.getFireworkMeta();
Location playerLocation = player.getLocation();
Vector direction = playerLocation.getDirection().multiply(1.5);
Random random = ThreadLocalRandom.current();
FireworkEffect effect = FireworkEffect.builder()
.flicker(false)
.withColor(Color.fromRGB(random.nextInt(256), random.nextInt(256), random.nextInt(256)))
.with(FireworkEffect.Type.STAR)
.trail(true)
.build();
meta.addEffect(effect);
meta.setPower(100);
firework.setFireworkMeta(meta);
firework.setVelocity(new Vector(0, 1, 0));
});
}
^
private void spawnFireworkAroundPlayer(Location location, Player player) {
location.getWorld().spawn(location, Firework.class, this::applyFireworkMeta);
}
private void applyFireworkMeta(final Firework firework) {
FireworkMeta meta = firework.getFireworkMeta();
Location playerLocation = player.getLocation();
Vector direction = playerLocation.getDirection().multiply(1.5);
Random random = ThreadLocalRandom.current();
FireworkEffect effect = FireworkEffect.builder()
.flicker(false)
.withColor(Color.fromRGB(random.nextInt(256), random.nextInt(256), random.nextInt(256)))
.with(FireworkEffect.Type.STAR)
.trail(true)
.build();
meta.addEffect(effect);
meta.setPower(100);
firework.setFireworkMeta(meta);
firework.setVelocity(new Vector(0, 1, 0));
}
Thanks a lot
if i annotate a constructor with @Inject from guice, this class will be automatically instantiated or do i have to put in somewhore in module with @Provides
Inject on constructors simply enables constructor injection.
It doesnt create any instances of that class. Do you want to have a singleton of that class?
yes
Let me double check if there is a new way for this right now. But you can annotate your @Provides method with an additional @Singleton method.
Hmm. I thought you could annotate classes as singletons as well. Let me write a quick test for this.
i have a problem, when i create an item with NBT API, it works fine, but if i change its slot, it stops working
it loses its tags
What could it be?
What do you mean by "change its slot"
I'll try to record it, but it's literally picking up the item using a command, opening the inventory and changing its position
i don't know how to send the video kk but this is the download -> https://cdn.discordapp.com/attachments/1190631577777082409/1190631631871017040/2023-12-30_09-22-16.mkv?ex=65a2811d&is=65900c1d&hm=b64ece199be229b78c39ca172c058d2aad9267e3e5333df31d0aaad241139d6e&
when I got the customized item and changed the slot and tried to use it, it lost its references, but when I repeated the process and used it without changing the slot, it worked normally
?verify
;/
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
Does this only happen in creative?
And tell us the version as well while you are at it.
1.16.5
Are you hiding the nbt tag from the client
Creative mode is mostly client authoritative. So the server has no saying about the items that are created by the client.
So if it's on a normal survival server, the nbt will work normally? that's strange, but okay
Are you hiding the nbt tag from the client
and how do you remove it? I don't remember doing anything like that
Intercepting packets
if i have config like this:
1:
somepropertieshere
2:
someofthatheretoo
will config.getStringList("arenas") return 1,2?
no
Nope
That's not a list
those are keys
hm so how do i make it return keys
false? wdym
getKeys(false)
ah ok
okay thanks <3
what is method to store multiple numbers ? like
numbers: 1,2,3 (i need it for coordinates)
will setting an arraylist work?
numbers: [1,2,3]
.set("path", arraylist)?
so yes?
yes
ok
int x = (int) config.getList("numbers").get(0);
can i get first number with this
if its an int list sure
Teleporting with a player as the passenger usually doesn't end well
why dont you just save location in config ?
what does location object look like in config?
Thats a good idea btw
??
?tas
which enchantment is responsible for the effectiveness of the pickaxe
Efficiency?
Why the name and their descriptions are not similar to minecraft enchantments...
Because that's what they were called back in the day
DIG_SPEED is what you're looking for
iirc
:/
yeah
thenks
Do some1 know how to work with TabAPI?
?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!
What is the best way to give a player a prefix and name color that uses RGB Colors? I tried using Scoreboards and the prefix worked with RGB colors but the name color itself did not. Is there a way to do that?
i have this code for send packets of NPC to the player:
public static void addJoinPacket(Player player) {
for (NPC npc : NPCs.values()) {
ServerPlayer serverPlayer = ((CraftPlayer) player).getHandle(), npcPlayer = npc.getEntityPlayer();
serverPlayer.connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, npcPlayer));
EnumSet<ClientboundPlayerInfoUpdatePacket.Action> actions = EnumSet.noneOf(ClientboundPlayerInfoUpdatePacket.Action.class);
actions.add(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER);
actions.add(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_DISPLAY_NAME);
actions.add(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED);
ClientboundPlayerInfoUpdatePacket playerInfoPacket = new ClientboundPlayerInfoUpdatePacket(actions, new ArrayList<>(Collections.singletonList(npcPlayer)));
serverPlayer.connection.send(playerInfoPacket);
ClientboundAddEntityPacket addEntityPacket = new ClientboundAddEntityPacket(npc.getEntityPlayer());
serverPlayer.connection.send(addEntityPacket);
}
}
but i get this error:
Cannot invoke "net.minecraft.server.network.PlayerConnection.l()" because "player.c" is null
at net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket$Entry.<init>()
the problem looks like in the npcPlayer but i dont know what i do wrong
I'm going to guess you still didn't fix the npc dummy connection
the packetreader looks ok
private Channel getChannel(Player player) {
ServerGamePacketListenerImpl serverGamePacketListener = ((CraftPlayer) player).getHandle().connection;
Channel channel;
try {
Field field = null;
for (Field f : serverGamePacketListener.getClass().getFields()) {
if (f.getType().equals(Connection.class)) {
field = f;
break;
}
}
if (field == null)
throw new AttributeNotFoundException();
field.setAccessible(true);
Connection c = (Connection) field.get(serverGamePacketListener);
channel = c.channel;
return channel;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public void inject(Player player) {
//Entity Player playerconnection, playerConnection network manager, Network manager channel
channel = getChannel(player);
channels.put(player.getUniqueId(), channel);
System.out.println(player.getDisplayName() + " Added to pipeline");
if (channel.pipeline().get("PacketInjector") != null) {
return;
}
channel.pipeline().addAfter("decoder", "PacketInjector", new MessageToMessageDecoder<ServerboundInteractPacket>() {
@Override
protected void decode(ChannelHandlerContext channel, ServerboundInteractPacket packet, List<Object> arg) {
arg.add(packet);
readPacket(player, packet);
}
});
}
im trying like 4 hours. im still learning this its new for me
Do what we told you to do yesterday
i saw in FancyNPC his packetreader but the way he get the channel is different
what spesifeclly? we talked about a lot. the remapping is working now and that was the main problem
and i get the channel
im guessing the problem is still with the channel?
An NPC does not have a connection
but i dont use the NPC for the connection i use the player
and send him the packets
so how i send the packets to the player and summon the NPC?
.
Make a dummy connection to the npc
npcPlayer.connection
like that?
i still dont understand
i need to create connction between the player and the npc?
no
You need to create a connection that voids packets
so it doesn't throw errors
if its voids from packets i will i summon him?
can you write a example of the code? i think im missing something
no I'm not going to spoonfeed you code
i dont mean like that i just dont get it what i should write
i will ask a dummy questiom so i will understand from the basic
the connection that we talking what do you mean by create him?
i have ServerPlayer that he is the NPC and he have connection
so how do i create that?
That's for you to figure out
You're working with NMS so you can't expect support for it
do i have another way without NMS?
Use Citizens
npc.connection = new ServerGamePacketListenerImpl(((CraftServer) Bukkit.getServer()).getServer(), new Connection(PacketFlow.SERVERBOUND), npc, new CommonListenerCookie(gameProfile, 0, ClientInformation.createDefault()));
i think i did it
Use Citizens
Clone citizen github
at this point you're just letting us create it for you
There is no difference between us making it and Citizens team making it
sorry if it looks like that
ok so will stop asking
Feel free to ask questions about design and problems
don't ask us to write it for you
You are already talking with firewall
i dont want you to write i just need someone to advise me someone who have more knowledge then me
Citizens
Isnt citizens open source?
It is
Is there an exception related to malformed data
In the java framework
Like for example a json object missing a bracket
jsonexception i think
Probably depends on the JSON library you're using
javax.json is built in iirc
int line = Integer.parseInt(args[3]);
How i can detecte if is a args[3] is a number?
Have ur own Exception maybe
Catch NumberFormatException iirc
Nah it has to be more abstracted than that
Well there is an exception you can catch around that
is there only this way?
like MalformedBodyException idk
u have
Integer x = Ints.tryParse(argument);
javax packages should be optional
if x == null //x is not a number
I just gave you another way vedcodee
Should it be runtime or checked
I thought I hadn't written the message
I feel like making it runtime, but I also think to a certain degree it is recoverable
lol alr
Depends
generally speaking you wanna have unchecked if its the programmers fault or the consumers fault the exception occured
And checked if its an issue thatβs not by u nor the end user
tho u have certain βexceptionsβ that are checked regardless
For instance when it comes to multithreading
well the thing is
It's a Config system
So it's the users fault not the developers fault
Prob unchecked
90% of exceptions are recoverable
I mean if you read/write IO then it might be reasonable to have it checked
Also I've never really seen people enforce their exception with a constructor containing good info
yeah I'm throwing an IOException fs
because the people who are actually good don't do this stuff for free or have the time to just go around making tutorials freely
The only thing I hate with exceptions partly is that you at times see leaky abstractions
oh like a low level exception being thrown
[13:17:01] [User Authenticator #21/INFO]: UUID of player Mikthegmr is 5e81b352-495e-4871-84e6-a9a9b5d41df7
i look this up and its my friend but his invertory is untoched and mikthegmr doesnt even exist like wtf
i dont even know how to patch this
i added anticheat becc the same thing happened but with my username and hub was destroyed idk man im looking for a patch quick
i dont get how to fix this
fix what
i send logs to dm
online mode
i fixed it
Can anyone here help me? BuildTools still doesn't work
Try running BuildTools in a clean folder with Git Bash
Assuming Windows
yeah i've done that already
Guess somethings interfering with the download
?paste your log
Never seen that error before
thats the error I got yesterday using Git bash, but that gui gives me the same exception
That's weird, the latest build is 4001, not 3999.
https://paste.md-5.net/suwurezelu.csh here the log of the gui, its a bit different
Ohhh, it's an issue with the portable git download then.
Maybe try adding the link to your whitelist. https://github.com/git-for-windows/git/releases/download/v2.30.0.windows.1/PortableGit-2.30.0-64-bit.7z.exe
Should really make a flag that disables that download.
just to be sure, how do you add something to your Windows Defender whitelist?
Windows Defender shouldn't block that
^
Although tag mismatch is usually something on the dev side. So maybe it got screwed up?
I'd say somethings messing with the connection
causing ssl to break
but I'm just guessing
Maybe a VPN rule? Or you're just on a private network?
I downloaded portable git and still get the exception
private network
have you got any other ideas what I could do? xD
You could maybe try using the https certificate skip flag. --disable-certificate-check
nope doesnt work
You could also try moving the portable git you downloaded into the parent folder of BuildTools.
I think that's where it tries to look for it on Windows.
I downloaded this and put it already in that folder. Isn't that the right thing?
It is
yeah then I've already done that
Another thought is the directory it's currently running in may have certain permissions. Current Path: C:\Users\KleinBuli\AppData\Local\Temp\scoped_dir23464_196411674\.
Maybe try running that in C:\Users\KleinBuli\Downloads\BuildTools
doesn't work either
Anyone know if the "don't use self-driving computers to access spigotmc.org" rule is still in effect? Like, can we publish resource updates from scripts yet?
Does anyone know on how to light a nether portal with code?
Now I used Git Bash to run BuildTools again, It startet downloading and creating bukkit and spigot folders and got some files but stopped after 1 minute and gave me the same exception as always
Set a block inside the nether portal to fire
Paste that log. If it got further, then it's probably another issue.
Will try that, thanks!
which java version are you using
They are using 17
Java 17, I downloaded the JDK thats recommended on the spigotmc website for 1.17 and above
are you using some weird antivirus that does HTTPS MITM like kasperky?
nope just windows defender
have you tried just installing git?
then no clue
yeah
if you have git installed then why are you worried about portable
it downloads when not ran in gitbash
only if it detects you don't have it installed
enchantment "reclining" is KNOCKBACK in bukkit?
because when I used the GUI, it crashed while downloading portable git. When I run BuildTools in git bash it just crashed after a minute of downloding spigot or bukkit
If you open up command prompt and run git --version, what's the output?
git version 2.43.0.windows.1
Does sh do anything?
doesn't exist
What about in gitbash?
command not found
That would be why the BuildTools check fails then.
Okay how can I fix this?
did you enter "gitbash" or did you enter sh in git bash?
I entered sh in git bash
what can I do now?
If you try to git clone a repo inside git bash, does it fail ?
I never used git before how do I do that
git clone <linkToARandomGitHubRepo>
e.g. git clone https://github.com/SpigotMC/BungeeCord
@tender shard Does your gitbash recognize sh?
git clone https://github.com/SpigotMC/BungeeCord.git for example
Too fast for me
x)
more or less. it complains about this but still starts sh
Hmmm, maybe a bad install then? Or maybe one of the settings in the install wizard is what installs it?
https://pastebin.com/cn5Q1ZaH thats the output i get when I try cloning that repo
Well, there is clearly a problem with your internet connection
update git bash and everything it comes with https://stackoverflow.com/questions/48938019/git-pull-push-unable-to-access-https-ssl-routines-seem-to-be-down
it probably is. My connection is the weirdest thing I've ever seen
My wifi connection disconnects when I'm not on a minecraft server, in a valorant/fortnite/csgo match...
or downloading something
Well
How to Set Weather to Snow?
By setting biome to snow ig
snow is just rain in snowy biomes
how?
is it possible that somebody just sends me the spigot.jar thats created by buildtools? I need it for nms
That won't work.
Looks like the problem is that your connection is too slow/ too unstable.
have you tried reinstalling git bash?
I've already done this 5 times yesterday
didn't change anything
You need BuildTools to run in order to get access to NMS. This is because BuildTools installs the repos to your local .m2 directory.
any other way to use nms?
Did you truly wipe it before you reinstalled it?
how can I make it so that there is no PlayerInteractItem every tick? I mean that in one click the event is executed 2-3 times
The BuildTools struggled to download git portable itself so it's not a git bash problem (or there is more than one problem)
package index
yeah
Uninstalling programs does not always result in all files being erased. You'd need to run some cleaning tools to get rid of everthing.
Plus, now that I'm thinking about it, git messes with your PATH environmental variable. It could also be that.
isn't there any other way to use nms?
location.getWorld().setBiome((int) location.getX()*16, (int) location.getZ()*16, Biome.SNOWY_TAIGA);?
already
raining
i have player.setPlayerWeather(WeatherType.DOWNFALL);
I don't know whether I want to be the one to mention all the things wrong with this so I'll let someone else have the fun
You may try to get the compiled server jar (not the main one as it's now a Bootstrap jar) and depend on this. But you won't get the mojang mappings and it's kinda scrappy
Unfortunately not. BuildTools is required for that.
Although in your case, it seems to be more of a system issue than an issue with BuildTools itself.
there are public maven repos that have the full server .jars
idk if they include the mappings etc too
If you try to clone the repo multiple times in differents folder, does it succeed sometimes or it fails every time ?
tbh I'd just install debian in a VM, run buildtools there, then copy the .m2 folder
I tried on my other SSD and there it worked
I'll try running BuildTools on that ssd
your system is cursed lol
x)
lol
so how do I set the biome type to 16chunks correctly so that the rain turns into snow
Drive permissions are a thing, but do they interfere with connections?
From a SSL exception to a hard drive problem
Should not
That's what I was thinking, but what if it was a network drive?
nope buildtools won't work
Well
Based on previous result
Spam the BuildTools
With some luck
It will succeed to clone each repo
And then run
You managed to get 3 repo in one of your try
it deletes the folders when I restart it
Run this once you have all the repos downloaded. java -jar BuildTools.jar --dont-update
doesn't work
If you try to clone the BungeeCord repo on your ssd, does it still work ?
Did you include the --rev flag? Cause if so, remove it.
yeah
Definitly cursed
yeah
100%
--rev and --dont-update are incompatible flags. That's why you can't use them together. (Although they are not really, I'm working on getting that removed. :))
how do i do that
I don't know if there is any documentation of the Build process that the BuildTools follow
If there is not, just look at the source file and do each step yourself
The links won't be in the source code. It will be on the maven repo. nvm, I'm just dumb
1 sec
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git are those 4 or 5 links the ones I need?
like craftbukkit.git, bukkit.git and everything
These are the links you need.
Those are the repo you need to clone
please answer someone))
$ git clone https://hub.spigotmc.org/stash/scm/spigot/builddata.git
Cloning into 'builddata'...
remote: Enumerating objects: 568, done.
remote: Counting objects: 100% (120/120), done.
remote: Compressing objects: 100% (120/120), done.
error: RPC failed; curl 56 OpenSSL SSL_read: OpenSSL/3.1.4: error:0A000119:SSL routines::decryption failed or bad record mac, errno 0
error: 53271 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
that doesn't work
On your SSD ?
Try to download it with firefox or smth
okay what do i do now?
Move all of those downloaded folders into one.
yeah
Then put BuildTools in that same folder and run it with java -jar BuildTools.jar --dont-update
If that fails, then it's a system issue.
it failed
x)
wait
but i think i know
Exception in thread "main" org.eclipse.jgit.api.errors.JGitInternalException: Destination path "BuildData" already exists and is not an empty directory at org.eclipse.jgit.api.CloneCommand.verifyDirectories(CloneCommand.java:254) at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:166) at org.spigotmc.builder.Builder.clone(Builder.java:1140) at org.spigotmc.builder.Builder.main(Builder.java:377) at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
nope i dont know
Well
but i can't delete the things in the Builddata folder?
It's basically saying that there is no git history
Which is logic because you downloaded the repo instead of cloning it
Nop
You need it
Well
You can enter each command that the BuildTools run
x)
but why can't I clone builddata?
Internet connection I guess
Maybe there is files that are too heavy for your connection
wow
The largest one being 10MB
my connection isn't that slow
and not that bad
with downloading i've never got any issues
Is your connection stable ?
right now yeah because i'm afk on a minecraft server lol
if I'd disconnect my connection would crash in like 20secs and I had to reconnect
I remember my last internet connection being somewhat unstable, but things would recover. It was like burst internet. Fucking terrible, but it could get the job done.
yeah i've got that issue since 2020
Who's your provider?
Vodafone ig
Tethering?
it's definitely some issue related to SSL
whats that
Hey, I have a problem about add Vault API in my plugin because when I build my plugin, I have error:
package net.milkbowl.vault.economy does not exist
or, I add Vault in my library :
you have to add vault using maven, not through intellij
how ?
^
yes but if I add like this, I have another error
be?
Invalid content was found starting with element '{"http://maven.apache.org/POM/4.0.0":repositories}'. One of '{"http://maven.apache.org/POM/4.0.0":parent, "http://maven.apache.org/POM/4.0.0":url, "http://maven.apache.org/POM/4.0.0":inceptionYear, "http://maven.apache.org/POM/4.0.0":organization, "http://maven.apache.org/POM/4.0.0":licenses, "http://maven.apache.org/POM/4.0.0":developers, "http://maven.apache.org/POM/4.0.0":contributors, "http://maven.apache.org/POM/4.0.0":mailingLists, "http://maven.apache.org/POM/4.0.0":prerequisites, "http://maven.apache.org/POM/4.0.0":modules, "http://maven.apache.org/POM/4.0.0":scm, "http://maven.apache.org/POM/4.0.0":issueManagement, "http://maven.apache.org/POM/4.0.0":ciManagement, "http://maven.apache.org/POM/4.0.0":distributionManagement, "http://maven.apache.org/POM/4.0.0":dependencyManagement, "http://maven.apache.org/POM/4.0.0":pluginRepositories, "http://maven.apache.org/POM/4.0.0":reports, "http://maven.apache.org/POM/4.0.0":reporting, "http://maven.apache.org/POM/4.0.0":profiles}' is expected.
?paste your pom
Paste the link
well you gotta send the link here
you have repositories and dependencies declared twice
http?
you have to "merge" it
Into one section
you got <repositories> twice and <dependencies> twice
Only one <repositories> tag and only one <dependencies> tag per pom file.
can you edit the file to send it back to me
how can I clone it tho
With the clone command
yeah but clone command doesnt work :c
Yeah I know
tbh why don't you just create a debian VM in virtualbox and then run buildtools there, that's probably the fastest solution
I'm dying here from the complexity of the nms of these chunks and biomebase, give a kind person a normal way from the api spigot, code above does not work. I need to set a snow biome so that there will be snow instead of rain for the new year)
yes but I have another error again
Dependency 'com.github.MilkBowl:VaultAPI:1.7' not found
Reload your pom
Sometimes, people suggest you to change something in your pom.xml, and then IntelliJ starts to complain: That is totally normal. You simply have to click the βmaven reload buttonβ in IntelliJ. Maven will then continue to download the required dependency/plugin, if itβs available. After a few seconds, everything should be fine. You can find the.....
Provides transitive vulnerable dependency maven:junit:junit:4.10 CVE-2020-15250 5.5 Incorrect Permission Assignment for Critical Resource vulnerability Results powered by Checkmarx(c)
on yellow
you can ignore that
alternatively, read the comments in the blog post if this bothers you
THANKS !!!!!
but when it's a problem with my connection, doesn't that issue continue in the virtual machine?
since you don't shade vault, it's not an issue
and I can use a vault API now ?
Yes
pleasee
thanks, you're so nice π
it's an issue regarding OpenSSL or sth
bye
i'm pretty sure that if you just run biuldtools in a debian VM, it'd work fine
Okay, I'll install a vm then
Do you even need a VM? Can't WSL transfer files?
the only thing i wanna do is creating a packet scoreboard because i wanna learn to code with nms, im dying istg
well but they said they wanna learn to code with nms
Oh, mb
if it compiled fine on debian, just copy the contents of /home/yourname/.m2/repository into the windows folder
and that's it
actually I've always used packet scoreboard (a code of a friend) because I've always have been to stupid to make a tablist prefix and a non-flickering (idk if this is the right english word) sidebar at the same time
So my plan was to code the packet scoreboard myself
not even that, IJ is completely stupid. That is a test dependency - such deps will never be resolved unless you configure your resolver incredibly terribly
Is there an efficient way to fill a preset area with lava, like the /fill command?
oh yeah I haven't looked at it
technically vault should just get rid of this dependency since it isn't being used anywhere, but whatever
How large is this area?
A 96*96 area, 1 block tall
i'd just use the api and iterate over the coords
96x96x1 isn't much
worth a read, but total overkill for a mere 10k blocks: https://www.spigotmc.org/threads/methods-for-changing-a-massive-amount-of-blocks-up-to-14m-blocks-s.395868/
i'd just use Block#setType(Material, false) on each block
(unless you need physics ofc)
Wdym by physics?
physics = e.g. checking if a torch is about to break, if sand is about to fall, etc bla bla
I'm trying to run a very large tellraw command using the bungeecord API. Starting with build 1760 I get this error. net.md_5.bungee.protocol.OverflowPacketException: Cannot send string longer than 32767
Is there a way to disable this check or alternative way of sending large jsons to the client?
Hello everyone, I have a problem with version 1.20.4. All the plugins where I used to register enchantments broke. How can I do to fix it? Is there a link or a post where this has already been discussed?
Use PDC instead of adding enchantments
yeah... but think about migrate from that to PDC and avoid broke all.... things for the Doc from the future because has the same issue xd
I got a glow enchantment, and I have 2 maven modules to make this work, one for 1.20.3+ and one for below https://github.com/mfnalex/JeffLib/tree/master/glow-enchantment
it'll however lead to issues when using removeEnchantment on the keyed one, as the server tries to cast the Enchantment to CraftEnchantment (which this class obviously does not extend)
What exactly is the difference between those two versions?
is enum E-Num en-um
with the time i hope mojang allow create custom enchantments...
the super constructor call
Yeah i only have this to give glow effect
i blame the firsts tutorials i see where show that method xd
Well I only do it the way I did because that was what my predecessor did
fr most online tutorials did
Though uh, I do it arguably worse than the recommended way as I store my enchantments in lore by default
Could you point me to a link to an example of someone using PDC to take a cue from?
Though I have an option to store it in the PDC if anyone really wishes to change the default
yeah if mojang allow that can reduce many custom code xd
?pdc
or: Why you should NEVER use NBT tags again! Spigot 1.14.1 added the biggest improvement that (in my opinion) ever made it into the Bukkit API: The Persistent Data Container (PDC). It can be used to store custom data on Entities, TileEntities, and ItemStacks. Using a bit of math, it can also be used to...
Based on the Configuration phase and all I'd say maybe they are working towards "syncing" stuff between server and client, but at the moment one can only hope
yeah i need migrate to PDC and try to check how migrate the old enchantments because in nbt still exists to the PDC or reset... the plugin is for a survival with people then can wait and reset the entire world for avoid migrate and reset all enchantments xd
Youβll need two maven modules like in my github link above i guess
i remember read about edit the Registry... but not sure how and this can be broken later then not sounds like a good "fix"
well right now you can unfreeze mojang regitries but that could have bad effects down the line
if wanna support old versions yeah
maybe can be good make a library with all this and use in the survival plugin...
we have no clue how long they are going to keep stuff unsynced between client and server
it could be years still

alternatively you can fiddle with reflection to create the ENchantment object dynamically. but it'd still fail when calling removeEnchantment if it's not in the registry (bukkit2minecraft method in the CraftEnchantment class or whereever it was again)
remove for the anvil not? or in what cases?
to make that work you'd really have to extend the CraftEnchantment class (so one module per nms version π₯² )
You know what's wild though the fact the Brewing Stand still doesn't have custom recipes
mojang still has everything hard coded
i guess that will just strip all the enchantment at once so that might work
ThreadLocalRandom > new Random()
is that true? xd
new SecureRandom() πͺ
well nah, it just avoids allocating a new random xd
the anvil will probably just strip the whole enchantment tag without checking any specific enchantment
in a envil event i need basically rewrite all the logic for make handle and now need check all this again when fix enchantments xd
where is it a pain at
i mean i can use a library... but that make me depend in another developer and reduce how many custom things can do... but in the other hand.. i need time xd
like the time for my PR related to Damage API
What do you need?
make the enchantments work in last version (not need work in past versions but need if exists items with the old enchantments system migrate to the new)
extend Enchantment, register it. Works fine. Now call removeEnchantment with your enchantment and see it fail because spigot tries to cast your enchantment to CraftEnchantment
I don't really know the specifics, but couldn't you test against the server version and flow accordingly
instead of using getKey() to get the key, it casts it to CraftEnchantment, then gets the NMS enchantment from that, and calls getKey() or whats it called on that
wouldn't you wanna inject into the vanilla registry now
it'll only break once mojang syncs
but at the point where they do sync you'll have hopefully an easier alternative to register
probably. but I only need it for glow anyway
spigot should include a dummy glow enchantment tbh
@worldly ingot do you think a pull request for a dummy enchantment would get merged, so that people can give a glow effect to their custom PDC enchantments?
Doubt it
hm then what's the proper way to make items look enchanted using API
exists a OLD JIRA for the glow thing..
if that was not harcoded can be easy create a good method rather than add a dummy enchant
Give it some enchantment that doesn't apply to the item. Minecraft itself doesn't support arbitrary glowing so you have to work with what vanilla gives you
yeah i dont care how it works, I just wanna be able to give the enchantment look to items without NMS lol
We're on the server after all
but then it'd show that enchantment in the lore
ItemFlag.HIDE_ENCHANTS
then it wouldnt show other enchantments
Like I said, we're working on the server. We can only do so much
spigot could just include a dummy enchantment
That might work now, no guarantee it will work in the future. It's undefined behaviour of the client that we shouldn't be adding API for
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.
Mojang adds an NBT tag to show an item glint
How can i give a Scoreboard Team a custom color with for example ChatColor.of(new Color(177, 5, 5, 216)) ?
You can't. Scoreboard teams only support the 16 standard colours
Vanilla limitation, unfortunately
mh, i thought i saw some other servers have this feature
You can still modify the name color
You can give arbitrary colours to a team's prefix, which would change their nameplate
The team colour itself cannot be RGB though
when I just set the prefix the color doesn't apply to the players name
that remind me not exists API for the scoreboard with not "numbers"
Ok so when doing this after a player executes the command, I'm using this: blocation.getBlock().setType(Material.LAVA); However, the blocation location variable needs a world for the location. How could I get the world from the command sender? I'm currently doing this, which returns an error: Entity player = Bukkit.getPlayer(String.valueOf(sender)); World world = player.getWorld();
check if the sender is instanceof Player, if not send an error message, if yes cast it to Player
So this?
Entity player = Bukkit.getPlayer(String.valueOf(sender));
World world = player.getWorld();
} else {
sender.sendMessage(ChatColor.RED.toString() + "A player must execute this command.");
return false;
}```
Iβm waiting on a PR in Bungee Chat to get merged before I make it
Itβs on my list
or better if use java 17
if (sender instanceof Player player) {
World world = player.getWorld();
} else {
sender.sendMessage(ChatColor.RED + "A player must execute this command.");
return false;
}
nice
If not: Player player = (Player) sender;
kinda, but yo ushould return true instead of false
returning false would show the command's usage message
How can I give every player their own scoreboard?
ScoreboardManager#createNewScoreboard or sth
if(player.getScoreboard().equals(Bukkit.getScoreboardManager().getMainScoreboard())) { player.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard()); }
i used this but this doesn't work
why are you comparing it against the main scoreboard? you're also never saving the new scoreboard anywhere
Remove the if statement
Now only the last player that joins gets the scoreboard, the scoreboard of the 1st player gets removed
where do I remove it?
You should call Bukkit.getScoreboardManager().getNewScoreboard() only once
And save it
why does it say that onplayrlogin isnt being used
is there a way to set a World variable to the overworld without detecting the world from a player?
the method? well is not being used
its a IDE thing.. because the method is not being used directly... this ignore the logic of the annotation
because you never use that field
you only use the constructor arg
Hello.
How can I create brewing stand reciepe that require no fuel/make so doing stuff in brewing stand would trigger brewing animation?
what attribute to use so it only says in main hand
in the img i used [Attribute.GENERIC_ATTACK_DAMAGE]
specify an equipment slot
declaration: package: org.bukkit.attribute, class: AttributeModifier
i dont see setSlot
its on the constructor
ah ok ty
btw what is the first arg
id of attribute you that you set?
UUID.randomUUID(),
"GENERIC_ATTACK_DAMAGE",
additionalDamage,
AttributeModifier.Operation.ADD_NUMBER,
EquipmentSlot.HAND
);``` i do this rn
Is there any event that checks if a Block is placed/destroyed via command?
that should work
no
Isn't there a method to do that via the bukkit unsafe or does that not work anymore?
i don't see anything about enchantments in CraftMagicNumbers or UnsafeValues
.
ah I see
Took a while to find. Seems like that hack is rather unknown
that'd however break if one adds an enchantment and then removes it again
yeah I suppose that is correct
Can anyone confirm from ontop of their heads whether https://youtrack.jetbrains.com/issue/IDEA-134826/Idea-fails-to-read-maven-dependencies-with-scope-system-and-having-a-systemPath-pointing-to-the-jar-file. is still a thing? This seems like an issue that is bizzare to sit around unfixed for almost an entire decade
I've seen that working
anyways system path dependencies are deprecated
you should just install the jar in to your maven repo
whats in your guys opinion is the best way to make sure paid plugins arent just given away from 1 guy that paid for it?
Yeah I know. Just wanted to look whether I could add that as a source underlying that system scopes are bad. But obviously I wouldn't want to add an invalid/out of date source there - would I?
Realistically? There isn't any outside of making sure that you give the best possible service to those that actually pay.
You can always go open source with paid support like Citizens 
Yeah exactly
never had any iossues with that. however using systemPath with project.basedir is not supported as per maven docs
still it's working fine for me on maven 3.6.3
Though I mean realistically I could add any source I want, it's not like anyone who reviews my paper will have any idea on how the maven resolver yet alone the java ecosystem as a whole works.
Uh great. Time to add maven.apache.org as my source for the millionth time.
https://maven.enginehub.org/repo/com/sk89q/worldedit/worldedit-bukkit/ check the available versions. 7.0.9 doesnt exist
use 7.2.18
Oh wow, alex figured out how to use a maven repository manually
is this a joke or sth lol
I am genuinely surprised since few know about that you can use the online index
well tbh it depends on the webserver whether it works or not. the proper way is to get the maven-metadata.xml
yeah
mod_autoindex π₯²
does nginx even support that
ah yeah it does but it's off by default
I dunno. I've been using lighttpd's mod_dirlisting module for this
sacked
well then check the repo
you yourself sent a screenshot of worldedit
i mean the pom.xml you sent includes worldedit
Well there we have your issue, your artifactid was wrong
worldguard is indeed 7.0.9 latest
sorry but in my code, I put :
if (entity.getType() == EntityType.CREEPER){
if (EthernaPl.getInstance().setupEconomy()) {
player.sendMessage(Config.plugin.getConfig().getString("EntityDeath.message.creeper"));
EthernaPl.getInstance().economy.depositPlayer(player, 3);
}
}```
but when I kill creeper, I donβt earn my money and I donβt have my message in my chat
what does your setupEconomy method do?
can you make a localhost auto download newest spigot release (i'm hosting through intellij)
huh wha?
public Economy economy = null;
public boolean setupEconomy() {
RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(Economy.class);
if (economyProvider != null) {
economy = economyProvider.getProvider();
}
return (economy != null);
}```
what do you not understand
I'd not use that method. Listen for https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/server/ServiceRegisterEvent.html instead and assign the service to a field. Then check if the field is != null like you are used to
declaration: package: org.bukkit.event.server, class: ServiceRegisterEvent
Though uh honestly, that this should work even though it is horribly inefficent
it is, but the method is the cause of 90% of issues created over at the Vault github
ahhhhh you ask me how I register my event?
No
You listen to it like any other bukkit event
You should do setupEconomy once in constructor
DO NOT.
So what should I put instead of her?
No i said that he should do it only once if he even uses the method
Not everytime a mob is killed
That is also the wrong place
You need to do it on the first tick
At the earliest
why
public class EconomyListener implements Listener{
private MyPlugin plugin = JavaPlugin.getInstance(MyPlugin.class);
@EventHandler
public void onEvent(ServiceRegisterEvent evt) {
RegisteredServiceProvider rsp = evt.getProvider();
if (rsp.getService() == Economy.class) {
// Technically you need to invoke rsp.compareTo() but that is an exercise left to the user
plugin.setEconomy(rsp.getProvider());
}
}
}
my EthernaPl is this, I don't no if it help you
Where do I put it?
Because otherwise you risk that the economy registers after your plugin initialized
this is only any good if you can guarantee you start first
hey, i have protocolLib installed, as u can see by the fact that i can invokeProtocolManager and ProtocolLibrary, but i cant get the CraftPLayer, why?
Yeah right, you also need to query the RSP
@storm raven Just to make sure, you have an economy installed on your server, right?
CraftPlayer is nms and ProtocolManager is protocolib
Vault alone does not suffice
yes I have the vault plugin
And what is your economy implementation/provider plugin?
I have vault and essentialsX
π€’
so, if i want to make a players armor invisible, is protocolLib enought?
If you need craftplayer then you need nms
?nms
?stash
do you forget me ?
Let's just say I'm preoccupied
youre better off not using essentials or vault and making your own economy
Jesus
whut
What is your pom.xml?
?pom
Please paste your pom.xml file, or build.gradle (or build.gradle.kts) if you're using gradle on the following website: https://paste.md-5.net/
No, but something incredibly dumb
ok
what's the issue?
β** β **β
so what does setupEconomy return?
Do you know whether your event handler gets called in the first place?
so long as you depend on vault (plugin.yml) your setUpEconomy() will work fine
β** β **β
what does it return?
IF you are referencing the same Economy Field in all your code
true or false?
return (economy != null);
I think it never gets called, that is the issue
true, no ?
Like the actual value
!= null = true
well idk, print it out
no ?
It can return false if it is null
Why that would be the case is up in the air.
Basically what alex wants is a temporary System.out.println(economy);
Could you send us the EntityDeath class?
System.out.println("Listener called");
if (entity.getType() == EntityType.CREEPER){
System.out.println("It's a creeper");
if (EthernaPl.getInstance().setupEconomy()) {
System.out.println("Eceonomy is working");
player.sendMessage(Config.plugin.getConfig().getString("EntityDeath.message.creeper"));
EthernaPl.getInstance().economy.depositPlayer(player, 3);
}
}
add some debug prints ^
then check what it prints
try it
Bro use ConsoleSender not printLn
You will get useless warnings everytime
not really
Yes it does
no
When i use it gives warnings to not use it
then you're not using spigot
You shouldn't even do that - you should use the SLF4J logger, but given that it is a temporary thing it doesn't even matter
also who cares aobut those warnings if it's just for debugging
I mean if it's for debugging purposes sout is completely fine no
I not have message on consol
then your listener isnt being called at all
And with SLF4J logger I mean LoggerFactory.getLogger(getClass()).info(...)
Then send the EntityDeath class
does anyone here have a code for a Scoreboard System for 1.20 with a Sidebar + Tablist Prefix. The Sidebar should be unique for each player. I've been trying to code this for hours, but nothing works
you can see my main class here
β** β **β
what have you tried
?
I've tried my own code, I've tried multiple codes from youtube. With every code, the scoreboard disappears for the 2nd player
my listener is called no ?
obviously not, if it doesn't print anything
Just give me your EntityDeath class