#help-development
1 messages · Page 1247 of 1
default L, but I don't think there's an event for that
What about mod
A client mod can do anything
I mean, you could do the flying by looking part really, you'd just push the player
the thing you wouldn't be able to do is bind the action to a specific key like G, but you could bind it to one or multiple actions like crouching and swapping hands or something of the like
would not look good, ping exists
What about double jump?
if they do it at normal flying speed it should be fine
whatever works for you
Normally double jump is done by allowing the player to fly and using the toggle flight event
Disable flying, yeet the player, re-enable flying when they land
Can you not use the PlayerInputEvent now ? (would require you to detect double jump yourself)
would avoid the temporary flight due to lag
Yeah you could
What about the Black hotbar with cooldown and countdown
resource pack
Font magic
Yay font magic
it is just a resource pack there I believe, no font magic
It would not detect the power activated i think so
that is font magic
isn't that just adding a specific font
but it is on the same place as action bar no?
TLDR: custom font (font magic) and action bar
Yeah but yall forgot about the cooldown
You gotta do that yourself buddy
a cooldown is a cooldown, it's a pretty self-explanatory concept
Oh wait i think how
There's no magical "show cooldown above hotbar with specific font" function in the API
API so lacking smh
my game engine has this
I think i should switch to mods
not neccessarily easier
mods mean every client would need it to join your server
Yeah i am gonna shoot myself into space
Ur a nerd
no u
that's like 10 methods
I need a single method that does exactly what I want
why do API makers not think about me!!!
should've put a seizure warning
What was that on tick 390
that text movement made me dizzy
Don't think I didn't see it
I honestly have zero clue
0/10 unusable
rad now implement built-in reduced movement mode for accessiblity™️
otherwise unusable
yeah but OSes usually force it down your throat as long as you have the option enabled
the reduced motion would be up to the end user to implement
because I'm not forcing that impl
Imagine just adding a 10 tick delay to every frame
and having the option enabled by default
would drive some people insane
literal 2fps
there is not
it looks so horrible as well
I'm rendering it on every client tick end btw
instead of increasing the speed
why not slow it down
like move it slowly so it doesn't hurt the eyes
no, this is slow enough
oh this is just static 
well, somewhat at least
sine wave moment
I wanna try something that I haven't actually tried yet, what if I just never return redraw
okay it will be rendered once
the nice thing about my system is that you can just add multiple render layers and they will just stack: ```kt
public val OtherLayer: RenderLayer = buildRenderLayer {
add {
content(-50) {
append("bye, world!")
font(Fonts.BeaverOffsets[-10.0]!!)
}
}
}
player.addRenderable(testRenderLayer(Bukkit.getCurrentTick()))
delay(1.seconds)
player.addRenderable(OtherLayer)
wait what you can have more than one line of text on that???
im stealing this
how does this work internally anyway?
font magic
does it require a resource pack?
yes
is it open src ?
nic
how do I hide a player from the tab list?
I tried doing player.setPlayerListName(null); but it still shows up.
on spigot you'd have to use packets
how do i access packets?
on <unnamed fork> you have Player#unlistPlayer
either NMS, packetevents or protocollib
?nms
what is the fork?

ah.
I have never used NMS. This might be the first time.
I did use build tools to install the appropriate minecraft version with the command in that post.
plugins {
id 'java'
id "io.github.patrick.remapper" version "1.4.2"
}
repositories {
mavenCentral()
maven {
name = "spigotmc-repo"
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
mavenLocal()
}
tasks {
remap {
version.set("1.21.1")
}
}```
does this look right?
java -jar BuildTools.jar --rev 1.21.1 --remapped
pause```
./gradlew.bat remap
I don't see anything though, when I hit shift twice and search for an NMS class like CraftPlayer.
I think you still have to add the dependency, idk tho, never used that plugin
Can i ask anyone if it will work in dm.cuz it wont fit
?paste
?paste
also, you asked no question
?paste
to send long messages
It still was bigger
Im gonna send it normall cuz its way big
Then the normal text
DangerWarning:
colouredName: <red><b>Danger Warning
description: Click to activate & sense nearby enemy players.
skin:
value: eyJ0aW1lc3RhbXAiOjE0OTk5MjM1MTUzOTEsInByb2ZpbGVJZCI6IjQzYTgzNzNkNjQyOTQ1MTBhOWFhYjMwZjViM2NlYmIzIiwicHJvZmlsZU5hbWUiOiJTa3VsbENsaWVudFNraW42Iiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS9iNWE1M2E0NGZkN2JjNGI0ZDdiYTI2Yzc0ODQ4YjVlNDQzODkyNWNmM2Q4YzdiNGI4ZDQzMTFlOGI2ZmEifX19
signature: KsSv8po6QPyiJ5GsRSXxtX8G9riMnUc0/M7HFICxOp6jMXwyy7XzOokjt5McwtKimmi0gX8a11QdBI8FOYEh8OpD6g6oR9537INdANP0rIMT5CX3gOT73ko6z9vDuv9EUp2S2iqKIi1LZOIVwtG0Jsy9TBPk/YBnEAXkpskPbdjFm3SgnLJaolOYsven+j+Aeuthf7H0y0xwysgwg8c6HmXy9Li9A2k3EtGKrd+kOrAt2fyurTlOls4Kc5QDz+n8TMZBpmyD/2AhM0E5n0PsVWqp2eDkHyG7fWUIZuIMFkupho5Q3Ys0RpHMx2tEnoeyUmI9kGOy1ZTRYfvodbHVdjVw9KVBU9QyWVrjxeb62HqE7SuDWz9NwdHP5I+Uv9Xph++YdI5Ka2o3KACcEojnWUdx7r2p2nDrk1T+GqPQprsnCFsQDP9XLG7TsexTFDmRi4ZrkPjA2j7g+tz9MxqggrXVz0fw8CxhANsJ/E0XhfkhZXSIZqKQX26aQlwUbetn9ZooSObNJOp6o/GN+k7y9jYnuIIUVrIvlJfYyzYJcuca3LiIzWU0r0bd4H0ZU4yDQeGmyFGNm9FUeQbAhqUAco0kyMBsSIgqSyNBhodGcymGzcGXouscj/zPcURCy4nECmp9zOxtaqpENdiFVxxnmA93gMpI2ICKZQcGyjpFqYw=
skills:
dangerSense:
skill: CUSTOM
trigger:
type: RIGHT_CLICK # The player must activate it manually.
conditions:
cooldown:
type: COOLDOWN
mode: SELF
cooldown: 300 # 5-minute cooldown (300 seconds).
effects:
detectEnemy:
type: ENTITY
mode: OTHER
entityTypes:
- PLAYER
radius: 15 # Detects enemy players in a 15-block range.
glow:
type: GLOW
mode: OTHER
duration: 5 # Enemy player glows for 5 seconds.
warning:
type: TITLE
mode: SELF
title: "&cEnemy Player Detected!"
subtitle: "&7Stay alert!"
fadeIn: 5
stay: 40
fadeOut: 10
sound:
type: SOUND
mode: SELF
sound: ENTITY_ENDERMAN_SCREAM
volume: 1
pitch: 1
actionBar:
type: ACTIONBAR
mode: SELF
message: "&4⚠ Enemy Nearby! Stay Ready!"
Try asking an actual question as I'm sure you are in the wrong channel
Its help development
Yeah
Somthing like that
I want it to be for one guy who asked about this thing almost same but else powers
Oh
you need to get help from whatever plugin you are trying to configure
Then sorry wrong channel
is there any way to replace this word in every class I have?
Notepad++ search replace in files
what?
wait like listen
basically I got a lot of classes from my old plugin
that didnt work and I copiedd most of it
and the paths are wrong
so can I replce this specific word
then refactor
with a different one? with few clicks?
ok hgow.
[15:01:56 ERROR]: Could not load 'plugins/ClansAndConquests-1.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.19
at org.bukkit.craftbukkit.v1_16_R1.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:290) ~[patched_1.16.1.jar:git-Paper-138]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133) ~[patched_1.16.1.jar:git-Paper-138]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:397) ~[patched_1.16.1.jar:git-Paper-138]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:305) ~[patched_1.16.1.jar:git-Paper-138]
at org.bukkit.craftbukkit.v1_16_R1.CraftServer.loadPlugins(CraftServer.java:388) ~[patched_1.16.1.jar:git-Paper-138]
at net.minecraft.server.v1_16_R1.DedicatedServer.init(DedicatedServer.java:208) ~[patched_1.16.1.jar:git-Paper-138]
at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:941) ~[patched_1.16.1.jar:git-Paper-138]
at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.1.jar:git-Paper-138]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_432]
could not load plugins clans of conquest in folder plugins "unsupported api version 1.19"
you are running on 1.16 so change teh API version in your plugin.yml to 1.16
I found it just now
its ctrl + shift + r
to replace stuff
refactor replacing references
or use a simple text editor like NP++ and replaceAll
[15:06:26 ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'ClansAndConquests-1.0.jar' in folder 'plugins'
ctrl shift r
.
.
[15:06:26 ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'ClansAndConquests-1.0.jar' in folder 'plugins'
someone know y?|
not from just that
Still couldn't fix, I installed bungeecord according to the wiki
you've seen that error before when you wrote your other plugin
Did you read that error
A plugin written for 1.19 will not run on a 1.16 server
there is no config.yml in that plugin jar
I don't want to dissuade you from making plugins, but if you're having recurring issues of various bits and pieces of your plugin not being exported correctly (your main class, your plugin.yml, your config.yml), you should maybe do some research and experimenting with your build system or export process to make sure you have these components every single time you export
Your build system is the one tool with which you should be most familiar because without it you don't have a plugin to use
how can i spawn a warden and immediately trigger the despawn animation (with code)?
Is there a core shaders tutorial?
Why does a google search return better videos on that than a youtube search?
The mystery prevails
because people don't make video tutorials about everything
core shaders are a very advanced topic, you're required to read a lot and know maths
heys
I'm gonna do my best at skidding code and asking AI bots then
do you not know how to read
I do not know how to think
then do something else
gonna learn this
i do not know how to think
my prediction is that you are not going to learn it :kekw:
average rendering experience
Always learned like this
that doesn't sound like learning
hm seems weird
ask chatgpt to fix it
even weirder
use other llm
repeat
Actually experiencing things rather than just reading theory works better for me
Read theory
See in action
No theory?
Random values, go
crazy idea, but what if you read the "theory" on how things actually work so you know what to expect, and then play around so you know what to make and how to make it?
What I was going for
I'm not good with words
incorporating knowledge
What's the easiest way to add a plugin prefix to all console messages?
Use the plugin logger and not sys out
Bcs right now I'm using "[" + this.getClass().getSimpleName() + "] " which seems dumb to me
Oh ok I'll check it out!
this.getLogger().log(...) ?
what is love, baby dont hurt me
how of you can give me the packet mapping of 1.17.1?
?mappings
Compare different mappings with this website: https://mappings.dev/
no no, the list of the packets
oh shit they changed the slug now, it's just JE protocol
@young knoll time to fix ?protocol
Oh it got merged now? Finally lol
HELL YEAH NEW MINECRAFT ANIMATION
?protocol
yes, is it, but i dont find the type of the player metadata
so check the entity metadata page for july 2021
^^
im having a real hard time understanding on what to actually do, i understand i need to connect to the tcp port ive done that
start a handshake so send the
handshake packet, what is it actually that i need to send?
packet format
varint with the length, "Length of Packet ID + Data", so this would be amount of bytes? bits?
varint with protocol id so 769? since 1.21.4
byte[] with the handshake stuff?
varint with the version number
string with the ip
unsigned short with the port
VarInt Enum (so 1/2/3?) what would i chose? currently i just want to check if the server is alive
this is in c# btw
- You linked to the page explaining what to send?
- Yes, bytes
- No, not the version id. They're talking about a different id from the protocol report. See the link it refers to
- Yes, the rest of the data for the packet you want to send
- Status is fine
just asking for clarification D:
I wasn't trying to sound rude, but I guess it did come off that way
Sorry about that
wooow im gonna cry myself to sleep tonight so hard ):
ty for your time tho
so protocol id would be 0x00?
yes
hi!
I am having some problems with PlayerInfo packet. I am trying to listen for a playerInfo packet being sent to the client of the ADD_PLAYER type. But it seems to be returning null.
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
i was about to send that
?paste
@Override
public void onPacketSending(PacketEvent event) {
var packet = event.getPacket();
var action = packet.getPlayerInfoAction().read(0);
if (action != EnumWrappers.PlayerInfoAction.ADD_PLAYER) {
return;
}
event.getPlayer().sendMessage("test!!!!!");
var playerAddedUUID = packet.getUUIDs().read(0);
var playerAdded = Bukkit.getPlayer(playerAddedUUID);
if (hasEffect(playerAdded)) {
event.setCancelled(true);
}
}```
yeah, I was looking through the stack trace and was getting that alongside the code. Sorry for the wait.
send the stacktrace as well
Also I have a feeling that's not the right format of the packet
?paste
I am trying to listen for a player being added to the tab list.
oh. How do I get that out? I've not really messed with packets much before.
Should be a getter for them
okay, I will try something with that.
wait, does this packet send more than one action at a time?
yes
Well one action multiple players
Looks like it can be multiple actions as well but they all apply to every player in the list
@Override
public void onPacketSending(PacketEvent event) {
var packet = event.getPacket();
var actionsList = packet.getPlayerInfoActions().read(0);
event.getPlayer().sendMessage("{");
actionsList.forEach(action -> {
event.getPlayer().sendMessage(action.name());
});
event.getPlayer().sendMessage("}\n");
}```
wait I am confused.
And that looks complex too, the screenshot I sent.
So, I am just running it on one test server with only my account being online.
The only way for it to have sent so many at the same time is if they all applied to me.
Yeah
oh my it includes a lot of important things, like initialising chat, player's gamemode, display name, etc.
yes
But I just wanna get rid of the ADD_PLAYER event, but if I simply do event.setCancelled(); all the rest gets lost too.
I only need them to not show up in the tab list.
which would mean I have to get all the events besides ADD_PLAYER, put them in a new packet and send it?
or wait, the actions collection is a Set. So, I could just get rid of the ADD_PLAYER from the collection and that should be it, right?
No
Remove the player from the player data info list
Only cancel if it's then empty
Otherwise you'll mess things up for other players
oh ok.
@Override
public void onPacketSending(PacketEvent event) {
var packet = event.getPacket();
var actionsSet = packet.getPlayerInfoActions().read(0);
if (!actionsSet.contains(EnumWrappers.PlayerInfoAction.ADD_PLAYER)) {
return;
}
var playersAdded = packet.getPlayerInfoDataLists().read(0);
playersAdded.forEach(playerAdded -> {
var bukkitPlayer = Bukkit.getPlayer(playerAdded.getProfileId());
if (hasEffect(bukkitPlayer)) {
actionsSet.remove(EnumWrappers.PlayerInfoAction.ADD_PLAYER);
}
});
}```
does this look right?
java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.wrappers.PlayerInfoData.getProfileId()" because "playerAdded" is null
okay, I am not even sure why that list contains null objects.
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
this.saveResource("myfile.yml", false);
}
}
That's all. Then just have a file called myfile.yml in your project's resources directory
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
this.saveResource("config.yml", false);
this.saveDefaultConfig();
}
}
The above two methods function similarly (not quite the same, but the way it saves files is the same)
InventoryDragEvent is this right?
What would be the best event to detect when a player puts an item into an inventory, InventoryClickEvent?
Yes
You need to listen to both the click and drag events
i want to disable drag anyway so
i think this is ok
ill try
sendMessage { color("taking an item") }
confusion
what the hell does color("message") do
i usually use sendMessage()
make the & and &#hex logic
components in shambles
actually yes
just in case someone use &
i should implement a check that if someone uses & in the input
Not everyone uses minimessages, that's why I put it
done
Is it ok if I ask a question about AdventureAPI
HELP
I am currently trying to create a custom atlas using the minecraft font and the plugin that I'm refrencing to is using AdventureAPI's Component.font(key) to get a Key type and somehow use it to create a custom atlas like this... Can someone help me?
you need to create a font
oh....
yea you need to create a resource pack with font and then use that font
I'd suggest https://github.com/radstevee/packed
Oh I mean
.
like the image
im making a plugin
that creates the atlas for a resourcepack
btw how do I load the mc font?
so I want to create
an atlas using the minecraft font
so I have to fetch the mc font
and use it to create a bitmap image
and save it as a png for the resource pack
but I don't know how to obtain the font file
You write it or you can generate it using packed
I found a plugin somehow using Component.text's .font(key) method
#font just takes in the resource location of the font
uh, does anybody know how the player_info_update packet works? I just got back to looking at it, and I am still legitimately lost about what the heck it is doing.
I have this collection I am maintaining of players that should not appear in the tab list. So, when one of them joins, I am going to listen for the ADD_PLAYER event and cancel if it contains a player within the collection. But the problem is, it contains several actions and players, and I am not sure how any of that works.
Did u look at the protocol?
Hi, i'm trying to retrieve a player's netty channel in multiple versions, do someone know a good way to get the fields or the methods to get it ?
?xy
it seam to get the server's channel and not the player
look at how packetevents does it then ig
?? didn't understand sorry, the thing is I achieved to get want i wanted working in 1.18, but the methods are not the same between version. return ((CraftPlayer) player).getHandle().b.a.m;
right now I have not proper method other than testing every method to find the right one atm.
?mappings
Compare different mappings with this website: https://mappings.dev/
?xy
Hi I don't know why my event doesn't reach "test1". The fire block is not recognized.
print the block type before the condition
okay
[00:59:03 INFO]: CraftBlock{chunk=CraftChunk{x=11z=9},x=181,y=75,z=152,type=AIR,data=0}
but this is the fire block
is there a reason you aren't just using BlockIgniteEvent#getIgnitingBlock
Yes, because it gets the reason for installing the block
hm? Aren't you trying to get the FIRE block?
Yes
well, that'd be the igniting block
shameless promo
Hello, I am currently trying to detect if a player is pressing left click without letting it go using nms by accessing ServerGamePacketListenerImpl and I did access it though but I don't know where to find the left click boolean...
Is there a document for nms?
for nms, no, but for the protocol yes
why not just getItemInUse() API method?
oh that's right click
I dont think there's anything in the protocol for "keep pressing left"
there's a blockdamaged event or something iirc that fires when you dig blocks
but that's also the only case in which the client reports "keep pressing left"; doing it on air or on entities will just send one interact packet telling the server that something was left clicked
are you the guy who was trying to make a gun plugin where you shoot by holding down left click?
is EntityShootBowEvent#getConsumable just the arrow
Yes
yes
I am
As mentioned the client won't send that information
So you'd need to use something like a block they can break
can't you just put an interact entity in front of them at all times
that only works for right click
does Interaction#getLastAttack not return the last left click on the Interaction?
sure, but there's no way to know whether the button is still being held
the client will only send one attack per you pressing the button down
if they're holding left click and there's an entity in front of them, they'd keep attacking it until they stop holding
now you'd only have to deal with the fact that the hitting animation would continuously play while you are holding, probably something fixeable with a resource pack or something
no, that's not how it works
each click is one attack; holding left click doesn't auto-attack
how you describe it is how it works for right clicks, which is why it was noted that the interaction entity trick only works for right clicks
wait the client doesn't send if they are pressing a button?
yes, as we told you last time, it doesn't
with the sole exception of when you mine blocks
and i suppose the input packet now communicates wasd/jump/sneak button presses
but no such thing for lmb or rmb
ok...
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
sup rad
hi illusion
speaking of servers when was the last time you saw something recent of mine 👀
I always wonder how people do not know better than to crosspost
a while ago probably
down to hop on vc and have me violate another nda?
like, unless they're really young, they must have been told in a discord server before
give me like 10 minutes i just woke up
ight
What's the exact difference between the Default Config File and the Custom Config File? Bcs from what I've read you can set and get properties with either of them?
default config is just the config.yml inside your plugin's folder
and a custom config would be anything else
there is no intrinsic difference, the default config file is just a convenience thing
the only difference is that default config has the convenience methods for saving and getting
beat me to it
the other convenience thing about it is that the embedded config.yml resource in the jar is automatically used as config defaults
though usually this causes more issues than convenience
So I can also just use the default config?
if you want, yes
i.e. "i fucking removed this config line, why does it say it's still there" because it's being pulled from the defaults
Alr ty guys
I wish someone made a Cloud vs CommandAPI comparison
So when I add smth new to the config, do I use saveConfig or always saveDefaultConfig?
I suppose the 2nd one?
saveconfig will overwrite any changes made to the file, you generally don't want to use it
savedefaultconfig checks if the file exists and extract the default config from the jar if it doesn't; it also loads the existing config if present
Alr, so basically my code should look like this (for example)
parkour.getConfig().set("parkour-name", name)
parkour.saveDefaultConfig();
Am I right?
well, that wiki explains everything you should have to know about configs
Yeah but there it uses saveConfig() and vcs just said that you don't want to use it
well, it depends on what you use the configuration for
if you set values at runtime, you'd ultimately have to use saveConfig
Storing parkour names, start / end block locations
And time scores of the parkour run
that sounds like setting values at runtime
saveDefaultConfig won't write to the file once it's already in your plugin's folder, aka it will only write once
saveConfig will write every time you call it, regardless of whether there are changes or not
Oh ok, so I just need to run saveDefaultConfig when starting my plugin, but all the other times I need saveConfig
When adding new properties to the config
yes, but be aware that using saveConfig essentially makes the configuration well, not "manually configurable"
Yea yea that's ok, I don't want to users to modify the config manually, only using commands
unless you make sure to read the values whoever edited the file before calling saveConfig
that should be good then
Amazing that's very clear, thank you!
worst design choice on this earth btw
or no that's not right
there's one thing that'd be worse; editable only via an ingame chest gui
i will PERSONALLY set fire to your entire city if you do this
I mean, locations aren't something you want to manually input anyway
Yea exactly xp
Would be weird if people would manually change locations
Easier to use /parkour setspawn for example
setting locations is fine, but editing e.g. strings or numbers via commands or a gui is absolute ass
that I can agree
even with the anvil GUI or chat, it is just ass to not be able to edit them in bulk if necessary
It's my first time working with configs tbf, I'm well known with Java, but Spigot is like pretty new for me (my first week rn)
So I don't rlly know how to work with configs that are manually editable yet
I've made a working warp plugin, home plugin, basic craft gui plugin, and trying to make a simple parkour plugin rn
Just for learning and experiencing
that's good, you'll eventually get the hang of it if you keep playing around with the API
But I don't think the Spigot page handles manual config editing, correct me if I'm wrong tho
Yes indeed!
that wiki I sent doesn't explicitly mention it, but all you have to do is read the configuration before writing to it
I suppose I'll also need to add a /reload command then after someone manually edits it?
like /parkour reload
yeah, which would essentially just call reloadConfig
I understand alr, thanks :)
in a gui, how should i keep track of actions(Consumer<InventoryClickEvent>) assigned to itemstacks? Should i use pdc for identifying them?
you mean you have an abstraction which builds items and places a consumer action on them, and now you're trying to figure out how to identify these built items in the actual event? If so, yes, PDC should work
exactly. thanks
just not rlly ideal to modify the items if someone would maybe want to give the item to the player on click
not my problem tho 🤷♂️
I mean, you provide the inventory click event itself on the consumer so they may as well match the item themselves at that point
as of rn im not offering that lower abstraction
is it rlly needed?
eh ig i should
btw where should i register the inventoryclick listener
i was going to use one listener object for each gui object, and just register it with a static plugin variable in the constructor
I mean, I can't answer those questions for you, it all depends on how you want to use your abstraction
Hi, I'm doing a fire propagation system except that it doesn't work, the fire block check doesn't work
https://pastebin.com/cfBs11u0
best option is just to attribute each consumer to a slot index
if you want it to a specific itemstack that may move around just use pdc with a uuid
Hey I want to change version of my plugin but I'm getting an error
Hello, is there an event for when two dropped items combine ?
declaration: package: org.bukkit.event.entity, class: ItemMergeEvent
okay thanks 😄
from version 1.21 to 1.20.1
did you reload maven
If reloading maven didn't give any errors
invalidate caches
(under the File dropdown)
also make sure you have a Java 21 jdk
and make sure you have the repo added
actually I've made something that I don't know what and I don't have the error but the plugin doesn't work.
I'm just trying if it works on 1.21 ( the original version of project )
make sure the command is added to your plugin.yml
yeah it is
for now I don't have any errors about my plugin on 1.21
bruh, I don't know if thats paper error or mine
?whereami
Well, technically you can use spigot plugins unless you use API added by spigot after December (paper hardforked there)
the whereami is more of a "if this is a paper bug, ask paper"
I'm learning for now java and also spigot development, I've tried to make own GUI ala-library
in a one script
Well if you wanna do spigot development, then you ought to also run spigot I think
yeah i'm doing that
I mean I'm changing
but I need a help with my code, ```java
package org.Cheeseserowy.pluginCheese.Commands;
import org.Cheeseserowy.pluginCheese.Listeners.GUI;
import org.Cheeseserowy.pluginCheese.Objects.Utility;
import org.bukkit.Bukkit;
import org.bukkit.Sound;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryOpenEvent;
import org.bukkit.inventory.Inventory;
public class Piano extends GUI implements CommandExecutor, GUI.inventoryHandler {
@Override
public void onClick(InventoryClickEvent event) {
int slot = event.getSlot();
Player player = (Player) event.getWhoClicked();
float pitch = 0.5f + slot * 0.1f;
player.playSound(player.getEyeLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1f, pitch);
}
@Override
public void onOpen(InventoryOpenEvent event) {
Player player = (Player) event.getPlayer();
player.sendMessage(Utility.convertColors("&aPomyślnie otworzyłeś pianino."));
}
@Override
public void onClose(InventoryCloseEvent event) {
Player player = (Player) event.getPlayer();
player.sendMessage(Utility.convertColors("&cPomyślnie zamknełeś pianino."));
}
@Override
public boolean onCommand(CommandSender sender, Command command, String s, String[] strings) {
if (sender instanceof Player) {
Piano piano = new Piano();
Inventory inv = Bukkit.createInventory(null, 9, Utility.convertColors("&aPianino"));
this.registerInventory(inv, piano);
((Player) sender).openInventory(inv);
}
return false;
}
}
I don't know why it doesn't override onClick, onOpen and onClose event
I mean, it is overriding them
but they aren't annotated as @EventHandler nor the class is marked as Listener so that wouldn't work
Ig if GUI.inventoryHandler (use UpperCamelCase for class names pretty please) implements Listener then the last part doesn't matter
okay
oh nvm I didn't read the attachment
but you are overriding the wrong things
I think you meant to override the handle methods but you ended up overriding the event handlers
I am honestly not sure what that interface is for tbh
I want to make own library for GUI, like the
?gui
ah, I get it now, that's the design in that one spigot tutorial
was about to say, yeah
But I'm trying to make it in one class
why though
Idk
thx
oh no wait I did
should I for the piano too? but it isn't a Listener
@Override
public void onEnable() {
GUI gui = new GUI();
Bukkit.getPluginManager().registerEvents(gui, this);
getCommand("piano").setExecutor(new Piano());
}
you aren't registering Piano anywhere
you need to use your GUI#registerInventory method
piano is registered as a command class
yes but Piano is also a inventoryHandler
this is why you'd prefer different classes for it, mixing up responsibilities like that just makes things confusing
your current code will open a shared gui for all players who execute the command i think
no I don't think so
ur only calling "new Piano()" once
nah, they instantiate a new object on the command handler
nvm
it holds unncessary command handler information but welp
everything looks fine honestly, not sure where the issue is
that will be good?
ah wait, I see where the issue is now
I've just made that class
and I'm going to fix the errors
your Piano class is extending GUI
yeah
but you aren't registering Piano as a listener
your inheritance tree is really messed up, I'd recommend separating those into different classes
yeah but this tutorial is not logic for me, I don't even know what I should seperate
well, the command logic from the inventory logic
and your Piano class shouldn't extend GUI but pass a GUI object onto it via dependency injection (aka passing it as a parameter in your constructor)
Who still creates 1.8.x plugins here
Hello
why the hell java is so hard
It lifts
Hmm don't know why my skull item textures randomly disappear
Don't know if it's because of serializing the inventory or the nbttag list
Anyone have a clue what's going on?
GUI.java
public class GUI implements Listener {
public interface InventoryHandler { // UpperCamelCase!!
public void onClick(InventoryClickEvent event);
public void onOpen(InventoryOpenEvent event);
public void onClose(InventoryCloseEvent event);
}
// ... rest of the logic is fine
Piano.java
public class Piano implements CommandExecutor {
private final GUI guiManager;
public Piano(GUI guiManager) {
this.guiManager = guiManager;
}
private class PianoGUI implements GUI.InventoryHandler {
// inventory logic here
public static PianoGUI open(Player target) {
target.openInventory(MenuType.GENERIC_9x6.create(target, Utility.convertColors("&aPianino"))); // you could do something with the view here
return new PianoGUI();
}
}
@Override
public void onCommand(...) {
if (sender instanceof Player player) {
guiManager.registerInventory(PianoGUI.open(player));
return true;
}
return false;
}
main class:
@Override
public void onEnable() {
GUI gui = new GUI();
Bukkit.getPluginManager().registerEvents(gui, this);
getCommand("piano").setExecutor(new Piano(gui));
}
that's essentially how you do it
it isn't complete but it serves you as example
i think you meant PascalCase
UpperCamelCase is just another name for PascalCase
a worse name
where should i register guis? I have a gui registry and a guiListeners class that calls the overriden functions in the guis from guiregistry
I mean do they need to be registered anywhere?
If you're talking about the events you could just track it once it opens
then how would i make that?
do one method that opens it and registers it?
so like
Gui gui = new PianoGui()
guiRegistry.register(gui);
player.openInventory(gui.getInventory())?
and registry over DI
I'd just make an opening method
static
But why do you need a GUI registry?
events
Well that's not what you use a registry for
You're talking about some kind of manager or tracker
yea tracker ig
something thatlets me call all Gui#onClick of the clicked inventory's gui
uh
reload gradle
ah yeah works
what if i use hashcodes?
you get a new ItemStack instance every time you use a get method either on the inventory or the event
just use slots like someone suggested here
sure?
I mean like
75.13.32.23:678 type of ip
what
uh what
how is IP related to that
wha
what I mean is that it it's not a letter name
??
Yes you don't need a domain
Do note that ssl is kinda annoying for plain ips
why is that?
is it not possible to make it secure?
Well, you need to find a certificate auth that cares to issue you a cert for a bare ip
lets encrypt iirc does not
will normal clients not connect to websites without a certificate?
depends on what you consider a normal client
typical browser
You can visit a website with http
Yea
uh lets say, chrome
It doesn't need to be secure nor https
and for it to be https, I can't just encrypt it, right?
You should really register a domain. There are free ones all over the place like freenom or no-ip
for it to be https you need an tls certificate from an authority like lets encrypt
So if you wanna use https, find a tls cert authority that issues tls certs to bare ip addresses
It just isn't as common given that ips can change a lot more often than domains do.
and get ready for that to cost more than just getting a domain
(domains are literally like, less than a dollar at some providers)
you can get free domains i think from freenom
do they have APIs for that?
Why do you need an API?
You can always issue your own certs with something like OpenSSL, but getting them set up correctly is pretty much an industry secret
???
for what purpose
Then let the users handle that part
I just might, yeah
yeah and good luck having people entering your website with a self-signed cert through a normal web browser
Hey I'm the developer of a ChestLocker plugin. I'm fighting this issue atm: https://github.com/earomc/chestlocker/issues/5
My problem is, that I rely on the API in the Lockable interface. The setLock(String) method was deprecated in newer Spigot versions. Not only is it deprecated, it seems to not work correctly anymore. The new alternative is an experimental API "setLockItem" which takes in an ItemStack. However my plugin checks which String / which password locked the container. But there is no alternative "getLockItem" method. Assuming it is still in development I thought of another approach:
Setting the chest's NBT data manually. However I don't know how to do that.
So I have two questions:
- How do I set NBT data manually?
- Where can I track the progress of the Lockable API so I can adapt my plugin to that as soon that is released.
My friends, I am having a terrible issue as I did not perform a back before I did this and locked my precious metals without testing the unlock first. I created the sword with my password "123...
I would probably just move over to PDC here
I am pretty sure that you need to use NMS to set NBT Data manually... Like lynxplay said, PDC might be the best solution
What ? Self signed/Signed with your own CA is not really hard to do. The issue with it is that it will not be trusted by browser by default
Yeah I meant setting it up correctly with the proper cert chain, links to parent certs etc. so that your cert ends up being trusted and doesn't throw browser errors
I'm not sure if Extended Verification is still a thing (gave a green background in the SSL bar). You used to have to link to a Certificate Revocation List, but anyone could edit the cert to link to an empty file (no revoked certificates) and bypass if the issuer had indeed revoked their cert.
I'd just enforce people to use a reverse proxy
if you can enforce people to do things, then it doesn't matter whether you have a cert or not
but a self-signed cert for some random IP is never going to get accepted by any certificate authority known to man
yooo so I don't know if anyone has answers regarding this or even remembers this plugin but anyone remember
EASYNICK
I just looked it up to try and find it I found all the stuff from 3 years ago and a LINK from spigot saying "EasyNick is malware" can anyone explain what the HAPPEND TO it and why and WHAT Malware BECAUSE I am like freaking out a lil because I HAD THAT Plugin in use IN THE PAST LIKE YEAH
THE only THING I found was a GITHUB repository BUT THAT ONE is archived. THERE is ALSO AN EASYNICK plugin ON SPIGOT, it seems to be in GERAMN THO
IS GERMAN allowd on the spigot MC MARKETPLACE
I Would HOPE it is ALLOWED
hello, could someone help me make a ghost block visible to only 1 player using protocollib, it'd be falling block, i just dont know how to strat, and then if someone could tell me how to teleport it to coordinates
i'd be really grateful
i just tried and i have no idea
I don't understand what you want.
Do you want a block or the falling block entity ?
falling block entity
like a preview of a structure what is about to be placed
like you know in rust
i just dont understand protocollib
What version are you on ?
Great, use block display entity
will i be able to highlight it?
why not falling_block?
With glowing ?
idk what you mean by "border"
yea glowing
I mean, try that. I do not know.
And I suggest block display as those are the most performant thing you can use
it won't be collideable?
It's a technical entity, used purely for visuals
so no
My approach would be to make all block displays ride just one entity. You can then move only this entity however you want.
You can probably use something like Player#hideEntity for the "visible to only one player" part
yea i see it on yt now
but like i'd need 5x5 for example
of what
25 is the answer
no, you have one root entity
you make all the displays ride that single entity
then for each of those entities, you change the transformation matrix (translate part) so the block is visually in the correct place
hm
Might wanna play with the visual box value (or whatever it's called) so you can ensure you can see all of them
i need protocollib for this?
All of what I said is possible with the Spigot API
alright thanks
@smoky anchor check dms pls
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 you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
?paste
well I can't help with that
And I do not provide help in DMs unless you ask before and I agree
i asked
you didnt agreed
:/
No you didn't, you just DMd me out of nowhere
But in any case, if I understood your issue correctly. Try turning off your shaders.
:/
Why are map renderers such a pain to work with?
shaders doesnt matter, turned them off and same thing, idk why would they interfere here
well then, paste your code for that thing
Then I did not understand your problem. Can you please describe it better ?
What are you doing, what should be happening.
i want it snapped
and it weirdly rotates
idk please help mate
Well, first of all.
Location blockLocation = location.clone().add(x, 0, z);
Anything related to this variable is pointless. You will set the passanger anyways so the position of the BlockDisplay is ultimately meaningless. Simply spawn it at the same position as your root entity.
nitpics:
your package name does not conform to the java conventionspl.abudabii.rustedCore.Utilities;
Bukkit.getPluginManager().getPlugin("YourPluginName") bad, at least rename your plugin correctly
Can you describe the images. I don't know what means what.
I understand you want literally just a platform of glass blocks and that is clearly not happening. But I am missing context of what changes between each.
i want to teleport 5x5 platform there where player is looking
like in rust
wait
idc about rust
I know how that feature looks
So, when you create the preview, without running the updatePreview method. Is it correct ?
and then i'd want to snap it to each other
wait
i have 1 more code
this
You can solve that yourself later.
and it calls the structure preview functions
(it's great that it has comments, but it's in POLISH and I can't read that LOL)
rip
Damn, that's a lot of static
wait
no, it's no problem
private static final Map<UUID, Boolean> isInBuildingMode = new HashMap<>();
Why have a map of booleans. Simply a Set of UUIDs would be enough. If UUID is not in set, player is not in building mode.
Are you ChatGPT-ing this ?
🤦♂️
yea i know...
repaired
Can you comment out your updatePreviewLocation ?
Only spawn the preview and do nothing else with it.
I wanna eliminate a variable in debugging this.
But I don't really see how/why it's broken
it like sets orientation :/
i got verified 😎
kewl
i did comment out and now armor stand is not getting teleported
and blocks stay in place as they stayed
Are they in the correct positions ?
Basically I wanna know if just the teleport code breaks this
it just spawns like this
display blocks aren't getting teleported
yes, that is correct. That's what I wanted
image ?
it is like it was
image please
where i look
it like rotates there
i mean not constantly
just once when it gets spawned
and it stays
That blue line worries me
That's the F3 debug
// Armor Stand jako pasażer Block Display
blockDisplay.addPassenger(rootEntity);
That is wrong
Shows rotation/looking angle
I know what it means, that's why it worries me
Do it the other way around.
blockDisplay should be a passenger of rootEntity
It meant that each display is not riding the root entity.
spectator
yo isn't that why it rotates where armor stand looks?
Idk
Are you trying to add the blockDisplay as a passenger or vice versa?
yea
i think so
but i think i will need to make it other way than riding
javaFX or Jframe?
because i think display blocks rotate where armor stand looks
Your own GUI implementation from scratch made in Vulkan.
riding should work, although one downside to it is that you lose out on the teleport interpolation feature of display entities
that should probably be okay for most things though
You can use the.. teleport interpolation
Which should work.
You're surely talking about transformation interpolation
no, specifically the transformation interpolation will work even when riding
but you can't teleport an entity that's riding, so there's nothing to teleport interpolate
or, well, you can, but then it's no longer riding anything
oh like that
that's not a problem in this case
and ye, normal interpolation will work anyways, sorry
how much to pay for someone to make me this system?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
it will use the root entity's teleport/movement interpolation which is good enough for most cases
yea but like around what price range?
But like just learn Java instead of using Gen-AI lol
It would probably work if he actually used the correct #addPassenger() call.
never messed with 3d rendering, should i start with openGL?
dunno, i didn't read any of the leading up conversation
something something bunch of block displays
I was joking. But imo you should pick one as both are very different.
compose native :)
what is the best way to show some text above player nametag in minecraft 1.8.8?
Upgrading to latest and using text displays probably
i really would like to upgrade version, but i am writing plugin for server that doesn't want upgrade
None, it will always look bad. The best attempt would be an armorstand riding the player
armor stands, teleport them every 3 ticks to the player's position, the interpolation will be roughly the same as player movement, or I think you had to do it every tick
It will look sluggish, even when tping every tick
armorstands are synced every 3 ticks and use smoothing for the teleport
nah, tested it on a server, it looks near instant for me?
I tested teleportation and it looked ugly
It gets super worse with the slightest increment in latency
then parent the armorstand on the player, make it invisible and a tiny one
ah fair
if you mount the armorstand on the player the player will be unable to teleport
what?
no, the player can still teleport
a player can't teleport if an entity is riding the player
try it if you don't believe me
uhm, yes it can?
which version
I think its the other way around
^
no, it's when an entity rides the player
no
yes
sit in a boat, try to pearl away, won't work
i think about doing this all with packet, because if i put armor stand as passenger player can't hit block above himself
I guess no vcs2 is right actually, I forgot
also yes, but you also can't teleport if the boat is riding you
I was the one to make the PR to allow it, I forgot about it and it is not finished lol
but i have problem with putting armor stand on player with packets
i had to resort to copious amounts of protocol fucknuggetry to get over-the-head player healthbars to work
it does work but it's hideous and fragile and if you mistime the packets the client state gets bricked and they'll have to relog before they can place blocks/chat
alternatively patch the server to allow teleportation whilst having passengers, which is apparently a popular approach by server owners, but not really something you can do as a public plugin developer
"to run my plugin you need to run the server with ignite wrapper and have it apply this mixin"
🤡
i write it for my friend so it shouldn't be problem. but i think about sending packets that armor stand ride on player for all players exclude the player that is owner of armor stand, but i don't know why when i send packet armor stand is still in same position
do you know if i need send PacketPlayOutAttachEntity once or more times?
new word just dropped
you can turn the armor stands collision off
i believe its isMarker()
that also makes the client not do any predictions for it and iirc makes it unable to ride entities, but i could be wrong
you can make it ride entities just fine as marker
I don't know what predictions you're thinking of, but in 1.8.8 there wasn't anything of the sort anyway
the only issue with armor stand would be the fact that you can't have multi-line names so you'd have to mount one for the nametag and other for whatever else you want to display
you can probably use this
it mentions the pro and cons of each approach here too, convenient
That’s not really relevant in modern versions
they're using 1.8.8
Skill issue
we'd just recommend mounted text displays if it was a recent version, I forgot how much of a pain in the ass these things were before
alr I need help brainstorming!
I'm trying to do the impossible and make an isometric view plugin
the main problem I have right now is freezing the player and getting their movement at the same time
cancelling the player movement should still trigger an input event, no?
the usual way people go about it is making the player spectate an entity that cannot move though, or so I believe
nope
yeah but then I cant get the player movement
are you sure the PlayerInputEvent isn't called?
is that an event?
it is
since what version?
pretty recently, 1.20.6 or so
i thought thats only called when riding an entity
ah makes sense why I couldn't find anything around it. I'l check it out thx
maybe but its still better than nothing
that'd be the vehicle move event
wait does playerinputevent get triggered by any keypress?
just the movement ones
ah ok cool
forward, backwards, left, right, jump, sneak and sprint I believe
separate, that just gets the last Input sent by the player
so whats the diference then?
nothing really, perhaps the events is more "immediate" but I doubt it tbh
it just depends on how you want to go about it
huh alr I'll look more into it but this might have just revived my idea 😂
last i tried this, it was "mounted" and the client did receive the packet, but the marker armorstand remained where it was and didn't move with the mounted entity; similarly marker armorstands don't seem to respect velocity/movement and can only be moved by being teleported
nope I think that getCurrentInput is how you get the input from the event
the event has a getInput method
I don't know why or how that happened to you but mounting them works just fine, I don't know about velocity
though I do believe people had some issues around marker armor stands where the entity would stop moving once the chunk unloaded, but in the case of client-side entities, the entity would outright be despawned anyway
i only tested it once when going through my "how the fuck do i make this work" checklist, and at a glance i didn't see any issue with my implementation, but i didn't experiment with it very thoroughly
i vaguely remember first setting it up with a regular armor stand; and it worked
then i switched on the "is marker" flag on the armor stand; and it broke
the other issue with using a marker is that since it makes the hitbox smaller, you need like 6 marker armor stands to make another line which is crazy
so for my plugin I'm trying to make a "new gamemode" but the only way I could figure out was by checking every time a player moved then going through each player and checking if they had the custom gamemode tag and then handling them from there
Just feels inefficient
the players gamemode is stored in a custom yml file
well i would make the GamemodeManager a static field somewhere
creating whatever that manager object is every time the player moves is definitely not a good idea
and you could probably just set the fly and walk speed onnly when the gamemode changes
I would just use a hashmap and dump their mode in whatever form of storage you prefer when the server closes or the player leaves
and also yeah, only change their speed when their gamemode changes
you may also want to check whether they moved their head vs their actual location, as the mvoe event is triggered for both
use enums for constants instead of comparing strings
the problem comes to interference with other plugins like essentials with /setflyspeed
but if the playerinputevent thing works I wont need the flyspeed thing as I will just make them spectate an armorstand
nor the movement cancel
but I still need some sort of loop