#help-development
1 messages Β· Page 771 of 1
minestom is written in java lol
Wait what really?!
lmao
I thought that was a C++ rewrite lol
You can just write plugins in java for this
But it does not support bukkit plugins
Wait for the rust heads to finally finish their port
π΄
I mean there are first attempts to regionize worlds to allow multithreading. Folia uses a system to check if
a group of chunks border on another group, and if not, they get their own tick loop.
But writing plugins for this is completely different than writing plugins for spigot.
p sure minestom doesnt work with plugins
And make it threadsafe
folia has had around 1k players on a test on a single machine
Yeah but that fucks compat even more
"even more"
And another issue with sharding or folia is when all players are at one place
with sharded servers I wonder like
what if we had a proxy
that hid all the world transfering BS
so you could seemlessly transfer between servers as long as they all had the same worlds
Anyone know how I can intercept the applyPatches stage of BuildTools with my own?
what
How can I receive messages from the messaging channel on bungeecord
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
onPluginMessageReceived
I'm trying to fix the issue of buildtools messing with the global git config and I need to find a way to use my own version of applyPatches instead of the one that's automatically downloaded.
what you should really be doing is fixing applyPatches instead of trying to fix it in BT
?contribute
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
Yea, that's what I'm attempting.
ahh I see
I just don't know where I can have it use my version instead of the one that's automatically downloaded.
does it autoreplace one if it already exists
Yes
I mean we do have access to BT source no? maybe could do something inside of there since you already have it downloaded
Even when you run it directly after, any changes are overwritten.
My workaround for the time being is to
- Run once to build against the version I want.
- Unset all global git config values.
- Copy and paste changes into applyPatches.sh
- Set --dont-update
- Run again
Using --dont-update seems to not overwrite anything, but I had to disable some other things in buildtools to allow it to work with --rev.
I'm trying to figure out what md was talking about that one patch breaking against older versions, but I am not running into any such issue.
public ItemStack mapItem(BufferedImage image) {
ItemStack i = new ItemStack(Material.MAP);
MapView view = Bukkit.createMap(Bukkit.getWorlds().get(0));
view.getRenderers().clear();
view.addRenderer(new MapRenderer(image));
i.setDurability((short) view.getId());
return i;
}``` does this work to get the itemstack of a custom map?
does buildtools use the global flag?
it should be removed =/
I'm not sure how long after applyPatches is replaced it is run, but you could do something like starting a new thread which checks that files creation date once it changes automatic replace it with your version
so it is only confined to the repo
the only downside is that it would need to be set two times though
It does do an --includes check, but like you said, it should just be done on the repo level.
the reason for being set two times is because buildtools does 2 cloning
No? It does two checks for name and email.
I have commented that out in my test build btw.
it clones the intitial directory from hub that contains everything it needs, then once bukkit and CB is created, it then clones those to create the spigot repos
essentially in sudo code though
new Thread() {
private final long creationTimeForFile;
public void run() {
while(File.createTimeForFile == creationTimeForFile) {
}
// after we exit
Files.copy(yourFile, patchesLocation)
}
}.start()```
cloning I don't think automatically transfers over the author/committer settings
so you would need to set it for those repos
yes, but there is a cloning that happens before that as well as I said, so it would need to be set twice π
Adding these two lines seems to work.
I could be wrong, but I generally don't use buildtools anyways
Cloning is all done before hand, then this script is applied on both directories.
cloning happens twice
So setting the local config should work as expected.
you can see where buildtools clones bukkit repo to spigot repo
so you have patches that happen with bukkit and cb
once those are done being built, it then clones bukkit and cb to spigot
and then applies spigot patches
the cloning process happens twice in the context of using BuildTools. The initial cloning is done beforehand, and then the script is applied to both directories
Hello, so I am trying to use modules for different versions (gradle) but the problem is that each module requires an instance from the main class, giving it wouldn't be a problem, the problem is how do I get the methods from those modules back to the main class so I can execute the different versions?
I think it's done at the beginning during the initial cloning and verification. I'll play around with this idea.
Hello, when I trigger this on entity spawn, the speed effect isn't applied and protection on the armor isn't applied too:
public void modifiers(Zombie entity) {
PotionEffect speed = new PotionEffect(PotionEffectType.SPEED, -1, 1);
entity.addPotionEffect(speed);
EntityEquipment equipment = entity.getEquipment();
// Ajouter armure
ItemStack helmet = Main.getHighestHelmet();
ItemMeta hMeta = helmet.getItemMeta();
ItemStack chesplate = Main.getHighestChestplate();
ItemMeta cMeta = chesplate.getItemMeta();
ItemStack leggings = Main.getHighestLeggings();
ItemMeta lMeta = leggings.getItemMeta();
ItemStack boots = Main.getHighestBoots();
ItemMeta bMeta = boots.getItemMeta();
ItemStack sword = Main.getHighestSword();
ItemMeta sMeta = sword.getItemMeta();
if(hMeta == null | cMeta == null | lMeta == null | bMeta == null | sMeta == null
| equipment == null) return;
hMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 5, false);
cMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 5, false);
lMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 5, false);
bMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 5, false);
sMeta.addEnchant(Enchantment.DAMAGE_ALL, 5, false);
helmet.setItemMeta(hMeta);
chesplate.setItemMeta(cMeta);
leggings.setItemMeta(lMeta);
boots.setItemMeta(bMeta);
sword.setItemMeta(sMeta);
equipment.setHelmet(helmet);
equipment.setChestplate(chesplate);
equipment.setLeggings(leggings);
equipment.setBoots(boots);
equipment.setItemInMainHand(sword);
}```
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffect.html look at constructor
declaration: package: org.bukkit.potion, class: PotionEffect
it's exactly what I've done?
And if you want get prot5 at armor you have to set boolen in ItemMeta.addEnchantment to true
okay thanks
PotionEffect(PotionEffectType.SPEED, 20, 0) will be speed 1 for 1 second (20 ticks = 1 second) just look at docs
I use -1
not 20
infinite
Spigot version?
1.16.1
i love ur background
I'll just get PotionEffect.INFINITE value, but I think it's -1
no
you cant get PotionEffect.INFINITE in a version it didnt exist it
infinite potions werent added still late 1.19 iirc
I'm switching to 1.20.1
then how can I get an infinite effect?
PotionEffect.INFINITE
you just said ur switching to 1.20.1, but for pre 1.19 you give it int max value and then check they still have the effect on death, join and world change
okay thanks
max not -1
that's the infinite duration value in newer apis
okay thanks
π°
Most useless cast ever
is there any method that completely freezes the player
like from moving, breaking, placing
what is it
no
dunno about placing
oh ye
so a limbo
how r u gonna make the world white
then how can they
walk around infinitely
ok but u just said
ur gonna place white clay
around them
that wont render
just
make the person download a texture pack when they join
and that texture pack can include
the white effect for the server
but u can almost make a modded experience
with texture packs
it doesnt change textures
it just adds
texture
s
look ill show u something from my server
what the event were player drag item from his inventory to another
click event
but how i can get old inventory and new
because dont go in 1.18.2?
so this mean i have more then 54 slots??
In the code I get a player that I'm not looking at
How far off are you from the players hitbox with your crosshair?
I didn't quite understand what you asked me
How severe is the lack of precision on your crosshair?
Or... just try to explain the problem a bit better.
Which player are you getting and which player are you expecting to get?
retun the player
So, it returns a player that is behind you?
If I look at the sky from the code it shows me the player that is 3 blocks away from me
That sounds very unlikely. Could you maybe show how you got those results?
From whatever direction it comes back to me, this doesn't happen to me in my localhost. It only returns me to a server hosted in 1.18.2 not localhost
k
wurst
@lost matrix You see, the player I'm not seeing comes back to me
if i go in my localhost it go
Alright this doesnt sound like there is a problem with the code if it works on your localhost but not the remote server.
I know but it seems like the only thing that could cause that problem
not only
Also "com.github.retrooper.packetevents"
No, I'm seeing if through bukkit's raytrace it's looking at the player's hitboxes
I also created a modified version made by me obviously
?paste
Ok but only because you are looking into a certain direction, doesnt mean that the client tells the server that you are looking
into that direction
the missed hitbox yes
in localhost go very good
It detects it down to the thousandth
No, i mean only because your screen shows that you look into a direction, doesnt mean that the server sees the same thing.
Im assuming that the wurst client actually aims at the player before hitting to prevent getting detected.
.
.
Well then its a problem with the server
that's what I'm trying to understand
I'll show you the localhost
@lost matrix and @solar musk is very good

Oh hey he do be orange
What very good?
the missed hitbox with raytrace
Ah
but in the server dont go
now wait for ping to become a problem
he got da facelift
You're making me wonder why I didn't create the other server
@solar musk
i think older versions of mc dont
of spigot
but i dont have context to this discussion
tldr
yeah below 1.8 π
if you using that you need mental help
Yeah I am also surprised - we haven't gotten any new discord helpers in a long while now
I believe it is because imajin uhm exploded
nothing is impossible altho helpers are more or less selected nowadays
I wonder if you were normal at any point
how many years?
3 same number as me
he joined 3y ago this discord?
sept I think he joined on the first day of this discord
well 3 and like 6 months
but sept 21?
lmao i joined this discord in 21 and i have just 43k messages
I also went afk for 1 year
righ me too, i i think active talk around 22
agree too much with u y2k
Meanwhile I have "just" 25K messages on here - what are you doing?
But I guess most of my messages are generally helping random people on here and that isn't something I do often these days
most of my messages are from talking about Inventory PR
public abstract class Item {
private final BattleBowl plugin;
protected Item(BattleBowl plugin) {
this.plugin = plugin;
}
public ItemStack create() {
final var itemStack = getItemStack();
final var im = itemStack.getItemMeta();
im.getPersistentDataContainer().set(plugin.getItemManager().getIdentifierNamespace(), PersistentDataType.STRING, UUID.randomUUID().toString());
}
protected abstract ItemStack getItemStack();
protected abstract void runAction(PlayerInteractEvent e, Player p);
}
Any better way to write this? Passing around the plugin instance just to get one namespace is kinda annoying. Maybe a Constants class?
JavaPlugin.getPlugin(BattleBowl.class)
nah you're fine with DI
You could however make the Item class a listener and self register
before you run into this down the line, you need to setItemMeta after modifying the pdc
any ideas on how to change the Interpolation of a DisplayEntity at the same tick when/before spawning it? Usually it just teleports if you try it by default
im using gradle multi module project with shadowjar
i have a module depending on another module like so
implementation project(path: ":universal", configuration: "shadow")
said module shades a bunch of stuff and relocates it but i cannot use those at all
they dont appear in autocomplete or even when trying to search the package manually
everything works fine if i use the dependency from my maven local
implementation "com.github.kaspiandev.kommons:universal:1-SNAPSHOT"
it works like so
i followed this
if cmarco gets helper he will probably secretly ban people who dont support his religion
if he even knows how to ban people judging at the fact he couldnt even create a discord server and setup perms
i wanna include all shaded dependencies from the module
ohhh
it acts as if entire lib was gone
wait do u have the thing on gh
rly outdated
We got that new graven build tool
whos, what, where, when, why graven
https://paste.md-5.net/razetinigi.bash - the module i wanna use as dependency
https://paste.md-5.net/afuxiwerut.cs - the module that wants the module above as dependency
hey what's the best way to add player nametags? packets? setDisplayName? I want to modify the text above player head to something like "[{group}] {player}"
Any famous ways to do this? xD
iirc it has scoreboard teams involved
So I don't need to play around with packets?
π’
scoreboard is persistent during reloads/restarts right?
Doesnβt really matter
lets call the first one A, the second one B
you want A to be included in B's jar?
correct
well it is included in the jar
but for whatever reason its (shaded) dependencies arent
YEAH
OR intellij has trouble finding them
so u need to use java-library plugin instead
and then use api, instead of implementation in B
Yes the main scoreboard is
i see
ill try
after reloading i still see nothing in autocomplete
api project(path: ":universal", configuration: "shadow")
i changed the line like so and reloaded all modules
after googling generally this should be the solution
but it isnt working
and if u remove it just have in A
implementation project(':submodule')
Hey, I keep getting the error Cannot invoke "net.minecraft.server.network.CommonListenerCookie.b()" because "commonlistenercookie" is null, how can I fix it?
and then in B you'd use
api('some:dependency:ver')
i played around with it and its buggy
dependencies seem to shade twice lol
ill send the updated files tomorrow
yea, also its usually nicer to work w kotlin dsl
better type hinting system etc
just pulling the kotlin card yk :>
not a fan of it personally but if makes it work sure
π hopefully it will work magically tomorrow
π
public void test(PlayerInteractEvent event) {
System.out.println("PlayerInteractEvent: " + event.isCancelled());
}```
```[22:59:13 INFO]: PlayerInteractEvent: false```
Players can't consume any items, I know it's from my plugin but InteractEvent is enabled, ItemConsumeEvent isn't triggered because the player can't fully consume it, it's cancelled prior am I missing an event ?
What other events does your plugin use?
I checked every other cancelled event and none relate to this
And it works fine if ur plugin is not present?
Yes
What other event is triggered before consuming food ?
Interact is the only one I know of and it's not cancelled
Idk, try this thing and listen to all cancellable https://www.spigotmc.org/resources/eventdebugger.82055/
Check if useItemInHand is set to deny
Interact event is special and kinda has 2 cancellation states
kek
cancelling interact event sets both to deny
But you can just set one to deny with isCancelled becoming true
[23:09:03 INFO]: DEFAULT```
Hmm thatβs normal
Looks like this is just on me to find I appreciate the help though
im thinking about a way to make damage numbers appear on screen near entity, so I came up with this idea: Id get a vector pointing from entity to player, get it's x and z value, multiply it by a small number such as 0.1, and then take random value out of it from 0x to 1x it's value, and then make the number appear on screen in green field, is that a good idea?
Why not just take the vector from entity to player and multiply it by 0.1
And then stop there
yeah but I want to make it so that it would appear in random field that would be in front of player
not everytime in same place of player's line of sight
wait wouldnt u_x and z be always positive since they belong to vector u which is basically distance between them?
or can game tell it apart?
Idk
You could get the vector between them, and then random rotate it slightly, and then multiple by 0.1
killedPos + normalize(end - start) * randomDouble(minDistance, maxDistance)
what does normalize mean?
.normalize is a vector operation that does ^
Hey, I got a bit stuck with PluginChannelMessaging What I try to do Is to have a Clan name set in the Scoreboard but the Clan System is in BungeeCord now I try to encode a List and Later decode it on Spigot but when ever I try to send a message through neither side recives one My Code for BungeeCord:
(Main) https://paste.md-5.net/uzenuhirih.cpp
(Message Event) https://paste.md-5.net/daroyegifa.js
On Spigot it is:
(Main) https://paste.md-5.net/ipehixorow.java
(Message Listener) https://paste.md-5.net/xojojimahu.js
I assume end - start is just this vector's length?
Is there a way to get generated chunks even if they are currently unloaded?
Only found a way to get currently loaded chunks.
Is there a player onlineV
Not with the api
That would be a massive amount of chunks
not at the moment where it request it since that Messaging is on Server Start but Im on the bungee Network while that happens
so I need to basicly Request it on Player join event?
You got mysql use that
How would i do the math for this?
Without using region files, can't i just get all the chunks via looping them with getChunkAt?
yeah but I only save to MySQL on server stop and in between that it is saved in Lists and Objects
You could
mods or plugins
I think that generates chunks tol tho
But that will load the chunk if it isnβt generated yet
Just use it more
Ah thereβs an isChunkGenerated
So yes you could call that for every chunk in a world
Which is
how would i loop them?
14,062,500,000,000 chunks
Okay well thatβs a bit more reasonable
0-10000 with 16 fun fun
Get the chunk coordinate for 10000 and loop from positive to negative that value
For both x and z
that will request the chunk for FULL status, so it'll generate it lol
?
'?'?
The method is called isChunkGenerated
yes
which requires some information about the chunk to be loaded, but it requests the entire chunk so it will generate it if it isn't generated
Iβd have to look at the impl
unless you are running {unnameable fork}
Like this or?
still doesnt send the message
Those are the block coordinates, you want chunk coords
Right shift 4
Try simplyfying first to make sure a simple message can be sent properly
you need to wait a bit after the join event to send plugin messages, they are registered a tad later
iirc there's an event for that
?paste
?jd-s
You can load chunks without generating them
https://paste.md-5.net/oyigabajuy.java#
Why is there no File being created when I extend a class to it?
That makes little sense
What is your extended class
this would do the trick?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#getChunkAt(int,int,boolean) The class itself also has a isGenerated method
declaration: package: org.bukkit, interface: World
I suppose you can add some debug statements to check
when i say config = new Config() in onenable it should create a class right?
public YamlFileBuilder config;
new config?
yeah i instantiate the class in main class?
I just tried to send a simple test message still doesnt send the message through
Is config a second class?
Just use mysql
config is a class that extends from the abstract class?
well but then I would need to execute it on every player Join and aint that way to performance killing
Oh yeah also try this first @peak depot
Does it call the abstracts classes constructor
Just do it async?
So Config is Config or YamlFileBuilder
config extends yamlfilebuilder
https://paste.md-5.net/oyigabajuy.java# YAMLFILEBUILDER
Ahh, i read the above wrong my bad.
I tried working with mysql async didnt went so well
Config doesnβt call the super constructor
Try again properly
tell me more
Please do not use mysql to send messages @peak depot
I am telling him to just load it from his mysql
the java compiler automatically inserts a call to the no-argument constructor of the superclass
Really?
yes
i always send messages via mysql
help me
who doesnt I mean never seen something better to do
passing false to that method just creates a dummy, it doesn't load anything
Add some debug statements and ur problem will show itself
I can't imagine that, there would be no point for that and the docs themselves would be wrong as well
Debuggg
but how when the stuff in the class isnt even called?
Did you debug that?
im sure because if i create the file on my own everything else in the class works
Debug debug debug debug
And still I would need a way to check if eg his clan changed
Debg
Did you try as emily suggested to wait a bit before requesting the data from ur bungee instancr
After join
That is indeed stupid, that method should be deprecated
I tried 10 sec still nothing
funnily enough, the isGenerated method in Chunk should work when using getChunkAt(x, y, false)
lol
Main channel hylix:test subchanel Test value βTestβ registerd outgoing Chanel on spigot and registered Chanel on bungeecord
?paste
Is this one of those fun times where paper fixes something important and doesnβt bother telling upstream
Which of the convos
yeah I was about to ask lol
Well not really possible rn since I allready shut down my pc but I followed this guide and copy pasted https://www.spigotmc.org/wiki/sending-a-custom-plugin-message-from-bungeecord/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Have people shit on you for having kotlin in ur disc desc yet
surprisingly not
yourself -> yourself again -> yourself again -> maybe it's a library bug? -> nope, yourself again -> maybe I'll check the library again -> environment -> editor -> standard library -> compiler
- Fox#0001
You are still at yourself
Oh wow, now I see what I mean. I thought isChunkGenerated would just call the same thing as within the Chunk class lmao but it does something completely different
The chunk stuff
not really, it's more so because leaf decided to rewrite the entire chunk system and like that method was in the way
Like legit I followed the whole tutorial and changed the data but kept the rest same like what should I do
?nocode
Itβs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
Wondering if anyone can give me some sage wisdom, I was here earlier and I have no leads
Interact event is blocked, and even when it's not cancelled it still won't trigger
Output
[01:00:21 INFO]: Normalfalse
[01:00:21 INFO]: Highestfalse
[01:00:21 INFO]: Monitorfalse
[01:00:21 INFO]: false
[01:00:21 INFO]: true
Code
@EventHandler(priority = EventPriority.HIGHEST)
public void playerInteract(PlayerInteractEvent event) {
System.out.println("Highest" + event.isCancelled());
event.setCancelled(false);
}
@EventHandler(priority = EventPriority.MONITOR)
public void playerInteract2(PlayerInteractEvent event) {
System.out.println("Monitor" + event.isCancelled());
System.out.println(event.isBlockInHand());
System.out.println(event.hasItem());
event.setCancelled(false);
}
@EventHandler
public void playerInteract3(PlayerInteractEvent event) {
System.out.println("Normal" + event.isCancelled());
event.setCancelled(false);
}
@EventHandler(priority = EventPriority.LOWEST)
public void playerInteract4(PlayerInteractEvent event) {
System.out.println("Lowest" + event.isCancelled());
event.setCancelled(false);
}
You are not supposed to do anything from monitor if i recall
Its purely there to well monitor of course lol
Yea it still won't trigger regardless
It does trigger otherwise it wouldnt have printed
What it didnt do was cancel the event because its a monitor
It's still not cancelled at highest priority
No, you set it to false for cancelled
I worded it wrong
It is cancelling even though I've set it to false at every priority
if i have a location with direction, how would i get the block next to it
is that a thing i can do
In fact with what you showed in code none of them get set to cancelled
I know that's what I want but it's cancelling my action ingame
Yes
Well events dont get cancelled unless something else is doing it.
block.getRelative(BlockFace.WEST)
I know I've been debugging for 3 hours to find the source, I disabled everything in my plugin and I can't find it
My only solution is to uncancel it, which I'm doing
Yet it's still cancelled
Try listening on entityonteract
Ok
And see if somethin is swatting that
I'm just consuming a golden apple though
does that use the direction (yaw, pitch) of the location or does it get it to the absolute west
Playerinteract derives from that one
No it doesnβt
Playerinteract doesnt come from entity one?
No
Must been some other even i was thinking of then
Coll impart with me sage wisdom what in monkey is going on
Do you have any other plugins?
When I remove this it works again
It's from my plugin, but I can't find the source
Are you in creative?
Do you have any other plugins installed
Are you opped and have a permissions plugin?
My plugin is causing it, when I remove my plugin it is working again
Yeah we need to know if there is, there has to be. That event doesnt magically get messed with
Ok what plugins do you have?
I never registered the same event multiple times with different priorities
I dont know how this works
what if you register one event only
with no priority at all
I did
Think of the priorities as different queues.
When I don't have XPrison:
- Eating a golden apple works
When I have XPrison:
- It doesn't. The source is from my plugin
I can't find why it's cancelled, so I'm uncancelling it. Which leads to my code above
The event is still cancelling even when it says it's not
We still need to know what plugins you have
So if you dont register the event at all everything works and if you register it without cancelling or anything, then it doesnt work?
EssentialsX,Factions,helper,,Multiverse,spark,Vault,worldedit,worldguard,XPrison(The plugin)
ah
The info is here
And of course they list very important plugins notorious of overriding things
worldguard might be the thing
Yep it typically listens on highest and lowest
It's from my plugin, the event is not cancelled when it's not installed
Everything works without my plugin
They're updating from the log I showed
Well i will let someone else help. I need to drive to work lol. I recommend testing without all those plugins
They're all dependents
You are not using the reload command are you?
No
The issue is 100% deriving from my plugin. So I'm hackily uncancelling which still doesn't work
It is most likely another plugin interfering unless there is more to your code you are not showing
No, there is no other plugin interfering. I'm trying to drive this point
The apple consumption works when my plugin is gone
When I add my plugin, it is cancelling, so I'm uncancelling which is doing nothing
Did you try to run your plugin on a server that's clean of plugins?
They're all dependents
Did you dump/debug the registered listeners of everything?
Yes those don't give any info
I've used an EventDebugger, it claims it's cancelled like my debug states
But it's cancelling
XPrison is probably somehow using golden apples as its own ... xp item?
and therefore is preventing you from eating it
maybe you don't have permission, etc..
And my point is that the event isnt magically messed with either. If none of those plugins touch that even which inam sure they do. Ie worldguard if you stand in a region where item consume is disabled for example will interfere
My point is that I know that and is why I've messed with every priority to undo the cancelling because I don't know where it comes from. It's a bad solution but that still doesn't work
I am in creative, opped, in no region, global region has no flags relevant to items
I tested in both gamemodes
Why creative?
Yes I am dumb
Well priority is also not the only thing. Last plugin registered also gets final say
Check your source code
I have
I used GitHub to check for any interact event, can't find it. Which is why I'm doing this
It still doesn't work
Anyways i guess it must be magic
My plugin is last registered
Can I see it
No
Off to work for me
Then I can't help
Ok thanks anyways I appreciate it
?nocode moment
Itβs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
Thanks
It's no biggie to send your code, we'll help you if you do
And we most likely wont if you choose not to
I can't release it
i can really assure you noone here will steal your code and make profit out of it
It's a client's plugin I can't release it
NDA is just about the only reason not to share it.
It's basically NDA
So it's not actually NDA?
I would get fired if I did
They can however share relevent code bits and NDA can not cover code that doesnt belong to you anyways
But whatever
Are there any other events that trigger from right-clicking a consumable?
Should just be the PlayerInteractEvent that gets fired.
?jd-s
declaration: package: org.bukkit.event.player, class: PlayerItemConsumeEvent
This maybe
That isn't triggered it's cancelled beforehand, already tested
Which it shouldnt be
I know
My plugin is last loaded and I showed the debug for the priority
Which i said earlier
[01:00:16 INFO]: [X-Prison] Loaded 2 ranks!
[01:00:16 INFO]: [X-Prison] Β§aX-Prison - Module Ranks loaded.
[01:00:16 INFO]: [X-Prison] Using Money currency for Prestiges.
[01:00:16 INFO]: [X-Prison] Loaded 3 prestiges!
[01:00:16 INFO]: [X-Prison] Β§aX-Prison - Module Prestiges loaded.
[01:00:16 INFO]: [X-Prison] Β§aX-Prison - Module Mines loaded.
[01:00:16 INFO]: [X-Prison] Β§aX-Prison - Module History loaded.
[01:00:16 INFO]: [PlaceholderAPI] Successfully registered expansion: xprison [1.12.11]
[01:00:16 INFO]: Server permissions file permissions.yml is empty, ignoring it
[01:00:17 INFO]: Done (6.685s)! For help, type "help" or "?"```
πππ
How about dumping what is registered to the listeners or start looking in the configs of these plugins
Essentials can mess with item consuming as well
isn't xprison that one prisoncore on mcmarket
Have no idea
It's a fork
I dumped RegisteredListeners, I can't really do anything with it
It should show what is registered to what plugin
I never confirmed that let me try I just automatically assumed it was XPrison
That's on me let me try
It is the definitive way to see which plugin is or is not messing with an event
Ironic
technically it's a private git
dude just adds literally anyone to the org
it has like 5 pages of members
Nice
Ok so if getNewScoreboard isn't persistent through reloads/reboots then how am I supposed to create teams at all? Recreate them everytime on onEnable? Shouldn't main scoreboard be left untouched? is scoreboard the only way to modify the player names (above their head)?
[01:35:51 INFO]: Normalfalse
[01:35:51 INFO]: Highestfalse
[01:35:51 INFO]: Highestfalse
[01:35:51 INFO]: Monitorfalse
[01:35:51 INFO]: false
[01:35:51 INFO]: true
[01:35:51 INFO]: X-Prison from Plugin
[01:35:51 INFO]: WorldEdit from Plugin
[01:35:51 INFO]: Multiverse-Core from Plugin
[01:35:51 INFO]: WorldGuard from Plugin
[01:35:51 INFO]: Factions from Plugin
[01:35:51 INFO]: Essentials from Plugin
[01:35:51 INFO]: X-Prison from Plugin
[01:35:51 INFO]: WorldGuard from Plugin
[01:35:51 INFO]: X-Prison from Plugin
[01:35:51 INFO]: X-Prison from Plugin
[01:35:51 INFO]: X-Prison from Plugin```
Can I find where from X-Prison the listener comes from?
Updated
public void playerInteract(PlayerInteractEvent event) {
System.out.println("Highest" + event.isCancelled());
event.setCancelled(false);
}
@EventHandler(priority = EventPriority.HIGHEST)
public void playerInteract2(PlayerInteractEvent event) {
System.out.println("Highest" + event.isCancelled());
event.setCancelled(false);
}
@EventHandler(priority = EventPriority.MONITOR)
public void playerInteract3(PlayerInteractEvent event) {
System.out.println("Monitor" + event.isCancelled());
System.out.println(event.isBlockInHand());
System.out.println(event.hasItem());
event.setCancelled(false);
for(RegisteredListener listener : event.getHandlers().getRegisteredListeners()) {
System.out.println(listener.getPlugin().getName() + " from Plugin");
}
}
@EventHandler
public void playerInteract4(PlayerInteractEvent event) {
System.out.println("Normal" + event.isCancelled());
event.setCancelled(false);
}
@EventHandler(priority = EventPriority.LOWEST)
public void playerInteract5(PlayerInteractEvent event) {
System.out.println("Lowest" + event.isCancelled());
event.setCancelled(false);
}
@EventHandler
public void voidodiaod(PlayerItemConsumeEvent event) {
System.out.println("Consumption : " + event.isCancelled());
}```
you can make something really hacky
which is like
extend the event and print the stacktrace whenever setCancelled is set
then cancel the original event and call this modified one
check to prevent recursion
bim bim bam bam
My entire point from this is that something externally was cancelling it, so I wanted to uncancel which still didn't work
So not really an option
If you know that XPrison is the cause, then look at its source code and go through the registered listeners
Did you reexport the plugin to the server?
Yea
and restarted
Yea
Then I dont know grinch came early and its messing with your server xD
That's what I'm saying
So stumped
There's no way to find out the class of a RegisteredListener ?
You could try one more thing
Make sure XPrison loads after your listeners test plugin
It is it's the last loaded
or not? idk if it has an effect.. eh
Does anyone else have any ideas
What do I do with that
I've tried printing the class name of that but it's just RegisteredListener
Hello, so I am trying to create a fake player for 1.20.2 and I am at the point of creating an empty network manager, but even though I gave it an empty channel, I keep getting this: java.lang.NullPointerException: Cannot invoke "net.minecraft.network.EnumProtocol$a.a()" because the return value of "io.netty.util.Attribute.get()" is null does anyone maybe know a possible fix for it? Or has something changed between the way channels are used from 1.20.1 and 1.20.2?
is this way of doing it a good habit?
weird nms icky thing but yes that's perfectly fine
I havent really done it at all
I usually check if something that I grab is instance of what I need specifically
like entity is instance of livingentity
Basically just this
I used that
[01:58:04 INFO]: EssentialsPlayerListener
[01:58:04 INFO]: MVPortalListener
[01:58:04 INFO]: EventAbstractionListener
[01:58:04 INFO]: WorldGuardPlayerListener
[01:58:04 INFO]: PlayerInteractListener```
These are the events, mine is registered last and uncancelling won't do anything
What are you trying to do
Uncancel an event when it's cancelled, yet it's still cancelled
Why are you cancelling it
^
can anyone help
Next to in which way
?jd-s
I was using it, wasnβt for you
Google told me with one search that someone has already asked this question https://www.spigotmc.org/threads/getting-blocks-to-the-right-left.383374/
Or here
@tribal wraith
I don't know where it's cancelled, that's my issue
So I'm trying to undo it in a hacky solution
But that doesn't work either
Did you try to use the plugin i sent you?
Yea
Did u turn listentoallcancellable to true?
ignoreCancelled to false
Itβs like that by default is it not
dont think so
And wonβt really do anything
[02:11:49 INFO]: WorldEditListener @ NORMAL
[02:11:49 INFO]: EssentialsPlayerListener @ NORMAL
[02:11:49 INFO]: MVPortalListener @ NORMAL
[02:11:49 INFO]: EventAbstractionListener @ NORMAL
[02:11:49 INFO]: WorldGuardPlayerListener @ HIGH
[02:11:49 INFO]: PlayerInteractListener @ HIGHEST
[02:11:49 INFO]: DEFAULT Item
[02:11:49 INFO]: false```
My output, it's cancelled, I revert it, it's no longer cancelled but it cancels in game
Is there no other event from right-clicking an item?
What does that mean
Cause that would tell you if another event is cancelled
Itβs a config optiln
In the plugin
Yea it said it wasn't cancelled
Yes, nothing is output
You sure? Cause even your changes would output smth
I'm sure
listen-to-all-cancellable: true # Off by default since this might provide too much information for simple tasks
cancellable-namespaces:
- "org.bukkit" # Contains all default events, got a plugin with events? Add their namespace.
ignore-cancellable: # This will only work if above is set to true
- "org.bukkit.event.player.AsyncPlayerChatEvent" # Example
- "org.bukkit.event.player.PlayerInteractEvent" # Example
- "org.bukkit.event.entity.EntityPickupItemEvent" # Example
exact:
InteractEvent:
class: "org.bukkit.event.player.PlayerInteractEvent"
methods:
- "isCancelled"
Is there any guide to custom animated objects made out of armor stands?
And you tried eating ingame?
latest.log after that please
Sorry Jan it didn't load here's the output
[02:18:04 INFO]: WorldEditListener @ NORMAL
[02:18:04 INFO]: MVPortalListener @ NORMAL
[02:18:04 INFO]: EventAbstractionListener @ NORMAL
[02:18:04 INFO]: EssentialsPlayerListener @ NORMAL
[02:18:04 INFO]: WorldGuardPlayerListener @ HIGH
[02:18:04 INFO]: PlayerInteractListener @ HIGHEST
[02:18:04 INFO]: DEFAULT Item
[02:18:04 INFO]: false
[02:18:04 INFO]: [EventDebugger] EventDebugger START
[02:18:04 INFO]: [EventDebugger] -> Change in event 'PlayerInteractEvent'
[02:18:04 INFO]: [EventDebugger] -> Classpath for listener 'dev.drawethree.xprison.gap.PlayerInteractListener'
[02:18:04 INFO]: [EventDebugger] -> Caused by 'X-Prison'
[02:18:04 INFO]: [EventDebugger] -> 'isCancelled' changed from 'true' to 'false'
[02:18:04 INFO]: [EventDebugger] EventDebugger END```
Still cancelled
And what changed it to true?
I don't know
It should say
It didn't
Upload ur latest log to https://mclo.gs/
Easily paste your Minecraft logs to share and analyse them.
From the log the only listener is the one I'm using to see other listeners
public void playerInteract3(PlayerInteractEvent event) {
System.out.println(event.isCancelled() + " isCancelled()");
event.setCancelled(false);
/**System.out.println("Monitor" + event.isCancelled());
System.out.println(event.isBlockInHand());
System.out.println(event.hasItem());
event.setCancelled(false);*/
for(RegisteredListener listener : event.getHandlers().getRegisteredListeners()) {
System.out.println(listener.getListener().getClass().getSimpleName() + " @ " + listener.getPriority() + "");
}
System.out.println(event.useItemInHand() + " Item");
System.out.println(event.isCancelled());
}```
Same priority & everything
I tried adding setCancelled in the config just like isCancelled but it errored out
Any ideas @rotund ravine ?
Thatβs interesting
Am I out of luck
I was linked this a while ago
Your debugger works nothing else exists
?jd-s
@tribal wraith whatβs the useItemInHand result set to?
System.out.println(event.isCancelled());```
In the method
It's a boolean to see if it's disabled from an item, it's not from the debug
[02:18:51] [Server thread/INFO]: DEFAULT Item
I don't know what's disabling it originally, I just want to uncancel it
But it won't uncancel it
I would just comment out a line at a time until it works
I did
At listeners?
There's no other interact listeners other than the debug listener
I sent the debug listener
Well there is probably other events π€·π½ββοΈ Comment those out too
Other events can't affect a different event type
What else do you have to loose π€·π½ββοΈ
?1.8.8
Letβs blame the mc version
Would love to see a screen recording of the issue @tribal wraith
Check worldguard flags
@tribal wraith this related?
That is it
Bingo
Not around here chap
?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!
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/
many plugin add there custom items. so it can be obtain by /give <P> <PluginName:ItemName>
how can I make this?
I checked google. but didn't found any solution
also I forgot the plugin name so can't check its src
Yes they can
spawnArea = new BoundingBox(getNpcLocation().x(), getNpcLocation().y(), getNpcLocation().z(),
getNpcLocation().x(), getNpcLocation().y(), getNpcLocation().z());
Vector direction = getNpcLocation().getDirection();
spawnArea.expand(direction, 10);
direction.rotateAroundZ(90);
spawnArea.expand(direction, 5);
direction.rotateAroundZ(-180);
spawnArea.expand(direction, 5);
spawnArea.expand(0, -2, 0, 0, 4, 0);
System.out.println(spawnArea.getMax());
System.out.println(spawnArea.getMin());```
it does not put it in the right place
no clue what im doing
but im trying to make a bounding box around a point
and it faces a direction from a location's yaw
that is an amazingly drawn diagram
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
Somewhat
For tilentities sure
But a wellknown trick is to use the chunk pdc and save data that way
this not bukkit api?
??
can someone help with this?
then why i need load dependency
What
Oh
He just packaged the methods to do stuff
https://github.com/mfnalex/CustomBlockData - and why this "bukkit api" exists in some persone github
this is an api from bukkit
or no
It is based solely on bukkit/spigot yes.
He has just provided a library to interact more easily in the way you are trying to
oh ok
jantuck do you know how to help with my issue
I just meant that he uses complex systems for storing data in blocks
Not atm
He uses a reasonable system.
who pinged me in here...
Who knows
figured it out
I'm using the donation-alert-api from GitHub for development. This API receives donation alerts from Twip and Toonation.
tonation and twip are Korean Twitch sponsored platforms.
I've confirmed the correct key integration via a Minecraft command. However, donation test subscriptions aren't working. The system console prints messages, but the Minecraft code is similar.
Here's the code:
import org.bukkit.Bukkit;
import com.outstandingboy.donationalert.platform.Toonation;
import com.outstandingboy.donationalert.entity.Donation;
public class DonationAlertManager {
private Toonation toonation;
public DonationAlertManager() { setupToonation(); }
private void setupToonation() {
try {
toonation = new Toonation("xxxxx");
toonation.subscribeMessage(s -> System.out.println(s));
toonation.subscribeDonation(donation -> {
System.out.println("[Toonation] " + donation.getNickName() + " donated " + donation.getAmount() + " won. Message: " + donation.getComment());
});
} catch (Exception e) { e.printStackTrace(); }
}
}```
Is there an issue with my code? Correct key integration works, but not the subscription. I'm new to Java.
would it be viable to change a player's gamemode based on whether or not they are looking at a player-placed block? (survival if they are, adventure if they are not)
What?
to prevent breaking non-player-placed blocks
i know you can cancel the block break event
Save coords in the config?
i already have the list of player-placed blocks
If you already have the coords, why don't you just cancel the event?
i just want to know if the adventure mode thing is possible
It is
i already cancel event
itemstack to block?
Place it
no other way?
What do you need a block for
mfnalex made it
Link
PersistentDataContainer customBlockData = new CustomBlockData(block, plugin);
Itβs to save data to a block
yes ik
It needs to be in the world
You can use PDC on itemStacks easily
get meta and then pdc..
Yep
how can I compare the itemstack before its placed
Asking about your attempted solution rather than your actual problem
well I'm making a keycard plugin
I need the doors to be for different levels
and have the same persistant data as the keycard
so how can I compare the itemstack before the door is placed
I do not believe this explains the "compare the itemstack before the door is placed"
Seems like 2 different things to me.
wdym
I do not get why you need to compare some itemstack before the door is placed for this plugin.
What itemstack, what data does it hold.
the itemstack will hold the data of what type of keycard door it will be
so I can transfer it with mfnalexes cool api
So.. no comparation needed then, just copying data
Then just copy the data from the itemstack to the block ?
Idk, I'm probably not the best person for this lol. woke up 30 minutes ago
This is a Korean Twitch donation API. Connection works, but I can't subscribe to messages or donations. Any ideas why?
Twip, Toonationμ νμ μλ¦Όμ λ°μμ¬ μ μλ RxJava κΈ°λ° Java API - GitHub - outstanding1301/donation-alert-api: Twip, Toonationμ νμ μλ¦Όμ λ°μμ¬ μ μλ RxJava κΈ°λ° Java API
Check if you have the dependencies that are listed on the botton of that github page
thank you!
I have added all the dependencies, but when I run & debug, this message is displayed.
Connected to the target VM, address: '127.0.0.1:6309', transport: 'socket'
0 test classes found in package '<default package>'
Disconnected from the target VM, address: '127.0.0.1:6309', transport: 'socket'
Process finished with exit code -2
Check this thread out: https://stackoverflow.com/questions/37781970/disconnected-from-the-target-vm-address-127-0-0-162535-transport-socket
Try the solutions they provide
what is https://textures.minecraft.net/texture/ and how can i add my own textures to it ?
By changing your skin
I'm trying to use:
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
but i keep getting an error of:
org.spigotmc:spigot:jar:remapped-mojang:1.20.1-R0.1-SNAPSHOT was not found in https://oss.sonatype.org/content/groups/public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of sonatype has elapsed or updates are forced
If you need to access NMS classes from inside your Spigot plugin, it is a very good idea to use the so called Mojang mappings. Disclaimer: This post is obviously written for 1.18.2. If you use another version, you of course have to replace every occurance of β1.18.2β with the version you actually use. What...
There are services which use dozens of minecraft accounts to constantly upload requested skins to get them
signed by mojang. If you want your own skins to be uploaded then look for such a service. One of them is MineSkin.
However in many cases the skins provided by HeadDatabase are quite proficient.
Items have pdc. Just read the pdc of the itemstack hold it in memory apply the pdc to the block after its placed. The blockplace event should let you get both the itemstack and block
now i just get this:
org.spigotmc:spigot:jar:remapped-mojang:1.20.1-R0.1-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced
Ooo you're a helper now!
Deserved

you need to run the build tools
?bt
W, deserved
i did
java -jar BuildTools.jar --rev 1.20.1 --remapped
when i remove the net md5 thing then it works but
he indeed did deserve it
idk how to fix it
show pom
Yo congratz on getting differently colored name :D
Yup
He's always helpful and kind so he is definitely a helper haha
then I could use some help
I'm sending a PacketPlayOutWindowItems but the player seems to not care about it
does the list have to be full (like my_item, air, air, air)?
because for now I only do: (my_item)
dunno
oh wow, congratulations on becoming a helper. You really deserved it. Even though we haven't talked much here, I've always noticed that you provide detailed replies to others about what to do or improve, and I was actually surprised that you didn't have the helper role yet 
I think not long
Whoβs coll
the big guy just probably woke up one day and made many ppl helpers
Thanks
He definitely deserves a helper
MD contacted me and smile a few days ago
You guys chose trick on trick-or-treat it seems
congratulations to you as well for becoming a helper. Same as with 7smile7, I always saw you active and helping others. Well done! 
We figured it was only fair to turn them into unpaid workers like us 

orage
public class ItemManager {
public static HashMap<Integer, CustomItem> items = new HashMap<>();
public boolean register(CustomItem item){
if(items.get(item.getId()) != null) return false;
items.put(item.getId(), item);
return true;
}
public boolean unRegister(int id){
if(items.get(id) == null) return false;
items.remove(id);
return true;
}
}
any way i can make this code better?
static Map π€?
You may rename it to CustomItemContainer
Instead of
public static HashMap<Integer, CustomItem> items = new HashMap<>();
do:
private HashMap<Integer, CustomItem> items = new HashMap<>();
// Getter etc
i wanted to not have to do PluginName.getInstance().getItemManager() Every Time
so why not all other method static either
Accessing a static variable with non static methods like this is kinda yikes
Then do not do an instance
And use dependency injection
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Why you need entire class if you just use map instead?
i noticed that rn and fixed it
Structural Programming, Clean Code
and making the code scale easier
private ItemStack createCustomMap(BufferedImage image) {
MapView mapView = Bukkit.createMap(Bukkit.getWorlds().get(0));
mapView.setScale(MapView.Scale.NORMAL);
mapView.addRenderer(new MapRenderer() {
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
canvas.drawText(0, 0, new MapFont(), "pula sa imi bag");
}
});
ItemStack mapItem = new ItemStack(Material.FILLED_MAP, 1);
mapItem.setDurability((short) mapView.getId());
return mapItem;
}``` I tried this to get a custom map as itemstack, but it does not work, why?
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
I expect getting an itemstack with a filled map with that text
I expected it with an image, but now I'm lowering my expectations π
I mean, how can I do it happen?
Found a resource https://www.spigotmc.org/threads/tutorial-maps.136533/, try using
mapCanvas.drawText(0, 0, MinecraftFont.Font, ...); instead
this is more used when you have an uninitialized map, but I want to give someone an initializated map
aww you became a helper before I did π¦
Congrats on the new title regardless though lol
same to you @young knoll
this works, thanks
I helped
Where is my Helper role ? :D
thanks y'all β€οΈ
how can i set an item to the player's hotbar?
thanks
Pro tip, for viewing commands do ?cc list in trivia
ooh ty, didn't know
i try use - https://github.com/mfnalex/CustomBlockData but java.lang.NoClassDefFoundError: com/jeff_media/customblockdata/CustomBlockData - maven -> https://paste.md-5.net/itehebilaw.xml.
why this so
i think all load good
<shadedPattern>your.package.name.customblockdata</shadedPattern>
You forgot to actually fill in your package lol
shouldn't be the issue though, are you using the right jar?
ye, not the issue but still, it is incorrect
i shold paste path to main class?
