#help-development
1 messages · Page 537 of 1
ye?
ok
so I guess it can't be that
yep no error in commands shown
yes
ohh
I typed in when I registered the command all lower case, but in the yml it has a few uppercase
Alr
so I changed the cases and made it correctly, but there still isn't happening anything when clicking on these npcs
can i control player vanilla level from db ?
is there a way to integrate it?
Player#setExp
have you tried NPCRightClickEvent ?
i believe
Oh that level
its not? google says it is
i add player vanilla levels to db
when player level up db level will up
but if i change level from db ingame player level not changing
its Citizens
This GitHub page explains that NPCClickEvent is not meant to be used but instead its subevents, such like NPCRightClickEvent and NPCLeftClickEvent. https://github.com/CitizensDev/CitizensAPI/issues/26
wat
So if I don't care if player right or left clicks, I just want some interaction
I have to have two events ?
yes
Who designed that
In bukkit it’s also two events to listen to entity left and right click iirc
check the arg if it starts with -?
.startsWith ?
for (String s : args)
if (s.startsWith(...))
...
Just don’t support that :p
stream and filter for -
Or you’d have to filter out those args and remake the array without them
Args is an array
Arrays.stream(args).filter(arg -> arg.startsWith("-")).toList()
and you have all args with - infront
nobody using Stream.of :(
If you remove it you’ll just be left with a null
invert the filter
Arrays.stream(args).filter(arg -> !arg.startsWith("-")).toList(), but tbh i would not support - args being anywhere in command
it will give you a List containing ALL args which start with -
because there is no env where it works like that
that gives you everything else
It also means tab completion will be weird
Implement TabCompleter
Or TabExecutor which covers both TabCompleter and CommandExecutor
^
declaration: package: org.bukkit.command, interface: TabExecutor
i use acf 💀
mfw ur too slow
shutup i was finding the link
acf weird imo
java annotations weird
exactly
Boo shading things
but i like minestoms framework more (only working on minestom ™️ )
If ur plugin isn’t smaller than super Mario bros 3 then it’s bad
how big is mb3
works with a lookup tree or smth
256kb
brigadier 💀
isnt brigadier that horrible syntax with .then(() -> ) and stuff
or am i confusing it
that is javascript
You can write it how its supposed to be written also (:
no way that is java command framework
Have you never heard of brigadier?
prove me
I can do once I get home
what's it supposed to be written like
brigadier is awesome
bc rn ACF is looking bettter than this
ACF is just preference tho
acf is just weird with a bunch of annotations
You just can't implement it to spigot without bms
Spigot brigadier api when
I get it
id be happy if java had annotations like
[Command("test"), Syntax("/test <a>")]```
but thats more like rust
hmm looks trash
i love value, yourVaule
jls you mean
groovy support when
scala when
man what am i even saying
i thought orbyfied was writing some kind of java extension thing
Java? More like I hava no friends
You what
is there some way to trick the server/client and make walking basically on air possible?
Im using Block Displays for moving blocks, since they don't snap to whole x,y,z
just they aren't collidable
how can I make them collide/walked-on?
but barrier doesn't fit the model of some blocks
mmm flying might be the option
but what about starts for example
Shulkers
Didn't we tell you that yesterday?
Can shulkers adapt to stairs?
.
AI is going to take over the world
wasn't me
I asked only about the Block Display
dude paper is from openAI?
xD
i knew trees didn't make it
Weve all been fooled
It was you
I just linked the message
oh right
I didn't pay attention to previous messages
Why is Player#hidePlayer backwards? Its so weird..
wdym backwards?
Like if I want to hide Player A from player B
i have to do b.hidePlayer(A)
I would assume it to be the other way around
i personally think it makes more sense the way it is, but its a personal thing i guess
He knows what it does
that makes no sense
why not
it should be the other way around
he was just asking, why it is that way around and not the other
ikd
for me it makes more sense the way it is
It's counter intuivited
I'd assume that Id be hiding the targeted player
not the player i put in the args
if that existed
id be less angry
kk
i guess you're reading it more like
player.hideFrom(player)
instead of
player.hideForMe(player)
Yeah
What’s the difference between spawn and spawn naturally?
is there a certain event that is triggered when somebody is damaged by an explosion? Or is it just the Entity damaged by entity event with damager TNTPrimed?
anyway, i was wondering if anyone knew of a way to basically implement tables in things like item lore, i just want equal spacing between certain strings. i was thinking maybe negative space characters, but then the strings i would want to space apart would have to be displayed as a character of their own with 0 width. any way around this?
spawn naturally just means 0.5 is added to the x y and z of the spawn coordinate is all
Yes
so it spawns in the center of the block rather than on the corner of a block
Ohh okay, idc for that. Thanks.
if I spawn shulker box somewhere via Packets, will it still be walkable but won't disturb water for example?
I don't want it to replace the block there is present on position of spawn
A shulker or a shulker box
*shulker
It shouldn't disturb water
Idk if it'll be walkable tho, the server might get real mad
i use this
public Config reload() {
if (file == null)
this.file = new File(plugin.getDataFolder(), this.name);
this.config = YamlConfiguration.loadConfiguration(file);
Reader defConfigStream;
try {
defConfigStream = new InputStreamReader(plugin.getResource(this.name), "UTF8");
if (defConfigStream != null) {
YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(defConfigStream);
this.config.setDefaults(defConfig);
}
} catch (UnsupportedEncodingException | NullPointerException ignored) {
}
return this;
}
where this.file is simple a File and this.config is YamlConfiguration
also keep in mind that obviously when you're reloading a config you should also reload the instantiated properties of your plugin
Or first write to it and then load it?
Also ur async version is not safe
You can use FileConfiguration#load(file)
Quick one I'd think you'd all appreciate. Go actually look what "Git" stands for (not the word , the actual wiki article for the distributed version control)
You don’t need loadConfiguration technically
yea that would work if thats what you want
just load()
I just noticed your teamCheck can be optimizedjava private void teamCheck(EntityDamageEvent e, Player p1, Player p2) { String p1Team = TeamUtils.getPlayerTeam(p1); String p2Team = TeamUtils.getPlayerTeam(p2); if (p1Team != null && p1Team.equals(p2Team)) e.setCancelled(true); }
Objects.equals :p
Objects.requirenonnull
he doesn;t want it to blow up
Doesn't Objects.equals handle nulls
it does, two nulls will be equal
so not useable without the != null check before, so no advantage in using it
oh lmao thanks
if test is null no
u replied after an hour lol
i mean in this example test will never be null because he just instantiated it
yeah I went to close a page in my browser 🙂
show ur sql
the sql where that is in ur code
isnt it obvious what the issue is?
where i check but didnt found
wait don't tell me i find
what event is triggered when somebody changes the hotbar slot they're on?
you set the name, but you are also trying to set the level
you dont actually need to update the name, you only need to change the level
i hope you dont do that sync
what does ur code look like now
I don't wanna act like an ass but I really need some help
theres only 1
you are still trying to set the name
but question mark
alright wait
PlayerItemHeldEvent ?
Instead of insert and update you could also just use replace
im pretty sure the sql you want is UPDATE players.playerstats SET level = ? WHERE = ?;
And please don't use names to store their stats
use UUID!
People are able to change names
You can use uuids nonetheless even if it's offline
i'd still use uuid tbh
yes i know but so that I don't get confused
i trying to learn
??
yes uuid confused me
those mixed characters
i have a disease for this
😄
UUIDS are unnique identifiers used for storing unique IDS of players, if you really got confused you could make a column for the player name, but the ID column should be unique.
consists of two longs
actually good idea
you shouldn't be using uuid as primary key
is this column index?
no
thats the first ?
its the amount of question marks in ur prep statement
somehow they decided to let it start at 1
its not the amount, its the index of it + 1
as in "first" in english
im confused again if i
if i stated ?
i need add ? paramater index
wait i will show u guys
after i add playername to here
index 1 is for first ?, 2 is for second ?
plugin will works
i understand
but i need getplayername in updateplayerstats ?
what
actually i need one question 😄
how can i set playerlevel from database ?
can i check db events with jdbc ?
add it to start with or update it
Why events ????
why are you storing that in db
Save it in db when player disconnect
wdym, retrieving it from the database?
When he joins fetch the level with a SELECT
yes
result set
for the mmo server
level system works with vanilla levels
do what _Rolyn said
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
alright iwill try
had sql exam today lol
I wanted to do this kind of process to add experience to myself.
whats the proper way to get an entity to "look at" something? Mob.lookAt() doesn't update Mob.yRot
Hi, I'm trying to add support for spigot 1.16.5 to my plugin however I have run into some issues and I was wondering if there is a known solution to them
My project currently uses some extra apis from paper that I would like to use when possible as they make everything run a bit smoother. I have gradle-subprojects set up to abstract those behind an interface that is only loaded when they are available. This works great for 1.17-1.19.4.
This solution unfortunatly breaks down at 1.16.5. Because the apis I use are only present in the 1.19.3+ versions of paper I have to build the project with at least Java 17, but spigot 1.16.5 tops out at java 16 (and I can't seem to skip the java version check in spigot)
I tried to set the Java versions per subproject with the main project being 16 and only the subprojects that need java 17 at 17. The subprojects aren't going to be loaded unless the minecraft version is at 1.19+ (Java 17+) anyways so in my head it should work, but gradle doesn't seem to want to let me do that. Is there any way to override/work around this
Just compile it with Java 16. Java is backwards compatible
It doesn't let me. It claims that the dependency (1.19.3 paper) requires Java 17
Let me grab the error rq
Caused by: org.gradle.internal.component.NoMatchingConfigurationSelectionException: No matching variant of project :versions was found. The consumer was configured to find a library for use during compile-time, compatible with Java 16, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
- Variant 'apiElements' capability net.bonn2:versions:2.3.5 declares a library for use during compile-time, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 16
- Other compatible attribute:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
The project structure is this
- BigDoorsPhysics
- Versions
- v1_17
- v1_19
- v1_19_3 <- This one needs paper 1.19.3 (Java 17) as it added an api to handle teleporting stacked entities
No matter what I do it always errors out, either because paper 1.19.3 requires Java 17 or the subproject v_1_19_3 needs java 17
v1_17 only uses apis that have been around forever so if I can get past this Java version issue then I should be able to have my ad-on go all the way back to 1.11 and cover all the supported BigDoors versions
you can specify use toolchains a java version, and it can go in the submodule build.gradle
I'm pretty sure I've tried toolchains, but I'll give it another go
ANyone who knows how I would add money to a players balance?
or am I forced to use the essentials api
you should probably use vault for that
Do you know their docs?
can someone help me with installing a plugin ?
or where I can find it
Thx!
How can I implement it with maven
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
compileOnly "com.github.MilkBowl:VaultAPI:1.7"
}
its right above that
oh lmao thx
but how would I then give some money to a player?
Economy#depositPlayer(player, 99.99);
so I cant do player.deposit?
that would require a modification to the api, which plugins cant really do
Alr, so what can I do instead?
get an economy instance from following https://github.com/MilkBowl/VaultAPI#implementing-vault then use the method i replied to
Do I need to add everything of it
just the stuff relating to economy
that would npe
?npe
The NullPointerException, (commonly referred to as NPE), is thrown in the following cases, but not sealed to: 1. null is passed into a method or constructor which does not allow it; 2. When trying to access a field on an object pointing to null; 3. Casting null to a primitive. See https://stackoverflow.com/a/3988794/17047120 for information on how to debug NPEs.
so not work basicly
public class ExamplePlugin extends JavaPlugin {
private static final Logger log = Logger.getLogger("Minecraft");
private static Economy econ = null;
@Override
public void onDisable() {
log.info(String.format("[%s] Disabled Version %s", getDescription().getName(), getDescription().getVersion()));
}
@Override
public void onEnable() {
if (!setupEconomy() ) {
log.severe(String.format("[%s] - Disabled due to no Vault dependency found!", getDescription().getName()));
getServer().getPluginManager().disablePlugin(this);
return;
}
}
private boolean setupEconomy() {
if (getServer().getPluginManager().getPlugin("Vault") == null) {
return false;
}
RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
if (rsp == null) {
return false;
}
econ = rsp.getProvider();
return econ != null;
}
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
if(!(sender instanceof Player)) {
log.info("Only players are supported for this Example Plugin, but you should not do this!!!");
return true;
}
Player player = (Player) sender;
econ.depositPlayer(player, 99.99);
return true;
}
public static Economy getEconomy() {
return econ;
}
}
is it all I need?
that has what you need
private static final Logger log = Logger.getLogger("Minecraft");
That's not part of Vault's README is it?
that is most deffo part of the readme
I'll stab a bitch 
is it in your main class
How can I use it in another class then
lmao I forgot I was the latest commit to the VaultAPI repo
notice the static? MainClassName.getEconomy()
TIME TO MAKE ANOTHER PR TO REMOVE THE LOGGER
?paste the class
wtf is this
oka thx how would i use MainClassName.getEconomy()
in my other class
I don't really get the "you should not do this" part. Some commands just don't make sense when executed from the console
you type what your main class name is and use the response from getEconomy to add the money
I dont really get it, do you have an example?
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
if you cant understand MainClassName.getEconomy() you need to go and learn java
adding java java { toolchain { languageVersion = JavaLanguageVersion.of(16) } } to the higher level projects build.grade and java java { toolchain { languageVersion = JavaLanguageVersion.of(17) } } to v1_19 and v1_19_3 just produces the same error. Is there a more complex setup that this would need? I'm looking at the docs for toolchain now and I'm not seeing this described as a use case. It just seems to be for compiling the entire project in different versions, not different sub-projects
Oh wait I got it, now my brain was just out of work
if that didnt work its prob best to head to paper's build tool support channel
Alright, thanks for the help
well done choco
Isn't vault dead
I don't think it's updated in a while
No?
close enough to
it needs an update
5 years ago
maybe if they see it come from choco it will get merged
https://github.com/MilkBowl/VaultAPI/commit/9520d8847e2b31f4a9d2cb5f7831c38877cd0ce9 also wasn't an end-user change, but it was merged
Granted it took 2 fucking years lol
but it got merged
real
https://paste.md-5.net/eveyuxerib.cs all other recipes register, just not a few of the smithing ones
some extra info:
- sometimes it appears for a few ticks then disappears
- all other recipes work just not the ones under the comment with (broken)
md5 mentioned a VERY recent fix to smithing recipies, is that affecting you?
you have another method inside a method
the above method doesnt have a closing brace
how can i check Farmland Moisture change type
i mean water or rain ?
i can't find any method for check this
you can't differentiate between rain or water though
English? I just linked the javadoc
maybe block physics event ? bcs fire burn out in the rain
You are not making sense
i wanna cancel MoistureChangeEvent at rainy day
but Moisture event will work with water
Wants to know how the moisture changed, whether it be rain or a water source
I didn't think farmland was watered with rain?
At least I don't recall seeing that when I added that event
Pretty sure only modded waters with rain
Yeah, it doesn't
it can be
Oh wait no it does
!isNearWater(worldserver, blockposition) && !worldserver.isRainingAt(blockposition.above())
TIL
go pr a cause
tbh there's really not much reason to. It will hydrate either while raining or near water. There's not really a distinction. It's either or
So I'd say if it's raining, cancel it
ah good idea
That unfortunately means that soil won't hydrate at all while raining but I mean... not really much other option unless you want to check for nearby water yourself, which is certainly an option
- im trying to build an artifact directly into a folder in IntelliJ and keep getting an error with my dependency, HikariCP, not being included
- its fine if i use the "run" button and take the jar from the target folder, but thats not what i want
- the error i get is
java.lang.NoClassDefFoundError: com/zaxxer/hikari/HikariConfig
these are my dependencies:
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>5.0.1</version>
</dependency>
</dependencies>
you need the shade plugin
i think i have it, unless theres more i need to do with it
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
or use the libraries feature in plugin.yml
set the scope on Hikari to compile
although no scope shoudl default to compile
i reloaded maven, same issue
how are you running maven?
not entirely sure what you mean, im just clicking this thing. i assume ill have to use a command?
that isnt the maven build
right side window is an m tab
iirc that uses intellij build system
it drops it in the target folder. am i able to build it directly in the server folder as i did before?
yes but don;t
Epic on teh ball. You had that one prepared 🙂
im just speedy
I hate hard-coded paths, especially in open source software
Does anyone know where I can find the docs for Skript API?
/in real
I cant seem to find them
theres loads
?
I linked it right below that message, silly
fun things in the javadocs
^
theres some dolphin stuff somewhere
True actually there's one right above lol.
Squee'ek uh'k kk'kkkk squeek eee'eek.```
There's also a typo `increses`
Isn't that for skripting? O.o
And apparently failed at spelling
Yeah. You said Skript, right?
you asked for the skript api
OH SKRIPT API
Like the plugin
Uhh... I don't know if they have public Javadocs for that
Oop, they do. Found it. https://docs.skriptlang.org/javadocs/
Oka, thx! can you help me with adding something to a skript variable using the api? 😄
That Discord probably would be the best place to ask tbh
I think the people in Spigot here with Skript API experience will be far and few between
When do we get a proper worldgen feature API
😩
Any CI’s that people recommend that I can host/use for my spigot plug-ins?
Actions can handle buildtools
Jenkins got it
yes
That was a statement
it sounded like a question
in how i read it it sounded like a question
this is why we have ?'s, which Coll did not use >:((
He didn’t get to the part of English class yet
yeah well
i thought he missed the ?
i don't understand getState isnt int ? for MoistureChangeEvent
what is the Moisture states ?
im guessing you cast the block state to Farmland and then check moisture content
can do that then
?learnjava! @quaint mantle
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
this has nothing to do with learning java
it does
farmland states is'nt 0 1 2 3 4 5 6 7 ?
most likely is, you just have to access that field correctly
ah so i need add farmland block to MoistureChangeEvent?
MoistureChangeEvent event ...; // ur event
Farmland farmland = (Farmland) event.getNewState().getBlockData();
farmland.getMoisture()
e.getBlock or getNewState already getting farmland ?
bcs Moisture only for farmland
I thought so
try it and see
Can you help me understand the working logic of the plugins?
@EventHandler
public void test(MoistureChangeEvent e){
Farmland farmland = (Farmland) e.getNewState().getBlockData();
World world = e.getBlock().getWorld();
if (world.isClearWeather() && farmland.getMoisture() == 1){
e.setCancelled(true);
farmland.setMoisture(0);
}
}```
at this code if player have big farm
this code will do lag ?
Why are you cancelling it and setting it to 0
farmland.getMoisture is getting next moisture ?
this code will do lag ?
Nah
if player has farm with 10k blocks?
Farmland only hydrates when it gets a random block tick
Which only happens 3 times per chunk per tick
It’s really not a huge deal
how i can make this works on PlayerChat Event?
TextComponent component = new TextComponent(message.replace("[item]", player.getInventory().getItemInMainHand().getItemMeta().getDisplayName()));
HoverEvent hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_TEXT, new BaseComponent[]{new TextComponent("test")});
component.setHoverEvent(hoverEvent);
player.spigot().sendMessage(component);
i am trying to do when someone write
hello look my cool item [item]
everyone will see instead
hello look my cool item [Diamond Sword x1]
and when they hovering the text it will show the lore of the item like enchantments stats and ech..
but i cant put TextComponent inside event.setMessage because it get only Strings, i tried TextComponent.toLegacyText() but the hover event not working
and i noticed only player#spigot.sendMessage working, but i want it will edit the player message
anyone can help me?
You need to rebuild the message with components and then use player.spigot.sendMessage
What event would it be for when a creeper is about to blow up? I need to cancel it.
ExplosionPrimeEvent
how?
event.setFormat? because it getting only string too
Thank you.
or you mean like
spigot.sendMessage("<player> message " + comp)
Split the message up around [item] and convert all the parts into text components
Then append them with your item component in between
ok i will try
but how i making only the "text" be hovered and not all the message?
TextComponent component = new TextComponent("<" + player.getDisplayName() + ">" + message.replace("[item]", player.getInventory().getItemInMainHand().getItemMeta().getDisplayName()));
HoverEvent hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_TEXT, new BaseComponent[]{new TextComponent("test")});
component.setHoverEvent(hoverEvent);
event.setCancelled(true);
player.spigot().sendMessage(component);
Use multiple components
Also the ComponentBuilder
Also the built in show item hover event
public void test(EVENT e){
e.setCancelled(true);
if (equal){
e.setCancelled(false);
}
}```
if i do this
after equal event not cancelled ?
does anyone have a resource for boss bars? I want some of my entities to display their health in a boss bar.
ty
Version?
1.19.4
Use the api for it
Bukkit.createBossBar
Then you just update it to reflect the entities health, and add or remove players based on proximity
yeah my prox will probably be 30 blocks.
i can't find if world is raining method so this work ?
if (!(world.isClearWeather())){
Yes
ty
for this does it have to be a runnable?
You can update the health with just the damage event
I got into trouble, can you give me an hand?
But for adding and removing players you probably need a runnable
so at that point i might as well wrap the health in the runnable to
With what
[item] to display on chat
look at interactive chats code
should I have a keyed boss bar or no?
you have link?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Do you want it to persist across restarts
I dont really think it matters to much, so I'm going to say no.
Then don’t use a key
there is nothing with [item] there everything are of config and some random classes
it has the feature, just dk where, can prob ask in their discord https://discord.gg/loohp-s-development-discord-807296021293432902
kk thx
You looking for this?
Hey there, I was trying to play around with the custom fonts etc.
See the picture above, yeah I know I know great design skills xD
public static Scoreboard createScoreboard(){
Scoreboard scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();
scoreboard.registerNewTeam("000Developer");
scoreboard.registerNewTeam("001Player");
scoreboard.getTeam("000Developer").setPrefix("§f\u1940 ");
return scoreboard;
}
public static void setPrefix(Player player) {
if (player.hasPermission("rank.developer")) {
Prefixtest.scoreboard.getTeam("000Developer").addPlayer(player);
player.setDisplayName(Prefixtest.scoreboard.getTeam("000Developer").getPrefix() + "§b" + player.getName());
System.out.println(Prefixtest.scoreboard.getTeam("000Developer").getPrefix());
}
for (Player currentPlayer : Bukkit.getOnlinePlayers()) {
currentPlayer.setScoreboard(Prefixtest.scoreboard);
}
}
However when the player trys to send a message ingame I get the following error in console and no message is send to the server.
[19:51:04] [Async Chat Thread - #1/ERROR]: Chain link failed, continuing to next one
java.lang.IllegalStateException: Missing key in ResourceKey[minecraft:root / minecraft:chat_type]: ResourceKey[minecraft:chat_type / minecraft:raw]
at net.minecraft.core.IRegistry.e(SourceFile:88) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3756-Spigot-7d7b241-b346a5f]
at net.minecraft.network.chat.ChatMessageType.a(ChatMessageType.java:59) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3756-Spigot-7d7b241-b346a5f]
at net.minecraft.network.chat.ChatMessageType.a(ChatMessageType.java:49) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3756-Spigot-7d7b241-b346a5f]
at net.minecraft.server.network.PlayerConnection.chat(PlayerConnection.java:2121) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3756-Spigot-7d7b241-b346a5f]
at net.minecraft.server.network.PlayerConnection.b(PlayerConnection.java:2189) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3756-Spigot-7d7b241-b346a5f]
at net.minecraft.server.network.PlayerConnection.lambda$17(PlayerConnection.java:1895) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3756-Spigot-7d7b241-b346a5f]
at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?]
at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
How do people accomplish those rank titles?
the image you mean?
You can just replace a random unicode character with a image with a custom server texturepack
And then display the unicode
creative
You dont have a solution to the other problem, dont you? 😄
Let me look I haven't read it
Send full error.
Thats the full error
What is the maven command to compile to jar?
anyone know click repice bookevent ?
mvn clean package
Hover your mouse over it
And click
Og event
Yeah thays not an event
😄
Prey sure that's fully client sided
maybe there's inventoryclickevent called?
yes ?
just a guess
Doubt it, but it's worth a try
yup
I'm almost certain recipe book is client sided though
It can't. Opening and closing the window
No reason for the server to know whether or not it's open
If my plugin depends on another plugin, what are some ways my plugin could communicate with the depended on plugin?
API
Well
API or events, if the depended-on plugin has events.
Seems like no one has a idea D:
For?
this one
Custom fonts, do you mean custom text formatting?
when i want to remove a pcd from all players, can i just run through all online players? or does it trow an error at the once that dont have it
It's still a click in an inventory. If a window is open, and the player clicks ANYWHERE, it fires an inventoryclickevent.
I made a custom texture pack which replaces certain unicodes with a custom image
thats what I meant with custom textures. my b ad
no but you can close or open it for the player
Ahhhhh ok. Odd.
.
it shouldnt throw an error iirc
okay thyx
how ?
packets
what you wanna do with the book tho
Definitely API-able btw
choco pr go
open custom gui and add hover
like - is it on the api or it can be
Someone PR a Player#updateRecipeBook(RecipeBookType, boolean [opened], boolean [filterActive])
Or something like that idk
u cant do that then
you
@young knoll pr it
actually
rly ?
check if player sends the packet if the book is clicked
if even can lol
isnt it server -> client only?
You can open an inventory for players, and IIRC you can close an inventory for them. So it seems to me that if a player clicked, you could determine that they clicked the book and simply close their inventory and open a custom one.
yea the thing is
we know that player inv is client side
maybe the book also is
server doesnt know when u open your inv
which is sad 😦
i was see this at one server
hard to prevent invmove
i clicked book and open custom gui
okay i will invest my time to make it work
hopefully
wrr i was about to study 😂
looks like i wont! whoopsie
Thing is we know when the player clicks. If the clicked slot is not 0-40, it's not an inventory slot. Therefore it is either a crafting slot or a recipe book. If it's not a crafting slot, it IS the recipe book.
Then just cancel and make your own inventory.
If my plugin depends on another plugin, how exactly can I write code in my own plugin that utilizes code from the dependency?
Bukkit.getPluginManager.getPlugin("name")
but does the book trigger anything tho
thats the question
Inventoryclickevent
Any click while an inventory is open, even clicking outside the inv will fire the event
Make sure to add the dependency in your plugin.yml
Thank you I have just added that!
How will my IDE see all of the variables associated with the instance of the plugin I'm depending on?
I'm assuming this Bukkit.getPluginManager.getPlugin("name") retrieves an instance of the JavaPlugin class within X plugin?
you add it as compileonly dependency
to your project
the plugin.yml line is so that your plugin
- wont start if dependency isnt present
- load after it i think
It receives the instance that is created when the depended plugin is loaded, yes.
true, the plugin-yml page says that, you're right
so you add the said plugin to your ide (build system i mean)
like any other dependency
but you dont shade it
Ah just add the jar file as a dependency?
It's actually a simple thing. If it seems to be getting really complicated, you're probably doing it wrong.
dont do that
or implement it through maven?
I do
maven deprecated that i think
PlayerRecipeBookClickEvent
Personally I don't use maven or gradle
<3
do you know what?
yes
oof
avoid
if you plan to release your plugin on spigot it will get removed
it has to work on spigot
I use Eclipse. So I add the depended jar to my build path, add it in my plugin.yml dependencies, and then load the main class in my onEnable. Alternatively, if the plugin has an API class you can reference, I grab an instance of that. Again, alternatively, if your depended plugin fires custom events, just set up a listener and catch those events.
ModelEngineAPI plugin = (ModelEngineAPI) Bukkit.getPluginManager().getPlugin("ModelEngine"); Does this look right to you?
bet not using maven or gradle with nms is fun
When I create plugins that are intended to be used as an API, I set them up with a bunch of events. Clean and useful.
Ew, nms
If their JavaPlugin class is called ModelEngineAPI, then yes.
this is how paper does it
yes!! woohoo
omg I think I get it now
finally
Nice! Run it and see what happens XD
true lmao
loaded with no errors in console ;>
Good start
Have fun with your new-found magical skillz
not work
only cancel to click this
nvm maybe i need learn packets
if i make it work without packets ill make a small library that adds the event
oh good don't forget the send me 😄
sure
I've actually only ever used packets once, for a disguise plugin that would make players look like specific creatures. That was like, 9 years ago. Everything I ever do now does not use packets.
wasn't that creative?
For some reason it seems to enable my plugin before it's dependencies. I thought the dependencies were supposed to load first? Seems like due to this I can't get the instance of the dependency JavaPlugin?
[21:08:36 INFO]: Loaded 7 recipes
[21:08:36 INFO]: [Realms] Loading server plugin Realms v1.0-SNAPSHOT
[21:08:36 INFO]: [ModelEngine] Loading server plugin ModelEngine vR3.1.7
[21:08:36 INFO]: Server permissions file permissions.yml is empty, ignoring it
[21:08:36 INFO]: [Realms] Enabling Realms v1.0-SNAPSHOT
[21:08:36 INFO]: Realm Server starting up..
[21:08:36 INFO]: [ModelEngine] Enabling ModelEngine vR3.1.7
[21:08:36 INFO]: Timings Reset```Maybe?
At all? Interesting. Wonder if 1.20 will change that on June 7th
Can you show your plugin.yml?
version: '${project.version}'
main: me.combatborn.realms.Realms
prefix: 7 Realms
authors: [ CombatBorn ]
description: The plugin used for Realm Servers.
api-version: 1.19
depend: [ ModelEngine ]```
And the Model Engine plugin.yml?
don't have access to it
you can unzip the jar and look at it
oo okay
author: Ticxo
main: com.ticxo.modelengine.ModelEngine
version: R3.1.7
api-version: 1.16
softdepend:
- MythicMobs
- Citizens
commands:
meg:
description: All things Model Engine related.
permission-message: You do not have permission to use this command.
permissions:
modelengine.command:
description: Access to reload.
default: op```
Isn't it "depends" ?
I thought so but the guide on SpigotMC says depend
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
says depend
yeah
If I were home I could look at my own
ill try depends
No it's depend alr 🤣
I don't notice a difference when I change it to depends
Did you make sure you exported the new plugin.yml in your file?
okay so rn all i know @quaint mantle is that player triggers SET_RECIPE_BOOK_STATE on click
so thats success already
Ahh why has I been pingeded
Check your inbox?
you have a pr to do
real!
this
also the event
Can the server actually do that
I know it gets a packet when they click the book but I had no idea the server could edit it
how do i make a custom async playerevent?
Event takes a Boolean in its constructor to indicate if it’s async or not
playerevent constructor with isasync isnt public tho
why is that
Yeah but why
i give custom icons for players
and i do pings with number
can u give me docs ?
i can't find
without packets btw
Resource pack to remove the icon
declaration: package: org.bukkit.event.server, class: ServerListPingEvent
Or packets to change the ping amount
seems pretty hard without packets unless you want to use external librarys
That's for the server list
Control what
Ping? If so it wasn't supposed to messed with so there is no api to change it
Use packets
;-;
why are some of my recipes not registering even though they have java getServer().addRecipe(UpgradeRecipe)
can somebody explain wtf is happenning in cpp
i declare the last object inside 6th index of array right
while somehow
it gets copied in the 0th index too
i do not modify this array at all
removing the last element of array returns it back to normal
how can this element fuck up this array so much?
Ok I have one more problem I dont get though
i achieved to directly talk to the win32 kernel with java 💀
scoreboard.getTeam("000Developer").setPrefix("§f\u1940 §b");
This should make the player name colored in aqua
But the name is still white
How would I make the name a different color then? I always made it like that
I have a different chat layout
got that little shit
Win32KeyInputContext &context = g_contexts[actionIndex];
apparently references cannot be rebound
context = g_contexts[actionIndex+6];
i did this
so it basically copied the contents of the specified element to the referenced object
too used to pointers i guess
saturation is potioneffect or food consume effect ?
can someone explain this to me?
Cannot invoke "me.toast.wired.OverhaulMonsters.getConfigFile()" because "me.toast.wired.Listeners.CustomMobAbilities.Tesla.plugin" is null
plugin is null
it doesnt tell me exactly what is null
idk what that means
google is giving me answers from like 5-6 years ago that dont help.
because "me.toast.wired.Listeners.CustomMobAbilities.Tesla.plugin" is null
😄
maybe u need enjection plugin
that your plugin? show code
yeah its mine
i believe i already know what happened
?paste
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
and no reason for your event methods to be static
Zoinks!
bump 🥲
ahh okay. all events should not be static?
also early returns :(
zoinks scoob
those methods shouldnt, spigot uses reflection to get those anyways
How i can make, that player has limited write for X characters (Idk how to write it, but i mean when he uses command he cant write above 120 characters)? And when he write more than X the messages will not send only message with idk like error or something
isnt there a commend preprocess event with the raw text
are you talking about messages or commands?
when he uses command
command ig
he also says send messages, so
Yes
idk how to write it
but like
idk how to explain properly so sorry
are you trying to limit player chat to 120 characters?
you have command /g <messages> and its send messages in chat
per message
and the <messages> has limit
is the /g your command?
so /g is in your plugin?
yea
then you are going to be using coimmand args
command
String.join(" ", args).length
thanks
why am i only now finding out about this method
😭
because you didn;t learn java basics 😛
clearly lmao
so basically for the longest time ive been using a for loop with a string builder
but string buffer is faster on main thread
So is String#concat for a length <= 2
wait lol no
its the opposite
String buffers are safe for use by multiple threads. The methods are synchronized where necessary so that all the operations on any particular instance behave as if they occur in some serial order that is consistent with the order of the method calls made by each of the individual threads involved.
strings buffers are slower single thread applications
yes
while string builders are not thread safe, thus no synchronization
i need help switching versions on my server
TIL string buffer
It's one of those auto-completion results noone needs
it says "unable to access jarfile spigot-1.19.4.jar"
Where did you get that jar?
pretty sure from the website
the website
by executing third party jar files
the spigot one
he probably used the mirror downloads of prebuilt spigot jar files
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Yay seo
should i change the .bat file to buildtools instead
it says unable to access the buildtools.jar when i run the code in git bash
Are you sure that your pwd is correct?
what is that
uh we have a problem then
Have you ever used cd at the very least and know what it does?
isnt that the commmand terminal for windows?
Okay so you don't know DOS/UNIX basics 101. Since I can't be bothered I'll show you the quick route: Go to the folder in which your spigot jar is located in and type cmd in the address bar, then hit enter
@tardy delta So ive been working around with my plugin. It has to do with my config. I commented out anything that referenced values from my config and now it all works. What could be the issue then? nothing is static no more. Everything is spelt correctly or at least the same in the config and my code.
Only then you can execute your java -jar <X> thing
so now do i run the commmand again
plugin still being null?
any time with the config values.
its confusing the hell out of me
make your variables final so it tells when they arent being initialized
okay 1 moment
just use @NotNull everywhere and let your properly configured IDE do the real job
ok well i ran the command and it said everything was copied successfully so what should i put in my start.bat file?
what did you execute
still says its null
show code
and i dont see anywhere it telling me anything else
java -jar BuildTools.jar --rev 1.19.4
?paste
?bt RTFM
spigot should have a read the docs emote
well you never give any value to your plugin
dependency injection works as following
class SomeListenerOrWhatever {
private final PluginX plugin;
SomeListener...(PluginX plugin) { this.plugin = blablbla }
}
class PluginX {
void onEnable() {
ListenerThing listener = new ListenningThing(this);
}
}```
just realized java constructors are bloat
ur bloat
ur mom
why use constructors when you can just use static
smh
i like c++ constructors: Something s(params)
and gets like the java one when doing a heap allocation
I like the haxe constructors
in what way?
public function new(){
// code here
}
whats haxe
wow. 3 lines. 3 lines of code... I feel so disappointed in my self lol. I have this constructor in so many other classes idk why it left my mind during this.
well typing the type twice (if you use an interface as first then not)
also use "new"
idk i got into some kind of mood where i want everything as short as possible
oh wow, so unfortunate
just make your plugin variable final and tell what it says
I reckon this will be fixed in future JEPs
already expected that answer :(
It all working good now. Just some tweaking i got to do to some of my mobs now. Thank you!
i ran the command multiple times but every time I ran start.bat it said Unable to access jarfile spigot-1.19.4.jar

