#help-development
1 messages Β· Page 179 of 1
btw what is the meaning in the parameters in the constructor in the AttributeModifiers class
maybe i'm dumb but MultiMap is not in java core
I can see it's implemented in Google guava
Would anyone know how to create a plugin that would allow a player placed sculk shrieker to be replaced or have it's state changed so it can spawn the warden?
BlockPlaceEvent?
setCancelled(true);
spawn warden at location
^
umm?
nice params
My bad may seem like a silly question, i'm very new to spigot development. I'm trying to make a plugin for friends
BlockFromToEvent?
FREE JAVA LESSONS
checkmybio
free spigot lessons too
spigot doc is very helpfull
true
?jd-s
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
π₯²
.translate()

@wraith flame This should give you a general idea on how to achieve your goal.
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/data/type/SculkShrieker.html
declaration: package: org.bukkit.block.data.type, interface: SculkShrieker
What is even the string param.
this is why I blocked you.
Smh school at 2pm for 2 hours and im home at 5:30pm
so mean tho
i just found a new student
and you blocked me
two lessons today, one at 8:05 and the other at 11:25.
Schoolhours today: 1 hour 30 mins.
Home at 13:20... I was at school for 5+ hours for basically nothing
haha
bro
i have philosophy at 10:40
and programming at 18:00
in different buildings
of my university
basically 3 metro stations distance
that's the cringe
some real dogshit
3?!
?
6 hours i just do nothing
from 12:10 to 18:00
eating at KFC
walking
sitting in my laptop
Sleep
yeah sometimes
Hi. I'm a bit stuck trying to set a custom zombie mob to break doors. I'm trying to use Zombie#setCanBreakDoors()
Zombie newZombie = (Zombie) e.getEntity().getLocation().getWorld().spawnEntity(mobLoc, EntityType.ZOMBIE);
newZombie.setCanBreakDoors(true);
But I get this error: The method setCanBreakDoors(boolean) is undefined for the type Zombie
What am I doing wrong? (I'm using Maven dependency to use the Spigot API 1.19.2-R0.1-SNAPSHOT)
I PR'd this method not too long ago. What version is our server
or... is this an IDE error?
did you import right zombie class
My server is 1.19.2. It is an IDE error though
show your pom please
does your IDE auto-suggest you methods when you write newZombie.
got in at 8am today, getting out at 6pm
got a meeting at 9 and wanted to hit the gym but gotta work
I think so. I can use all of the other Zombie# methods
My IDE auto suggests every method in the class except setCanBreakDoors
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>MyPlugin</groupId>
<artifactId>MyPlugin</artifactId>
<version>2.4.3-SNAPSHOT-51</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version><!--change this value depending on the version or use LATEST-->
<type>jar</type>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
it could be a paper think
Yeah it's a paper thing on 1.18
??????
I added it to spigot
it's spigot 1.19
try invalidating your caches
reinstalling dependency
No luck with either :/
Some time maven from intellij get really annoying
Okay. Thank you
I once had a problem that dependencies only were working for multi module Project
No errors with eclipse
π©
its's so funny that intellij had Minecraft preset
which like nobody used
from my friends who prefer IDEA
There is nothing which could be registered anywhere in this code
No this will do nothing on its own
What are you trying to achieve?
When?
When do you want to change the tablist and for whom?
Without type constraints this class is completely useless
Its just a Function<ItemMeta, T> and has no real purpose
Show us how you apply the tablist changes
bae
This does nothing on its own. You just defined a method which could set the header/footer of one Player at some point.
Where do you use this method?
ItemStack item = new ItemStack(Material.STICK,1);
ItemMeta Meta = item.getItemMeta();
AttributeModifier modifer = new AttributeModifier(UUID.randomUUID(), "generic.attack_damage", 10.0, Operation.ADD_NUMBER,EquipmentSlot.HAND /** Slot */);
Meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, modifer);
item.setItemMeta(Meta);
p.getInventory().setItem(EquipmentSlot.HAND /** Slot */ , item);
you can change some stuff around
day 3 of i dont know what im doing
ill probably have to use reflections/ annotations vs my Map<Class<?>, ContextAdapter> now
Listen to the PlayerJoinEvent and set the tablist when a player joins
i'm Lagging rn
You could have a ContextAdapter implementation which is backed by reflections.
im basically trying to create a pojo mapper for sql if you didnt know already
so i need a way to set each field of an object to a preparedstatement
and not even each column might be included in the insert query π
Ah i see. Then make sure you provide all the default adapters (for primitives, Strings, Lists etc)
and create a single ReflectiveContextAdapter which is used for classes without any context adapters registered
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
which then has a way to map each field to a db column? cuz they might not want to insert every column so calling ps::setWhatever wont work if its not in the query
Player player = e.getPlayer()
is missing
Take a look at how established orms handle this.
Hibernate is the most common one
Yeah there are quite a few important annotations because you need to define
the model at a meta layer
Otherwise you would need one table for each (non-primitive) class
And each entity always needs an id anyways
brain error moments, i feel ya!
it happens sometimes
so ye, i'd want to use @Table("...") and @Id already
Smile you are answering to fourten righ?
So for example a players data could look like this:
| playerId | name | exp | idOfLevelContainer | idOfminigameStats | ...
not yet
smth like this ig
wondering why it needs both entity and table annotation
what MultiMap?
Any reason not to extend CraftPlayer?
Map<K, List<V>> wrapper iirc?
just map`?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
?jearnlava
if you need help with plots plugin
b urh
With?
\n
How might I call an event when player clicks? I cant seem to find right or left click
thanks :)
i guess this will work to annotating a class
What tf you using this annotation for
Table
wdym what table
y
π
didnt you forget to learn how to get bitches
I did lol first mistake was starting to code second mistake was watching anime third mistake was quitting all the sports I was in
saw a few special thing today
also extends @shrewd sphinxtation Clazz
bruh
@Annotation
you dare
Yeah you can put annotations in all sorts of nonsense places
hmm
public @NotNull Map<@NotNull String, @NotNull List<@NotNull Integer>> doSomething(@NotNull String param1, @NotNull int param2) {
there must be people that code like that
I just don't bother with nullability annotations at all
@NotNull CompletableFuture<@NotNull byte @NotNull []>
I try to return null only for lookups where you'd expect to get null if nothing is found
Otherwise values are always non-null
And nullability will always be documented
yep
I always find interfaces (ik, that it's an annotation) weird to use, cause they always end up really... empty?
Mainly just use them to group classes under one common "name"
speaking of really empty
ye, some shit like that
Though I normally only use custom annotations with ClassGraph, so they often look like that
first time im actually using reflections lol
Maybe is not the correct channel but please recommend me a good tutorial for installing Bitvise SSH Sever but using Linux
I have looked 3/4 part of google and i couldnt find a tutorial
Oh
Shit that why
π€£ π€£ π€£
So i dont really know what im using on my Linux
Yes maybe
in the case of changing the armor's points, what would the string be?
dang
Just remembered that records are basically the same... Just empty
Have try reading the javadocs?
I mean the docs contain all the Atributes
been thinking recently about uh
Copilot is fucking amazing
?
Basically, y'all know when a server crashes, people can lose items/etc. for whatever reason?
Placed an expensive deco block, moved something valuable into/out of a chest, etc.
first off, there a plugin out there that compensates for this already? i'm not looking to reinvent the wheel here.
basically, vanilla data protection lmao
easier to protect plugin-specific data since the dev's in control of that one
this is a programming question
I dont know why lot of people use wrong the channel cuz they have a big description
it'll become one if no plugin exists lmao
Hey, how can I get a Player's armor? c:
Have you read the docs
Or go a fast google research
player.getInventory().getEquipment()``` or something off the top of my head
I did but I think it is kinda not working lol
but yeah honestly
or maybe I'm just not working with the armor's name properly (?) idk
googling "spigot get player armor" would probably tell you
I mean i first look what i need for 10-15m if not i ask it on Spigot channels
yeah, I've been something like 10-15m on docs
if you're new, docs probably won't help as much as google.
docs are great for people who know the ropes already and understand how to navigate the docs
generic.armor
anyways, the thing is that it keeps looking like the armor's displayname/localizedname is null idk why
Have you set the display name on the item?
No, but I thought the localized name would be set by default
also, reason I asked at all is because I don't want to hash out a discussion on something that's eben done already, but I've been thinking on implementations and wanted to pitch them here
(item.getItemMeta().hasDisplayName() ? item.getItemMeta().getDisplayName() :
(item.getItemMeta().hasLocalizedName() ? item.getItemMeta().getLocalizedName() : "some item")
It is always saying "some item"
It's not
yeah you need to specify a localization iirc
oh... how do I get the item's name if it is a minecraft vanilla name then?
I write all my plugins entirely in English so I've never run into this issue
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
Hello I want to place a torch on a wall but I canβt find out how. (api-version: 1.19)
private static void setTorch(Location pos){ Material torch = Material.TORCH; torch.setFacingDirection(BlockFace.EAST); pos.getBlock().setType(torch); }
The server only knows the english names. I recommend using chat components. Depending on what you plan on doing you might want to use Adventure
if you don't know how to convert WOODEN_HOE into "Wooden Hoe" then I would suggest a Java crash course :p
are you using an IDE
yes Intellij
hang on, let me pull mine up, because that looks real wrong
you skipped a step here
intellij should be throwing an error
yeah, I don't really mind xd it's not a user-related thing, it's more staff related
so I don't mind raw Material names
thanks for the advice tho c:
what on earth is Adventure
So oyu are coding wrongly
no? lmao
ΒΏ?
if you need a debug tool, you need a debug tool
Everything you code MUST be on english not matter if personal or public
i literally work on debug tools at my actual job
π§
are you joking π€
No
squints
the code should be, not the command sender's feedback xd
^
π€£
I have worked for a sever which i have asked $40 extra because their full code was in Spanish
i'm pretty sure you got underpaid on that one
that's literally less than what i make in an hour
lmao
but servers don't pay devs properly at all
LATAM moment
never have
that's why I said it lol
idk I'm from the US and a certain server owner threw a fit over a bill that came out to $5 an hour, then refused to pay another dev
I'm working for free so I don't mind my code either way lol (still do it clean tho)
as long as they're not demanding shit from you, you're doing them a favor at this point lmao
reasonable requests? great
"do this or you're fired"? bruh i got no stake in this place
I mean the problem there was that i need to add some things for a survival core which was like 40% done i ask then for $80 and then when i realize its was really harcoded and have variable names, methods, getters/setters on spanish, etc i charged then around $60-70 more
And i was working for Latam guy
hmm
adventure's text component API seems like Spigot just
directly yoinked it for the most part
weir
Not really
No its not
Oh conclure β€οΈ
Hi
I really miss you
[20:01:02 INFO]: 3.0 [20:01:02 INFO]: 3.0
With Armor
[20:00:47 INFO]: 4.787233829498291 [20:00:47 INFO]: 3.07605242729187
What happened with you?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
but I'm literally just glancing at it
it seems like the attribute dobules the damage
idk I don't really use spigot APIs that often unless it's protocollib
Adventure comes bundled with Paper
if the server's development team was fully spanish speaking, you kinda ripped them off π€£, but still yeah, it is a good practice to have your code in english and so do I
ah alright
that clarifies things, thanks
figured I was missing a piece here
I basically only work with Spigot for compatibility reasons so I'm generally OOTL on forks/etc.
@lost matrix
Not the aproapiate discord but: I need to get the player locale from Paper
Im doing it via reflections because i need to work on Spigot and Paper
Why reflection ;/
Reflection or reflections?
Shity paper things
declaration: package: org.bukkit.entity, interface: Player
It's a Spigot method no need for reflection
That works perfect on Spgigot but paper fucks
?
Dont spam the chat bruh
wow
what a steal
^
Don't even ask me why
Its just pastebin
Na i was really mad with the them the full facked plugin was coded in spanish
i mean arent u spanish as well
I mean i have done this:
public interface Locale {
String getLang(Player player) throws Exception;
}
Yes but i hate not following name conversions and good practices
You still haven't explained why it doesn't work on Paper?
I dont know im coding it for a client
why "throws exception"??
And he told me that not work on paper
Test it for yourself
Because of shity paper that i need to reflect it
If it doesn't work report it as a bug
Na bruh
because that's the language it's made in
I ownt even give food to eat to that shity community
there is no sign of valid java in that file
Why my plugin crash server?
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityToggleSwimEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerToggleFlightEvent;
import org.bukkit.event.player.PlayerToggleSprintEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class Stamina extends JavaPlugin implements Listener {
public static Stamina plugin;
FileConfiguration config = this.getConfig();
int stam;
int wasterun = config.getInt("waste-of-stamina-run");
int wasteswim = config.getInt("waste-of-stamina-swim");
int wastefly = config.getInt("waste-of-stamina-fly");
int wastewalk = config.getInt("waste-of-stamina-walk");
int efslow = config.getInt("when-effect-slow");
int regen = config.getInt("regen-of-stamina");
int maxstam = config.getInt("max-stamina");
int sum;
@Override
public void onEnable() {
plugin = this;
Bukkit.getPluginManager().registerEvents(this, this);
this.getConfig().options().copyDefaults(true);
this.saveDefaultConfig();
}
public void EfSlow(Player p) {
if (stam <= efslow) {
p.setWalkSpeed(0.1f);
p.setFlySpeed(0.05f);
} else {
p.setWalkSpeed(0.2f);
p.setFlySpeed(0.1f);
}
}
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
sum = maxstam;
int pon = 1;
while (pon == 1) {
p.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("Stamina: " + sum + " / " + maxstam));
}
}
@EventHandler
public void onRun(PlayerToggleSprintEvent e) {
Player p = e.getPlayer();
if (p.isSprinting() && !p.getGameMode().equals(GameMode.CREATIVE)) {
sum = maxstam - wasterun;
}
}
@EventHandler
public void onSwim(EntityToggleSwimEvent e) {
if (e.getEntity() instanceof Player) {
Player p = (Player) e.getEntity();
if (p.isSwimming() && !p.getGameMode().equals(GameMode.CREATIVE)) {
sum = maxstam - wasteswim;
}
}
}
@EventHandler
public void onMove(PlayerMoveEvent e) {
sum = stam;
Player p = e.getPlayer();
Location from = e.getFrom();
Location to = e.getTo() ;
if (from.getX() > 0 && from.getZ() > 0) {
sum = maxstam - wastewalk;
} else if (from.getX() == 0 && from.getZ() == 0) {
sum = stam + regen;
}
}
@EventHandler
public void onFly(PlayerToggleFlightEvent e) {
Player p = e.getPlayer();
if (p.isFlying() && !p.getGameMode().equals(GameMode.CREATIVE)) {
sum = maxstam - wastefly;
}
}
@Override
public void onDisable() {
saveConfig();
}
}```
PASTE
?paste
?paste
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Infinite while loops :kekw:
nah not really
yes lamo they sucks even more than me being on my period
Looks like a Roblox Lua dev
man never heard about access modifiers
No idea what you are doing
int pon = 1; while (pon == 1) { p.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("Stamina: " + sum + " / " + maxstam)); }
but yes, it's very identical to how a '_G' keyword 0 brain cell idiot would code in Lua
scheduler api smh
people instantiating bukkitrunnables for no reason π
Hey
You never answered me
Sorry for pinging
How do you assign values from dbs to models without using reflections?
I mean
context
i dont understand
You always mention context, context
You need to talk with a context!!
π€£
honestly im scrolling thru forums rn
and why are people associating "async" with performance
"async" has become a magic word that means performance in the Spigot community
So many unsafe forks makes everything async without caring about safety
Memory fences neither :<
What happened with you bro?
I havent seen you in a long term
do you remember the times where people called you "cocklure"
Also my condolences
that was like a year ago? idk
I really know what you happening thru
Oh god
lol
??
Me?
he was replying to me verano
I started playing some games
.
.
also what happened to conclure
I started playing games
wdym condolences
And got forced to watch one piece
i dont think u offer condolences to somebody whos having fun watching anime and playing games lol
It's a debug, simplified I tested in the EntityDamageByEntityEvent, and basically when you use the armor with the attribute modifier, you get more damage
But ye verano dont worry :)
im bored god
also conclure i kinda wanna start watching one piece
but it kinda ticks me off how the characters barely have any personality
I really miss you
like i wouldnt care if any of them died
I remember all the talks wehave and we i really need someone you were with me
I also started to play PUG mobile on BlueStacks
Why though
i think you mean pubg
PlayerUnknown's Battlegrounds: Battlegrounds
It exists :p
Yeah :p
yeah
Brendan sucks at naming wtf
just repeat the last word in ur title after a colon and boom
free name
how did u do it?
im doubting thats the reason it dropped 400mb lmao
thats 400 million bytes
You must have messed up real bad for it to take 400mb
thats a normal way
That's not going to take much memory
One is a better practice
especially in this example
bukkit plugins main classes are always singletons
by completing the singleton pattern, ur doing nothing wrong
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
i think they use that shit to hire people or something
lmao
its an invite only challenge
that's an invite only challenge yeah
The worldβs search engine monster analyzes your search history to provide you access to an invite-only challenge called βThe Google Foobarβ challenge. And if youβve received one, many congratulations; you should have realized that this isnβt just any invitation; itβs one that Google issues to a select group of developers.
if you finish all of the questions successfully
you might get contacted by a google employee
for an interview
bro just got an invite from the world's biggest tech company
go do it
u never know what u wanna do in the future
π
If you actually get hired you can be set for life
yeah
π
A friend I taught to code a few years back now works for Google.
Keep going, you'll at least learn something
eh
they probably review ur answers even if u asnwered correctly
so no
but god damn
that makes me sorta angry
i wish they sent u that like
4 years in the future
when ur an adult
i did
i did for years
I've searched at lot for years as well
never got soemthing like that
They are both common programming languages
because they want java developers
google uses java a lot
unlike python tho
they do use it, but not as much as java
as ive heard
I found the vanilla values for food and their hunger and saturation values, but it's all obfuscated. Is there any way to get this through the API, like through the Material?
I either need this data or a way to shorten the eating animation time.
Making a feature where you can eat food quickly if you're wearing a pig's head.
You can unobfuscate it with mappings
Would that make my code version specific then?
Yes
Damn. Alright, I'll look into that
Im taking data from .yaml file. Why just data stay in variabel even after restart of whole server? Data in .yaml and data in variabel are difrent. Just data get from variable should be same as data in .yaml file.
.yaml
fertilizer:
basic:
material: COCOA_BEANS
Code:
public static ConfigurationSection yamlFertilizersSection;
public static Set<String> yamlFertilizers;
yamlFertilizersSection = this.getConfig().getConfigurationSection("fertilizer");
yamlFertilizers = yamlFertilizersSection.getKeys(false);
for (String fertilizers : Main.yamlFertilizers ) {
player.sendMessage("CustomModelData: " + Main.yamlFertilizersSection.getInt(fertilizers + ".customModelData"));
player.sendMessage("YAML CustomModelData: " + Main.inst.getConfig().getInt(fertilizers + ".customModelData"));
}
Output:
Weird it doesnt display the domain info
I mean with youtube does it
is it fine to use a different Logger instead of JavaPlugin#getLogger()?
Cert fail @tender shard
You can use what you want but it's recommended to use the plugin logger
or will I still get the spigot message I get when I use println
guess not
ok ty
Thread pictures still not showing ?
he might not have metadata set in his html
ok nvm its the ssl

this whole evening was like creating code and then realizing i dont need it
love those days
Can someone help me with this error? One error also comes when disabling.
[23:12:31 ERROR]: Error occurred while enabling EssentialsCore v1.1.2
java.lang.NoClassDefFoundError: ml/kumina/Core
at me.kumina.Main.onEnable(Main.java:13) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[patched_1.8.8.jar:git-PandaSpigot-52]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) ~[patched_1.8.8.jar:git-PandaSpigot-52]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:445) ~[patched_1.8.8.jar:git-PandaSpigot-52]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:359) ~[patched_1.8.8.jar:git-PandaSpigot-52]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:318) ~[patched_1.8.8.jar:git-PandaSpigot-52]
at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:439) ~[patched_1.8.8.jar:git-PandaSpigot-52]
at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:403) ~[patched_1.8.8.jar:git-PandaSpigot-52]
at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:358) ~[patched_1.8.8.jar:git-PandaSpigot-52]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:301) ~[patched_1.8.8.jar:git-PandaSpigot-52]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:603) ~[patched_1.8.8.jar:git-PandaSpigot-52]
at net.minecraft.server.v1_8_R3.MinecraftServer.lambda$spin$0(MinecraftServer.java:133) ~[patched_1.8.8.jar:git-PandaSpigot-52]
at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.ClassNotFoundException: ml.kumina.Core
at java.net.URLClassLoader.findClass(URLClassLoader.java:476) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:102) ~[patched_1.8.8.jar:git-PandaSpigot-52]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:87) ~[patched_1.8.8.jar:git-PandaSpigot-52]
at java.lang.ClassLoader.loadClass(ClassLoader.java:589) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
... 13 more
How
They're most likely just not providing the correct class within the plugin.yml
copy paste contents
now back to screwing w/ mob spawners lmao
It is
depends on main class name tho
what is the name of your class which extends javaplugin
it gets called so ig they are using a core api which isnt shaded: me.kumina.Main.onEnable
Main
what's it folder
spigot which gives access to 1.8 version and using java 11
it's me.kumina.Main
should be smth like: main: me.kumina.projectName.Main
then why is server seacrhing /Core folder
you messed up class path in yml
or in ide
their Main.onEnable gets called and i believe the error message would say that the main class couldnt be founded otherwise, so isnt the issue that they didnt shade their api cuz ml/kumina/Core or whatever couldnt be found?
idk its late im just saying smth
Does the api need plugin.yml btw
It's like a plugin, but used as an api
then it needs its own plugin.yml and make sure to depend on that api then
by adding depend: name-of-plugin or soft-depend whatever
and do I then need to add the api and the plugin to the server or just the plugin
both
Okay
Hi. Does anyone know why from about 3 minutes i can't compile my plugin because it says that every class doesn't exist while actually it does. Please
Make sure that package exists
I see 2 different package locations
1 ending with weapon_data and the other with weapon
there is probably an invalid package name at the top of a java file
where it specifies the package
no no
its all the classes
while intellij gives me absolutely no error
when i try to compile
it makes errors out of nothing
Is there an event (or way to know) when the server is reloaded?
Using the /rl command ^
Doesn't onDisable() get called when the server restarts though?
hm ok
I just wanted to make a way to notify players when the plugin is reloaded and that they need to restart the server for things to work properly, sort of how essentials does it. Thanks.
you can check whether the server reloads by checking in plugin::onLoad if Bukkit.getWorlds().size() > 0, meaning the server is resloading cuz worlds are still loaded
Are you doing new MyMainClass()
I do fileName(Main.getPlugin()); and it sends that. id been doing dependency injection b4 without issue
it might not actually be the di. im kinda guessing
Afaik the only thing that causes that is trying to instantiate your main class
if the config is updated with FileConfiguration.set, does it need to be reloaded for the value to be updated when getting it?
FileConfiguration is like a Map in memory. Setting a value in it means you get the same value again given the same path.
FileConfiguration is a map for crazy people
pro tip: convert it to a Map<String, Object> because you aren't like the other normies
haha config parsing go brrrrrrr
I finally got noise cancelling headphones strong and comfortable enough that I can actually sleep with
I can't wait till I am out of this place, I swear I'm going to end up moving to the middle of nowhere just so I can have some silence
guys
Please don't use lombok :/
dont even worry about it ππ«
lombok is bae
you can't convince me otherwise
lombok is shit.
lombok is the shit
if by the shit u mean shit, then yes, lombok is the shit
you're just not used to good things
if you live in the sewer everything will smell like shit
meanwhile up here in my ivory tower everything smells like expensive roses imported from a different planet
its more cozy when u befriend the rats
no embed?

I always knew you lombok haters were rats
theres a reason they called me alrat in high school π
Agreed, especially when working with mongo
Can someone help me? I imported buildtools with all steps done percisly but my CraftBukkit player still wont import even doing it manually.
What characters aren't allowed in a plugin name?
" <, >, |, *, ?, ", : "
tried to reload maven/invalidate caches?
- what does the warning say
otherwise force clean install
is bukkit noise slow?
like audio or perlin noise
for Player#spigot()#sendMessage(ChatMessageType) what do CHAT and SYSTEM do?
For what. Just send it here.
Ok.
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Hello, I am wanting to paste a schematic repeatedly for infinity as long as players are loading new chunks, but I can't seem to do that.. heres my current code
@Override
public void onEnable() {
// Plugin startup logic
System.out.println("Backrooms Plugin enabled");
}
File file = new File("Backrooms.schem");
Clipboard clipboard;
public Backrooms() {
ClipboardFormat format = ClipboardFormats.findByFile(file);
try (ClipboardReader reader = format.getReader(new FileInputStream(file))) {
// Stuff here
} catch (FileNotFoundException ex) {
Bukkit.getLogger().severe("Schematic file doesn't exist!");
ex.printStackTrace();
} catch (IOException ex) {
Bukkit.getLogger().severe("Error reading schematic file!");
ex.printStackTrace();
}
}
@EventHandler
public void chunkLoad(ChunkLoadEvent e, int getX, int getZ) {
if (e.isNewChunk()) {
try (EditSession editSession = WorldEdit.getInstance().newEditSession(BukkitAdapter.adapt(e.getWorld()))) {
Operation operation = new ClipboardHolder(clipboard)
.createPaste(editSession)
.to(BlockVector3.at(getX * 16, 40, getZ * 16))
.build();
Operations.complete(operation);
}
}
}
@Override
public void onDisable() {
// Plugin shutdown logic
System.out.println("Backrooms Plugin disabled");
}
}```
Anything I could do
Right now its producing this error
org.bukkit.plugin.InvalidPluginException: com.sk89q.worldedit.extension.platform.NoCapablePlatformException: Not all platforms have been registered yet! Please wait until FastAsyncWorldEdit is initialized.
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:149) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.loadPlugins(CraftServer.java:412) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3553-Spigot-14a2382-ef09464]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:224) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3553-Spigot-14a2382-ef09464]
at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:966) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3553-Spigot-14a2382-ef09464]```
Thanks in advance
do you depend on it in your plugin.yml
looks like FAWE isnt initialized yet
I did depend on it
isnt it like actionbar vs chat
I made a work around, but it doesn't seem to actually paste the schematic if I implement the work around
This is the code for the work around
@Override
public void onEnable() {
// Plugin startup logic
System.out.println("Backrooms Plugin enabled");
}
File file = new File("Backrooms.schem");
Clipboard clipboard;
@EventHandler
public void chunkLoad(ChunkLoadEvent e, int getX, int getZ) {
ClipboardFormat format = ClipboardFormats.findByFile(file);
try (ClipboardReader reader = format.getReader(new FileInputStream(file))) {
// Stuff here
} catch (FileNotFoundException ex) {
Bukkit.getLogger().severe("Schematic file doesn't exist!");
ex.printStackTrace();
} catch (IOException ex) {
Bukkit.getLogger().severe("Error reading schematic file!");
ex.printStackTrace();
}
if (e.isNewChunk()) {
try (EditSession editSession = WorldEdit.getInstance().newEditSession(BukkitAdapter.adapt(e.getWorld()))) {
Operation operation = new ClipboardHolder(clipboard)
.createPaste(editSession)
.to(BlockVector3.at(getX * 16, 40, getZ * 16))
.build();
Operations.complete(operation);
}
}
}
@Override
public void onDisable() {
// Plugin shutdown logic
System.out.println("Backrooms Plugin disabled");
}
}```
This one doesn't produce an error
But it doesn't paste my schematic either
My goal is once again to paste the schematics side my side infinitely.
if its inifinite you could just make your own world generator
I'm new to java
Just started
This was the easiest solution
For me
Ig
public Backrooms() {
ClipboardFormat format = ClipboardFormats.findByFile(file);
try (ClipboardReader reader = format.getReader(new FileInputStream(file))) {
// Stuff here
} catch (FileNotFoundException ex) {
Bukkit.getLogger().severe("Schematic file doesn't exist!");
ex.printStackTrace();
} catch (IOException ex) {
Bukkit.getLogger().severe("Error reading schematic file!");
ex.printStackTrace();
}
}
howcome you have a constructor?
I'm sorry whats a constructer
the thing i just posted
I'm not sure
It didn't let me use public void
So I just took the void out
And I did try my own wolrd generator
public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
SimplexOctaveGenerator generator = new SimplexOctaveGenerator(new Random(world.getSeed()), 8);
ChunkData chunk = createChunkData(world);
generator.setScale(0.005D);
for (int X = 0; X < 16; X++)
for (int Z = 0; Z < 16; Z++) {
currentHeight = (int) (generator.noise(chunkX*16+X, chunkZ*16+Z, 0.5D, 0.5D)*15D+50D);
chunk.setBlock(X, currentHeight, Z, Material.GRASS_BLOCK);
chunk.setBlock(X, currentHeight-1, Z, Material.DIRT);
for (int i = currentHeight-2; i > 0; i--)
chunk.setBlock(X, i, Z, Material.STONE);
chunk.setBlock(X, 0, Z, Material.BEDROCK);
}
return chunk;
try (EditSession editSession = WorldEdit.getInstance().newEditSession(BukkitAdapter.adapt(e.getWorld()))) {
Operation operation = new ClipboardHolder(clipboard).createPaste(editSession).to(BlockVector3.at(16* chunkX, 40, 16*chunkZ)).build();
Operations.complete(operation);
}
}```
oh you cant have a method that is the same name of the class
@raw prairie you didn't register listener so you event as never called
How do I register the listener
With pluginManager
So whut should I do
It doesn't work regardless lol
getServer().getPluginManager().registerEvents(new Event class name(), this);
Event classname?
You put this
Yea I put it in startup logic
So getServer().getPluginManager().registerEvents(backrooms(), this);
K
Is that all that should make it work?
Other than removing the method
Thats the same name as the class
@pearl glade
Wait what do I do with the method then??
Should I delete it, rename it
?
Do i remove/rename/something else the method
You could remove other parameter into method and that working
Other parameter?
Yep, getX and getZ
Can you show me, cause I'm kinda slow
XD
I am broπ π π π
You see ?
Another reason this should been done in dms cause I'm slow as fuck
So remove the pasting logic and put it into public void onchunkload
@EventHandler
public void chunkLoad(ChunkLoadEvent event)
Xd
Anything else needed to be fixed
Yep, np
I believe so.
Just not sure on the difference between CHAT & SYSTEM lmao
I'd test it myself, but I've got more important things to do which means it's easier to just ask lol
i want to give the player a book with text in it. how do you set the data? it crosses it out when i type it (yes i know its deprecated) and even if it didnt i dont know how to use it.
edit: i partially found out how to do it.
?jd-s for me self
still going on guesses here but--if i had to guess, it might correspond with the clients ability to toggle certain levels of chat
CHAT is probably standard player chat
SYSTEM is most likely server system messages (still shown in normal chat window)
and ACTION_BAR is... well... action bar
Ah
can fuck around and find out in about T-10 minutes
i think its up to the server to not? normally send chat to someone who has it disabled but idk
π€·ββοΈ
Use BookMeta#setPages iirc then set the item meta to this book meta
Can I not update a inventory when scheduling it after a inventory tick event?
I schedule a inventory update one tick later when a inventory click event happens, but any kinds of inventory changes do not get applied
when you call update you are likely using the old instance and overwriting changes
Of the block?
I always get the inventory from the block before modifying and calling update
Or does a block object keep a instance of its state and inventory
state keeps the inventory
block keeps the state
thing is it's a new instance every time you call getBlock
and any changes just update the internal nms handle
So I have to re-fetch the block every tick in my task
ehh not really
It just keeps a reference of its internal handle
It's basically a fancy wrapper
You're fine with reusing it
Then what causes my issue above
Uhh you might be opening an inventory copy lmao
public BrewingTask(BrewingRecipe recipe, BrewingStand block) {
this.recipe = recipe;
this.block = block;
this.brewTime = recipe.getBrewingTime();
if (block.getFuelLevel() > recipe.getFuelCost()) {
block.setFuelLevel(block.getFuelLevel() - recipe.getFuelCost());
} else {
int rest = recipe.getFuelCost() - block.getFuelLevel();
block.getInventory().setFuel(decrease(block.getInventory().getFuel(), 1 + rest / 20));
block.setFuelLevel(20 - rest % 20);
}
block.setBrewingTime(DEFAULT_BREW_TIME);
runTaskTimer(Adapt.instance, 0L, 1L);
}```
I am not
The blocks fuel level is updated just fine
The fuel item is not
And no, my decrease function is not it since I cannot even null it
are you updating the fuel inside the runnable?
No
But I can update the inventory fine inside of it
BrewingTask itself is the runnable
But this is merely the constructor
Try updating it inside the runnable
also calling updateInventory to all viewers helps sometimes
It makes no difference
HashSet
There is also a problem where I am unable to remove the fuel item from the slot
It gives the item stack to the cursor, but immediatly sets the fuel slot back to the previous state
public void run() {
BrewerInventory inventory = block.getInventory();
if (brewTime <= 0) {
inventory.setIngredient(decrease(inventory.getIngredient(), 1));
for (int i = 0; i < 3; i++) {
if (recipe.getBasePotion().equals(inventory.getItem(i)))
inventory.setItem(i, recipe.getResult());
}
inventory.getViewers().forEach(e -> {
if (e instanceof Player p)
p.playSound(block.getLocation(), Sound.BLOCK_BREWING_STAND_BREW, 1, 1);
});
cancel();
return;
}
brewTime--;
block.setBrewingTime(getRemainingTime());
block.update(true);
}```
This is the runnable for reference
Run once per tick
kthx
Updating the items when the brew time hits zero works without issue
Moving the constructor code to it as well still fails to update the fuel however
is there like
a mathematical formula with cos and sin that can achieve this shape lmao
its fine if 24 and 25 have to be set manually
I'd probably just say for loops
Logging before and after the update of the armorstand shows that it indeed updates the inventory apropriately
The screen however remains unchanged
try calling updateInventory
I have, to no avail
that might be better than all the if statements honestly
updating the block is the culprit
It resets the inventory to its state before changing it
tru I just assumed maths could save me
Which does not line up with what you have said
cus its kinda like this
don't call block.update()?
I need to update the block for its metadata to update
well i once coded something which required modifying block
it didn't work so i removed all .update()
and it started working
for some reason
don't even remember what i coded
And as someone who is doing this constantly, I can tell you that modification to the blockstate are not synced to the client when you don't update the block
i mean there is no sync between what you see and what server offers
sometimes
there was a topic on spigotmc about it
somewhere
month or two ago
The visual aspect is completely irrelevant
The inventory is a part of the server, not the client
i mean i just called it visual bug
not because it's actually LWJGL bug
but just desync
which affects what you see on the screen
You are not listening to what I am saying
So there are two things that are potentially happening here
A: I need to update the inventory state first before calling update
Or B: The block instance keeps a immutable copy of the inventory that gets processed when calling update
OK, progress
It looks like the inventory is being disassociated from the block by doing getInventory
block.getInventory().getHolder().update() does nothing
To which I have to say
What the actual fuck
Lombok is shit
Upon the first iteration, getHolder returns the block instance which was actually passed to the task
But every subsequent iteration references a completely different block
There is only ever one instance of a Bloc, but they can have snapshots.
BlockState
a State will be different to a Block instance
it can;t be
a block instance will always be the same so long as its chunk is loaded
@Override
public void run() {
BrewerInventory inventory = block.getInventory();
if (brewTime <= 0) {
inventory.setIngredient(decrease(inventory.getIngredient(), 1));
for (int i = 0; i < 3; i++) {
if (recipe.getBasePotion().equals(inventory.getItem(i)))
inventory.setItem(i, recipe.getResult());
}
inventory.getViewers().forEach(e -> {
if (e instanceof Player p)
p.playSound(block.getLocation(), Sound.BLOCK_BREWING_STAND_BREW, 1, 1);
});
cancel();
return;
}
brewTime--;
block.setBrewingTime(getRemainingTime());
Adapt.warn(inventory.getHolder().toString() + " | " + inventory.getHolder().getLocation());
}```
block never changes
As seen here, the block given to the task remains the same
First and constructed
so if I have like x = 10 b = 50 how would I calculate what % of B; X would be
The inventory is fetched from that using block.getInventory
And yet after the first iteration, the holder of that inventory does not reference the original block anymore
So what is going on
It's literally final
nvm I found this
if I use getConfigurationSection on a value like test: 123, will it return null?
yes, that is not a section
Just making sure
You should be able, but without running code myself I can;t advise
too busy at the moment
What makes it even weirder is that the inventory in the <= 0 block actually updates correctly
Literally the only two things I am doing right now is java Adapt.warn("First: " + block.toString()); Adapt.warn("Holder: " + block.getInventory().getHolder().toString());
And it still disassociates
I have removed everything else
Meaning that after the first getInventory call to the BrewingStand interface, it returns a interface with a different owner
This has to be a bukkit bug
does have jave something like js map.get(1) | 2 // Incase map.get(1) doesnt exist
getOrDefault
ty
int totalXP = this.skillValues.get(skillType); // Total XP for skill
int current_level = this.skillTracker.getPlayerSkillLevel(this.uuid, skillType); // Total XP Required for current level
int next_level = this.skillTracker.getSkillXp().get(current_level + 1); // Total XP Required for next level
int current_next_level_xp = totalXP - this.skillTracker.getSkillXp().getOrDefault(current_level -1, 0); // Current XP removing previous level's XP
return (100*current_next_level_xp)/next_level;```
this is
my current code
I dont think its working very well
what is A exactly
oh bruh i found that number before by accident
alright
say the total XP for level 2 is 1000 and the player has 1500 XP at the moment and level 1 took 500 total XP I want the % the player currently is from level 1 to level 2
how do you get the entire command contents on execute
like for example: /customcommand firstargument and a lot of random text with spaces between
and i need to get the entire command and cut off the first part and get from it just the "and a lot of random text with spaces between"
wait what
my example was scuffed you have gained 100% of the XP
Level 2 = 1000
Level 1 = 500
Player XP = 1500```
lol
can I add a constructor to my plugin, as long as it is public and with no args?

ye
nice
?tas
yeah
ty
it used to be ?tias but they changed it
I did know it would work sort of, I checked the plugin class loader, wanted to make sure
tool assisted speedrun?
ong true
imagine the domain holder changes it to porn or some gore shit
and we all would still use it
still confused about why it stopped embeding
cafebabe perms
because its the bot
it used to embed
fix it
right so
I have
------------------
Total XP: 10
Current Level: 0
Next Level: 50
Current Next Level XP: 50
Remaining XP: -10
------------------```
int totalXP = this.skillValues.get(skillType); // Total Player XP for skill
int current_level = this.skillTracker.getPlayerSkillLevel(this.uuid, skillType); // Total XP Required for current level
int next_level = this.skillTracker.getSkillXp().get(current_level + 1); // Total XP Required for next level
int current_next_level_xp = next_level - this.skillTracker.getSkillXp().get(current_level);
System.out.println("------------------");
System.out.println("Total XP: " + totalXP);
System.out.println("Current Level: " + current_level);
System.out.println("Next Level: " + next_level);
System.out.println("Current Next Level XP: " + current_next_level_xp);
System.out.println("Remaining XP: " + getRemainingXp(totalXP));
System.out.println("------------------");```
Total XP is correct, Current Level is correct, Next Level is correct, Current Next Level XP is Incorrect, Remaining XP idfk how it became negative its incorrect
Current Next Level XP should be 10 and Remaining XP should be 40
one sec I have discovered my formula for getting the player level is flawed
WebSocket ws = new WebSocket("127.0.0.1", 8080);
AsyncWebSocket websocket = ws.async().open();
websocket.getEvents().register(new WSListener(this));
websocket.getPackets().register(User.class);
Future<WSResponse> response = websocket.send("/api/v1/users", new User(UUID.random(), "test"));
Sout("Sever response " + response.getCode() + ":" + response.getText());
Ah yes... what am I looking at?
someone who forgot ` exists
They forgor
alright I fixed it this is the final solution ```java
int totalXP = this.skillValues.get(skillType); // Total Player XP for skill
int current_level = this.skillTracker.getPlayerSkillLevel(this.uuid, skillType); // Total XP Required for current level
int next_level = this.skillTracker.getSkillXp().get(current_level + 1); // Total XP Required for next level
int current_next_level_xp = totalXP - this.skillTracker.getSkillXp().getOrDefault(current_level, 0); // Total XP Required for current level
what is a good icon to indicate attack speed?
and most importantly what is a good color for it xD
white?
White seems fine, how about a sword with some curved lines to indicate that its being swung?
Does anyone know how to use ClientboundDeleteChatPacket?
you wanna delete messages?
Yeah..
doesnt it only work for signed messages tho?
1.19.1+ too
just do a venturechat move and have a linkedlist of messages
i have a custom system too
limit it to 500 packets / player type deal
yeah it stores a list of previous messages and gives each one an ID
then that messages is excluded from list and everything else is resent
staff also sees the deleted message
that packet you mentioned doesnt seem documented on wiki.vg?
something like
@Data
@AllArgsConstructor
public class WrappedMessage {
private final UUID id;
private final Component component;
private final UUID sender;
}
public class MessageChain {
private static final int MAX_SIZE = 500;
private final Deque<WrappedMessage> list = new LinkedList<>();
public void send(WrappedMessage message) {
list.add(message);
if(list.size() > MAX_SIZE) {
list.pollFirst();
}
}
public void delete(WrappedMessage message) {
list.remove(message);
}
public Collection<WrappedMessage> getAllMessages() {
return list;
}
}
type deal
tf are those annotations
lombok
makes getter, setter, equals, hashcode
RequiredArgsConstructor
And AllArgsConstructor which makes a constructor with all fields
Someone hates industry standards π³
Imagine if lombok was actually bad no one would use it
Too bad that's not reality huh
I would not call Lombok an industry standard
Especially when you can replace most of its commonly used features with a record these days
tho I must say, @Delegate my beloved
lombok is just getters ??
lombok good
hey i want to check in a lore if a string is inside but I'm with paper and I don't find the method to do that someone have already do that ?
Just use persistent data I see no reason for needing lore comparisons here
never use this but I go learn it π thx you
exists discord Protocollib?
Sure, I can try
for example LuckPerms have discord
how work ListenerOptions.ASYNC?
I want make async processing