#help-development
1 messages · Page 938 of 1
I have to use Bukkit.getScheduler().runTaskTimer(plugin, new Runnable() instead of Bukkit.getScheduler().runTaskTimer(plugin, new BukkitRunnable()
Yea... I need to create a task
No, you need to create a BukkitRunnable
Thats what im doing and it says "Depreciated"
So I need this, but i need to access the new BukkitRunnable() from within the run()
this.cancel()
I tried that
it loops?
you append .runTaskTimer or runTask as you need
new BukkitRunnable() {
@Override public void run() {
}
}.runTaskTimer(plugin,initialDelay,interval);
and BukkitRunnable#runTaskTimer returns a BukkitTask
so outside the runnable you can call bukkitTask.cancel();
and inside, this.cancel();
Oh neat. Coulda sworn i needed the Bukkit.getScheduler()
yml looks like pain to look at, would you guys recommend using JSON instead ?
yml is supposed to be more friendly
well if u use its "common" style
but yeah json is fine?
Imo it is
Depends on the usage tbh
If you show a user {} they’ll think it’s programming and get scared
lol
by common style I mean the block style so
key1: value
key2:
- elm1
- elm2
ofc u can use the flow style and make it look more jsony
#crazy its valid yml
{
key: [1,2,3,{nestedKey: "sheesh"}]
epic: *anchorFromSomewheereree
}
well that looks better.
but if i need a config file i will see if can make it so people use commands to do stuff and don't need to interact with the JSON file.
if not, yml it is.
well
I think for sending and receiving data between programs and servers etc json is nice due to its stricter format, that also allows for it to be compactified
but well, all the brackets and curly brackets can make it somewhat harder to read and fiddle around with arguably
hey, is there any good way to get TPS? For now i have this, but it firstly returns 19 and after some minutes it is 20.
https://cdn.ismcserver.online/idea64_cGhPkufAHG.png
i dont see such thing
a frick, its a paper thing
btw tps is internally measured iirc
in case u dont wna measure it urself ^^
traitor
(MD has rejected it a few times)
In fairness, it is kind of a shit metric and not really anything developers should need access to
Some have argued they can disable features if TPS is too poor, but that's a really poor justification imo
they could just monitor CPU usage
yet people do and it being in the API doesn't really prevent that :P
you can try to stop people but you never really will
is it possible to defen a player? So they can't hear certain sounds?
Hm.
Maybe.
You can either /stopsound (find a way to use this in spigot; im busy)
or intercept the sound packet if applicable (I think sounds happening are client-side though.)
yeah i was going to say for example breaking blocks wouldn't that be client side
certain sounds are
What you can do is just have a resourcepack
yeah but dynamically for different players
i need help with placeholder api
ive never really used it before
im trying to save 5 values globably that dont apply to a certain player but to the whole server
how would i do that
Create a class which manages those global values, make it a singleton, pass it to your PlaceholderExpansion via the constructor.
The placeholder gets the global values from this singleton.
You can pass the singleton to other listeners or commands and change the values there.
womp womp what about a map of functions
I just dont know what the methods are called
i cant find any proper doku
except these 10 lines
https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/PlaceholderExpansion which only apply to player individual placeholders
Placeholders always have a player when resolved afaik
But you can just ignore it
oh okay
so what if people wanna use it eg in a scoreboard
oh wait
yh nvm
alr
yh i get it
then ill just do what i had before
For BungeeCord, I noticed the ServerConnectedEvent sometimes produces null when doing;
event.getPlayer().getServer(), is this intended? I wanna be able to get the server the player joins the proxy
It seems like a hit or miss if it returns null or not
[23:12:51 WARN]: Error dispatching event ServerConnectedEvent(player=DeadMan712, server=net.md_5.bungee.ServerConnection@e6a2fb8) to listener com.beanbeanjuice.simpleproxychat.utility.listeners.bungee.BungeeServerListener@ed37f28
java.lang.NullPointerException: Cannot invoke "net.md_5.bungee.api.connection.Server.getInfo()" because the return value of "net.md_5.bungee.api.connection.ProxiedPlayer.getServer()" is null
have you tried delaying it by a tick
even though it shouldn't be returning null, might be worth a try
Yes this is intended. You should get the target server from the event event.getServer()
If you want to get the Server the player is currently on when connecting to another server, then the ServerConnectEvent should be used.
How can I remove health from my NPCs
By calling Entity#damage(double) for example?
*Given they are physical and not virtual
Sorry - I meant to hide the health bar from them lol
Depends on how this health bar is achieved...
Scoreboard board = manager.getNewScoreboard();
Objective health = board.registerNewObjective("showhealth", "health");
health.setDisplaySlot(DisplaySlot.BELOW_NAME);
health.setDisplayName(ChatColor.DARK_RED + "❤");
for(User online : Server.getOnlineUsers()) {
health.getScore(online.getName()).setScore((int) online.getHealth());
}```
But i would assume that this is the health display from Scoreboards.
well simply skip npcs
they must have some kind of identifier
Why are your NPCs in the online server list?
then this code should not effect them
and are these NPCS in that custom player class?P
if so why dont they have an identifier
like
Nope custom NPC class with hella packets
well then they are in thew onlineuser list my guy
spigot wont just decide to put them there to bully you
i list the online users and its only 1 (me)
maybe it was set previously and never got removed?
usually the TAB plugin causes this with citizens
no plugins beside mine
.
thats really the only 2 options i can imagine
either it was already there
or your code sets it which requires them to be in the online users list
or there is some other code snipped u didnt show us that causes this
Removing the scoreboard entirely does remove the health so it has to be within there
NPC doesnt have it now but neither do i
well
i could analyse your whole code base now
but fact is
npcs seem to be inside Server.getOnlineUsers
thats the only possibility explanation
If I'm wanting to make a crop field that players share, but the wheat blocks are unique to each player, in a sense that players can only see and break their own wheat fields, would I use ProtocolLib 🤨 I'm so outdated it hurts
Spigot has a method for sending "fake" blocks to players by using
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Player.html#sendBlockChange(org.bukkit.Location,org.bukkit.block.data.BlockData)
declaration: package: org.bukkit.entity, interface: Player
Ok that makes sense, I saw that function mentioned in a 2018 post but I remember the SpigotAPI tend to go--- DEPRICATED every time you'd find something
The hard part will be listening to breaking those blocks, since the server has no idea that a player sees a block at this position, which means it will simply disregard packets by clients
which suggest they broke a block at that position.
Workaround: Actually spawn wheat there and make sure it doesnt get broken by players.
This will ensure the Spigot event being fired if they break a fake block.
I'm in the process of updating an old plugin that used some old imports like net.minecraft.server.v1_16_R3.EntityCow, net.minecraft.server.v1_16_R3.EntityTypes, etc. to 1.18.2. Would anyone know where I could go to find what those classes became in the Mojang mappings?
Thank you 🙂
Is there a bungee economy plugin thats open source?
Click on the 1.16.5 package, check your nms import, lookup the mojang name for it, go to 1.18.2 and pray its the same
(istg this is related to development)
like one that manages currency directly on bungee
Bridged for Vault?
I would just write one then. What do you need this for?
basically what I'm trying to do is make a currency managed on the proxy that servers can use plugin messaging with the bungee and ask for players balance and to give them confirmation
Sounds good, what do you need the other plugin for?
my network works on a model where users can have their servers connected to it, hence why I need to give the players confirmation
just to look at for an idea of what to do
I haven't seen any currency plugin directly managed on the proxy before
Maybe the proxy is not the proper place for that.
If its for your own network then you might consider using Redis and store the data in a Database.
The thing is, I can't trust the backend server's word when it comes to currency transfer
I was gonna make the proxy send a GUI or a book ui that makes the player confirm their transaction
Ah i see what you mean
So players can dynamically attach their servers to your network?
with staff confirmation yes
currently we have joins closed so users can't attach their servers (we're rewriting our plugin for the backend servers)
the new system lets us dynamically attach servers with a tokenized system
the backend server connects to bungee first then negotiates attachment with a secret token issued to the server
You might want to consider a standalone application as well.
But that would require a decent project setup.
What part of the currency management is troubling you?
if that goes fine then it gets connected as a bungee server
Never wrote a currency plugin before.
The core is just a mapping from UUIDs to a Number.
Alright.
The main hurdle will be the asynchronous nature of it
https://www.spigotmc.org/threads/bungeecord-messaging-with-callbacks.562809/
This might help for your messaging system
Should I clone a known currency plugin's API for the spigot side?
so its compatible with plugins like EconomyShopGui immediately?
Hi 7smile7, I'm just having some trouble doing the conversion. I will give an example:
I have the import net.minecraft.server.v1_16_R3.EntityZombie. I can use this in my code as follows:
private EntityZombie camera = new EntityZombie(((CraftWorld) player.getWorld()).getHandle());
camera.setInvisible(true);
camera.setLocation(centerLoc.getX(), centerLoc.getY(), centerLoc.getZ(), 0, 0);
Eventually, this was used to have the player spectate the zombie.
When I change this import to the class listed here, https://mappings.cephx.dev/1.18.2/net/minecraft/world/entity/monster/Zombie.html
'net.minecraft.world.entity.monster.Zombie', I no longer can either create a new EntityZombie using a CraftWorld, and I also lose access to the setInvisible and setLocation methods. Do you have any advice?
All economy plugins are bridged with Vault. But since Vault only allows sync currency management, and your system is inherently async, you wont be able
to have direct compatability with Vault plugins.
Can there be multiple vault currencies?
Sure
Do you think its safe to have the backend server ask for the player's balance when they join?
Since a player can only be on one bungee server at a time
Wait... I'd still need to have a way to delay whatever action is done until the player confirms
so I do need to stay async
I was eyeing playerpoints to see if it would be plausible to clone its API
how can i Apply the edits done in the config without Reloading the whole server
You can create a reload command specific for your plugin.
which reloads the config and makes any necessary updates
so you can do /myreallyverycoolplugin reload without using /reload.
i think there's a dedicated plugin.reloadCOnfig()
I am starting to get rather tired of writing for loops, I wish there was a faster keyword for them
IntStream.range(0, 10).forEach(i -> {
});
/s
like
until(x == 10){
//blah
}
would start an x integer at 0 and make it go up till it is equal to 10
This is the most python-ish java I've ever seen
for loops are cool because they are flexbile but realistically just how many times do we just need to go from 0 to a certain number
Go to kotlin, add a times method to Int and do
10.times{ it -> }
Last time I looped from 0 to a number was when I was debugging my system by adding a lot of stuff to it
that's actually kinda cool
is it breakable?
I'm making a small game prototype and I feel like going from 0 to a number is half of the entire codebase I've written
initialize map sizes, initialize objects, initialize pools so on so forth
with something like spark framework, how do you organize stuff so it isnt in one huge method?
i bet u could split up each lambda for each route
even can leave the lambda parameter out
10.times{ println(it) }
but probably gonna just stick with
(1..10).forEach { println(it) }
:D
10.times(::println)
ye was thinking about it but u cant method reference in lambda like that but didnt realize u can just remove the lambda:D
I hate this...
i love it
i love it
who knows how to use WorldGuard? I registered a flag on their wiki, but how can I check if the player is in a region where there is such a flag?
But what next? How can I find out if it is there? what to do with State?
yeah, i used this
Where did you register the flags?
but what kind of class is this?
JavaPlugin
😯
Press ctrl + O and look what methods you can override
never heard about "onLoad"
You learn every day when programming
yeah
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
My code is doing something very weird where the invincibility frame reduces from 10 ticks to 0 after shooting a player a couple times lol
Like I found out that something removed the i-frame and have been trying all day to find the cause lol
Apparently I'm doing something with bows and gotta go figure it out now
hi , uhh i found a glitch ..
so when i click on the item to fast , it may or may not get the items to my inventory
how i can disable it?
this is only preview items menu so player should not be able to take any item
don't rely on events soley
?_?
use a task that constantly checks the inventory
HUH?
not sure why that is hard to grasp
check what exactly?
that they didn't take an item
Yeah lmao
alr thanks
when the custom inventory is opened
start your task
check that the inventory they had, is still the same and no extra items
if it has changed, change it back
Not sure if spigot has drag event, but if it does, check on it too (It's a drag event when it clicks quickly and moves most likely)
don't really need it with a 1 tick repeating task
all you need to do is capture the state of the players inventory when the gui is opened
check the state captured with the current state
if they don't match, change it back to the state captured initially
cancel the task once the gui is closed 😉
how do i get a player's name with a uuid when he has never played on the server before?
believe offlineplayer should do the trick
it returns null
You need to fetch the player profile
ok
but only in creative
shouldnt be possible in survival
Good
this is more or less a useless workaround. cool to have, but easily to bypass by just clicking faster and closing the inventory
Hey, so I just started working with ProtocolLib and I send OPEN_SIGN_EDITOR packets to the player when the player sends CHAT packets containing "Sign", but the problem is that after this has happened once during the time the player is online, if the player sends any message that doesn't contain "Sign" they get kicked for "Chat message validation failure". Does anyone know why this is happening?
@Override
public void onPacketReceiving(PacketEvent event) {
PacketContainer packet = event.getPacket();
String message = packet.getStrings().read(0);
Player player = event.getPlayer();
Location location = player.getLocation();
System.out.println(message);
if (message.contains("Sign")) {
event.setCancelled(true);
player.sendMessage("Opened Sign");
PacketContainer sign = new PacketContainer(PacketType.Play.Server.OPEN_SIGN_EDITOR);
sign.getBooleans().write(0, true);
sign.getBlockPositionModifier().write(0, new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ()));
manager.sendServerPacket(player, sign);
}
}```
- bug prone, f.e. when you get an item dropped it will get removed
just check the inventory after its closes then, I suppose you could try clicking faster then 10ms
canceling the event entirely should do the trick
otherwise get on protocol level and check it there
no, relying on the events only is how you get the bugs
but that shouldnt be needed
bugs which only occur in creative
?gui
and if you give your players creative access you have other problems then duplicating items from a menu
I used this for a while now and haven't had any issues with it
for inventories
Lol
bro 💀
anyways what i forgot to say, make sure to cancel the inventorydragevent as well since sometimes the click event isnt called but drag is
guys, please help me with algorythm that converts playerHp to String
lul
I've already spent an hour and it doesn't work.
private Component getHearts(Player owner){
StringBuilder string = new StringBuilder();
Component result = Component.text("");
FontImageWrapper heart = new FontImageWrapper("green_tavern:heart");
FontImageWrapper halfHeart = new FontImageWrapper("green_tavern:half_heart");
FontImageWrapper noneHeart = new FontImageWrapper("green_tavern:none_heart");
int hp = (int) Math.round(owner.getHealth());
int maxLines = (hp / 20) + ((hp % 20 == 0) ? 0 : 1);
int fullLines = hp - maxLines-1;
int remainHp = hp - (fullLines * 20);
int fullHP = remainHp / 2;
boolean hasHalf = (remainHp % 2) == 1;
int empty = 10 - (fullHP + (hasHalf ? 1 : 0));
Component fullLine = Component.text(heart.getString().repeat(10));
for (int i = 0; i < fullHP; i++) {
string.append(heart.getString());
}
if (hasHalf) {
string.append(halfHeart.getString());
}
for (int i = 0; i < empty; i++) {
string.append(noneHeart.getString());
}
result = result.append(Component.text(string.toString())).appendNewline();
for(int i = 0; i < fullLines; i++){
result = result.append(fullLine);
if((i + 1) != fullLines){
result = result.appendNewline();
}
}
return result;
}
``` now it has code smth like this
public String createHealthBar(int currentHp, int maxHp, String fullHeart, String halfHeart, String emptyHeart) {
int fullHearts = Math.max(0, currentHp / 2);
int halfHearts = Math.max(0, currentHp % 2);
int emptyHearts = Math.max(0, (maxHp - currentHp) / 2);
return fullHeart.repeat(fullHearts) + halfHeart.repeat(halfHearts) + emptyHeart.repeat(emptyHearts);
}
There you go
but it doesn't add \\n
I forgot to write here about the transition to a new line, they say it looked the same.
like: "FFFFNNNNN \n FFFFFFFFFF"
why does Bukkit.getPluginManager().loadPlugin(newPluginFile) throw a huge error
it doesnt load the plugin
its a plugin that reloads other plugins except itself btw
?nocode + show the error
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
?paste for large text
Ah, just split the text then
attempted to add duplicate plugin
Quite clear imho
Also this is spigot discord, not paper
?whereami
See if this works
public String createHealthBar(int currentHp, int maxHp, String fullHeart, String halfHeart, String emptyHeart) {
int fullHearts = Math.max(0, currentHp / 2);
int halfHearts = Math.max(0, currentHp % 2);
int emptyHearts = Math.max(0, (maxHp - currentHp) / 2);
return fullHeart.repeat(fullHearts) + halfHeart.repeat(halfHearts) + emptyHeart.repeat(emptyHearts);
}
public Component createMultiLineHealthBar(int currentHp, int maxHp, int heartsPerLine, String fullHeart, String halfHeart, String emptyHeart) {
int numberOfLines = (int) Math.ceil((double) maxHp / heartsPerLine);
String healthBar = createHealthBar(currentHp, maxHp, fullHeart, halfHeart, emptyHeart);
String[] splitLines = new String[numberOfLines];
for (int i = 0; i < numberOfLines; i++) {
int start = i * heartsPerLine;
int end = Math.min(maxHp, start + heartsPerLine);
splitLines[i] = healthBar.substring(start, end);
}
Component multiLineComponent = Component.empty();
for (String line : splitLines) {
multiLineComponent = multiLineComponent.append(Component.text(line)).appendNewline();
}
return multiLineComponent;
}

createMultiLineHealthBar((int)owner.getHealth(), (int)owner.getMaxHealth(), 20, heart.getString(), halfHeart.getString(), noneHeart.getString())
I tried instead of 20 - 10, then it splits into 4 lines
Ok looks good. Let me check if the multiline method is scuffed
public Component createMultiLineHealthBar(int currentHp, int maxHp, int heartsPerLine, String fullHeart, String halfHeart, String emptyHeart) {
int numberOfLines = (int) Math.ceil((double) maxHp / heartsPerLine);
String healthBar = createHealthBar(currentHp, maxHp, fullHeart, halfHeart, emptyHeart);
String[] splitLines = new String[numberOfLines];
for (int i = 0; i < numberOfLines; i++) {
int start = i * heartsPerLine;
int end = Math.min(maxHp, start + heartsPerLine);
splitLines[i] = healthBar.substring(start, end);
}
Component multiLineComponent = Component.text("");
for (String line : splitLines) {
Component lineComponent = Component.text(line);
multiLineComponent = multiLineComponent.append(lineComponent);
}
return multiLineComponent;
}
This should yield the same result as just the single line.
Could you check that?
Ah, missed that one heart is actually 2hp -.-
so what should I change
Next try
public Component createMultiLineHealthBar(int currentHp, int maxHp, int heartsPerLine, String fullHeart, String halfHeart, String emptyHeart) {
int numberOfLines = (int) Math.ceil((double) maxHp / (heartsPerLine * 2));
String healthBar = createHealthBar(currentHp, maxHp, fullHeart, halfHeart, emptyHeart);
String[] splitLines = new String[numberOfLines];
for (int i = 0; i < numberOfLines; i++) {
int start = i * heartsPerLine;
int end = Math.min(healthBar.length(), start + heartsPerLine);
splitLines[i] = healthBar.substring(start, end);
}
Component multiLineComponent = Component.text("");
for (String line : splitLines) {
Component lineComponent = Component.text(line);
multiLineComponent = multiLineComponent.append(lineComponent).appendNewline();
}
return multiLineComponent;
}
"pair programming"
Could you try this and use "F" "H" "E" for the hearts?
Tell me what the console prints
public Component createMultiLineHealthBar(int currentHp, int maxHp, int heartsPerLine, String fullHeart, String halfHeart, String emptyHeart) {
int numberOfLines = (int) Math.ceil((double) maxHp / (heartsPerLine * 2D));
String healthBar = createHealthBar(currentHp, maxHp, fullHeart, halfHeart, emptyHeart);
String[] splitLines = new String[numberOfLines];
for (int i = 0; i < numberOfLines; i++) {
int start = i * heartsPerLine;
int end = Math.min(healthBar.length(), start + heartsPerLine);
splitLines[i] = healthBar.substring(start, end);
System.out.println(splitLines[i]);
}
Component multiLineComponent = Component.text("");
for (String line : splitLines) {
Component lineComponent = Component.text(line);
multiLineComponent = multiLineComponent.append(lineComponent).appendNewline();
}
return multiLineComponent;
}
yeah
Ok let me rewrite this so you can pass double values so you dont round hearts away (like you currently do)
thanks :)))
public String createHealthBar(double currentHp, double maxHp, String fullHeart, String halfHeart, String emptyHeart) {
int fullHearts = Math.max(0, ((int) (currentHp + 0.5)) / 2);
int halfHearts = Math.max(0, ((int) (currentHp + 0.5)) % 2);
int emptyHearts = Math.max(0, ((int) ((maxHp + 0.5) - (int) (currentHp + 0.5))) / 2);
return fullHeart.repeat(fullHearts) + halfHeart.repeat(halfHearts) + emptyHeart.repeat(emptyHearts);
}
public Component createMultiLineHealthBar(double currentHp, double maxHp, int heartsPerLine, String fullHeart, String halfHeart, String emptyHeart) {
int numberOfLines = (int) Math.ceil(maxHp / (heartsPerLine * 2D));
String healthBar = createHealthBar(currentHp, maxHp, fullHeart, halfHeart, emptyHeart);
String[] splitLines = new String[numberOfLines];
for (int i = 0; i < numberOfLines; i++) {
int start = i * heartsPerLine;
int end = Math.min(healthBar.length(), start + heartsPerLine);
splitLines[i] = healthBar.substring(start, end);
System.out.println(splitLines[i]);
}
Component multiLineComponent = Component.text("");
for (String line : splitLines) {
Component lineComponent = Component.text(line);
multiLineComponent = multiLineComponent.append(lineComponent).appendNewline();
}
return multiLineComponent;
}
Here. But what i've seen from console is that it works perfectly fine.
Looks like your heart Strings are messing up the formatting.
Is there a more efficient way to make crops grow back fully after 5 seconds?
i was thinking of creating a runnable that sets the growth stage to max after 5 seconds for each crop but that could be wasteful in terms of resources
if players are farmings crops quickly
yeah thats my idea
but i was just wondering if there was a more efficient alternative
or if this way is actually optimized and wont slow down the servere
https://paste.md-5.net/zezivoyele.cpp
I Feel Like Im Doing Something Wrong Here
Any Ideas?
for cactus or sometinhg
New ocp pfp 😮
There is not much you can do, other than respawning the Blocks with a runnable.
The most performance gain is achieved with an efficient implementation.
One question you need to answer first: How do you handle Blocks which should respawn, but are currently in unloaded chunks.
@earnest forum if you are worried you can loadbalance this
@Override
public void handleBlockBreak(Player player, ItemStack tool, BlockBreakEvent e) {
Block block = e.getBlock();
//TODO check if player is in farming zone
if (block.getState().getBlockData() instanceof Ageable ageable){
e.setDropItems(false);
ageable.setAge(0);
block.setBlockData(ageable);
getBrokenBlockDrops(player, tool, block).forEach(drop ->{
player.getInventory().addItem(drop);
});
e.setCancelled(true);
}
}
well heres my current code
Yeah I just have a runnable for each block
i was just going to add a runnable after the event cancel that sets it back to max age

yeah this is the functionality im hoping to achieve ^
i will use a list of the blocks with some extra data like a timer and then run it every 5 seconds and lower 1 from each blocks timer and if it reaches 0 we are going to respawn and remove from list
Sounds like a list isn't the right data structure for you
so satisfying 🥹
problem is this wont be exactly a 5 second timer
actually wait no
Guys pls no... Dont decrement a timer and dont start a task for every block
timestamps
:)
i did it myself too 😔
Here is my proposal:
public record RespawnableBlock(Location location, BlockData blockData, long respawnTick) implements Comparable<RespawnableBlock> {
public boolean isValid() {
return location.isChunkLoaded();
}
public void respawn() {
location.getBlock().setBlockData(blockData);
}
@Override
public int compareTo(@NotNull RespawnableBlock other) {
return Long.compare(respawnTick, other.respawnTick);
}
}
public class BlockRespawnTask implements Runnable {
private final PriorityQueue<RespawnableBlock> respawnQueue = new PriorityQueue<>();
public void addBlock(RespawnableBlock block) {
respawnQueue.add(block);
}
@Override
public void run() {
int currentTick = Bukkit.getCurrentTick();
while (!respawnQueue.isEmpty() && respawnQueue.peek().respawnTick() <= currentTick) {
RespawnableBlock block = respawnQueue.poll();
if (block.isValid()) {
block.respawn();
}
}
}
}
Just start this task when the server starts and add respawnable blocks to it.
what does .peek() do?
Operates on a member of a stream without modifying it
loadbalancing
Oh were you not takling about streams
talking about priority queue
The PriorityQueue is ordered by the time the blocks are supposed to respawn.
Each tick you poll from the top of the Queue until the first block doesnt have to respawn.
-> This automatically invalidates all other blocks which are in the queue because every entry behind that is even further in the future.
Mb
peek() looks at the top of the queue but does not retrieve the element.
Its like poll() but without removing
yes
Does this look right to you guys? I'm trying to figure out why the spawned wolf does not attack players, but only mobs, when its owner attacks somebody (e.g. if its owner hits a player, the dog will aggro but won't deal damage; if the owner hits a pig, the dog will start damaging the pig)
// no consumers in 1.8 which i'm unfortunately forced to use for this plugin
(player.world.spawnEntity(player.location, EntityType.WOLF) as Wolf).apply {
setAdult()
maxHealth = 35.0
health = maxHealth
isTamed = true
owner = player
}
I've removed all my damage-related listeners and the result is the same Nvm, spawning a vanilla wolf and taming it does the same. It's something with my listeners or maybe an external plugin This happens even with no plugins at all, wtf? The problem was that wolves do not attack players in peaceful. Crisis averted.
oh do records automatically create methods like that?
thats interesting
doesn't look like compareTo is being used, can i just leave that out?
BlockRespawnTask respawnTask = ...; // Should be a singleton from somewhere. Only create 1 instance ever.
Location loc = ...;
Ageable blockData = (Ageable) Material.WHEAT.createBlockData();
blockData.setAge(blockData.getMaximumAge());
int respawnTick = Bukkit.getCurrentTick() + 100;
RespawnableBlock respawnableBlock = new RespawnableBlock(loc, blockData, respawnTick);
respawnTask.addBlock(respawnableBlock);
This would be a usage example
Bukkit.getCurrentTick() doesn't exist...
Oh no... its a forked method
World#getFullTime?
paper?
not sure if its in ticks though
i got this code
ItemStack item = new ItemStack(Material.PLAYER_HEAD);
if (texture.isEmpty())
return item;
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
GameProfile profile = new GameProfile(UUID.randomUUID(), "Player");
profile.getProperties().put("textures", new Property("textures", texture));
try {
Field profileField = itemMeta.getClass().getDeclaredField("profile");
profileField.setAccessible(true);
profileField.set(itemMeta, profile);
} catch (IllegalArgumentException | NoSuchFieldException | SecurityException | IllegalAccessException error) {
return new ItemStack(Material.PLAYER_HEAD);
}
item.setItemMeta(itemMeta);
return item;
}```
but whenever i try to use it, it throws this warning in the console
```[14:38:11 WARN]: Found inconsistent skull meta, this should normally not happen and is not a Bukkit / Spigot issue, but one from a plugin you are using.
Bukkit will attempt to fix it this time for you, but may not be able to do this every time.
If you see this message after typing a command from a plugin, please report this to the plugin developer, they should use the api instead of relying on reflection (and doing it the wrong way).```
how do i not use reflection?
Use system millis then (long)
Doesn't that not account for lag?
every time in bukkit is in ticks
Spigot has an API for this. You dont need GameProfile or reflections for this
how do i use the spigot api for it?
What is a "texture" for you?
URL: d42789267f63a57156cfb81255f63bbd60ecbf486bab0c5042aca663714e2a56
Texture: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDQyNzg5MjY3ZjYzYTU3MTU2Y2ZiODEyNTVmNjNiYmQ2MGVjYmY0ODZiYWIwYzUwNDJhY2E2NjM3MTRlMmE1NiJ9fX0=
Ah. I got a surprise for you. Go to this website:
https://www.base64decode.org/
And decode your "texture"
...
xD
so i just get the 'url' in the decoded 'texture'?
Yeah, or just use the url directly.
wait do i get the full url or the url text thingi
For the task, do i just schedule it to run every tick?
public class HeadCache {
private static final String BASE_URL = "http://textures.minecraft.net/texture/";
private static final Map<String, ItemStack> headCache = new HashMap<>();
public static ItemStack get(String key) {
return headCache.computeIfAbsent(key, HeadCache::create);
}
private static ItemStack create(String key) {
ItemStack headItem = new ItemStack(Material.PLAYER_HEAD);
SkullMeta meta = (SkullMeta) headItem.getItemMeta();
PlayerProfile profile = Bukkit.createPlayerProfile(key);
PlayerTextures textures = profile.getTextures();
URL url = fromKey(key);
textures.setSkin(url);
profile.setTextures(textures);
assert meta != null;
meta.setOwnerProfile(profile);
headItem.setItemMeta(meta);
return headItem;
}
private static URL fromKey(String key) {
String url = BASE_URL + key;
try {
return new URL(url);
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
}
ItemStack head = HeadCache.get("4ba55671f97ff3bfc5be335ae92cd9749abd619e7afc2a6673597b80b755c741");
alr
But dont tell anyone that i showed you a stateful utility class.
Usually not recommended.
alr
read that as headache
naturally
can i use this menu?
Sure, why not
Which kill-death message pair looks the tastiest?
Top one imo
^
Agreed
Hello , amm i get this problem :
Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!
and the server lag for few seconds and after that the lag is gone ..
Any reason why you think so?
how i can fix it?
That doesn't sound like a problem
I personally like the second one more because the color coding of just the first characters helps distinguish between good and bad messages. But I see that you guys prefer the first one. I want to know why you think so, maybe I'm missing something
I think the colorcoding of the entire first message helps distinguish between good and bad, the 2nd one are the same colors except for the [, which is hard to notice. Also I don't really like the look of bold for the entire message
the first one
because I don't like those extra stuff in between what I want to see
Alright, thanks for your input, I'll go with the first one 🙂
Also I would prefer the last one over the first one if the weird emoji's weren't there and the prefix was changd
Any tips on how to put bukkit/spigot and bungeecord support into one jar file? Because they both use the same plugin.yml file.
I'm pretty new to multi-platform support
Last one without the blocks, and I would suggest changing it to "Killed by player x with <weapon name> (<kit name>)”
If the kits contain special items ofc
You were killed by Player with their Necromancer Sword (Necromancer Kit)
For example
I want my message to look kinda extra (but not too extra), which is why I use the blocks. Maybe some other character would look better as the prefix?
Create a base module with a bunch of interfaces. Then make a module for each platform implementing the interfaces
Depending on mc version, its possible to render custom textures on the chat bar
is there a way to just automatically // out all broken classes
Unfortunately I'm coding this plugin against 1.8
Really good point
i don't understand? That doesn't fix the problem of both needing a different class for the startup logic and using the same plugin.yml, which prevents me from just having different main classes for them
Do you like that?
I personally really do
Hope minecraft can render these lol
Well ur going to need to build for each platform seperately
U cant rlly cleanly use the same jar
Oh nvm, just found out that bungeecord supports a bungee.yml that loads with higher priority than plugin.yml
paper has their own plugin yml too
even if it didn't you can just check the platform you're on in the onEnable
for what purpose?
Commission purpose i'm torturing myself but i don't have the balls to say that i am voluntarily coding this particular plugin for 1.8 so i make excuses like "commissions"
Getting paid well though
I refuse commissions for outdated stuff
I don't mind 1.8 as long as it's not something crazy
I mostly draw the line at whether I have to use pdc or not lol
yeah but bungeecord uses a different Plugin interface than Spigot does, so there will be a ClassNotFoundException i think
Does anyone know how to solve this?
packets giving me headaches 💀
should i make like a config file for this
thats uh
which is why u would need to build for platforms seperately
u can combine paper/spigot tho
💀
yeah, i have them in seperate packages with custom dependencies and stuff by having different subprojects
Hello, I've got spigot update checker and universal scheduler in my plugin, universal scheduler is shading correctly but not update checker, how can I fix it?
https://paste.md-5.net/axoyesatem.xml
Show your pom
here it is https://paste.md-5.net/otifusegoy.xml
What are you achieving with this?
if this is yaml you can;t use numbers as keys without quotes
i actually cant think of a better way
my brain is clogged
a switch or a Map?
yeah thats probably it
have you heard about ✨ camelCase or underscores ✨ ?
thats not very fun
that's for loosers, I also think the name is too short
real
The first slot is 4 and every other slot is 2 * (x - 2) + 10
so, hum anyone has an idea? 😅
How do you compile your project?
using mvn clean and after mvn install
How did you determine if the lib was shaded correctly or not?
using 7-zip and opening the jar
and in com...
and where it should be shaded:
thats stupid
With your setup, the entire spigot-api should be shaded into your project. How is that not happening?
yaml is pretty fucking stupid a lot of times
I think
that hell has taken control of my project and my computer will explose in the night
no, seriously I have no idea
Remove the artifactSet includes and add the scope provided to the spigot-api dependency.
humm okay
okay I see
it changed nothing
I inverted the order of update and universalScheduler in relocation, and only the last one is shaded
Each is its own relocation ofc
<relocation>
<pattern>com.github.Anon8281.universalScheduler</pattern>
<shadedPattern>io.github.paulem.btm.libs.universalScheduler</shadedPattern>
</relocation>
<relocation>
<pattern>com.jeff_media.updatechecker</pattern>
<shadedPattern>io.github.paulem.btm.libs.updatechecker</shadedPattern>
</relocation>
oh okay thanks!
Yep should be fine
What you essentially did was:
String pattern = "com.github.Anon8281.universalScheduler"
pattern = "com.jeff_media.updatechecker"
Which obvsly overwrites the first assignment completely
seems logical, responsible, practical
kinda. Its just a rule that all keys must be strings. If you use an unquoted number it gets treated as a number and isn't valid.
yeah I see, thanks 😄
I'll try not to make the same error next time x)
yes
'org.bukkit.event.player.AsyncPlayerChatEvent' is deprecated ?
use AsyncChatEvent IIRC
Ah, thank you
Oh an also, how can I update configuration file from a string (writing config.yml content)
It doesn;t look deprecated to me https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/AsyncPlayerChatEvent.html
Paper
write the actual content to the file and then re-read the config
with paper, everything is deprecated, even paper :)
okay thanks
something like that?```java
BufferedWriter writer = new BufferedWriter(new FileWriter(config.getCurrentPath()));
writer.write(upgrade);
writer.close();
plugin.reloadConfig();
plugin.config = plugin.getConfig();```
seems about right
config.getCurrentPath() ?
how do i do something if the player enters a boundingBox (only on enter)
Listen to PlayerMoveEvent
Didn't we tell you that yesterday?
that would make make it happen even if the player is already in the area tho
not working :/
Yes, ofc not
The write logic to prevent that...
Use a Set/HashMap to store if the player is in the region
^^
dont
and... returns an empty string 👍
get your datafolder and then config.yml
okay thanks
so like File(plugin.getDataFolder(), "config.yml") (in java file representation)
A FileConfiguration is not a File.
It exists purely in memory and has no idea in which File it is going to be saved in.
how would that be like?
yeah
plugin.getDataFolder() + "/config.yml" ?
idt you can use the + operator on a file and string 🤓
get the full path of the datafolder + config.yml
oh my bad
and not + "/config.yml"?
that should work
okay thanks
plugin.getDataFolder().getFullPath() + "/config.yml" ig
no actualy
its the relative path
absolute = /home/user/server/plugins/myplugin/config.yml, relative = plugins/myplugin/config.yml
i just use java file objects xd
why are you using paths to get a config.yml?
java file writing is weird man
File configFile = new File(getDataFolder(), "config.yml");
YamlConfiguration configuration = ...;
configuration.save(configFile);
getDataFolder() is from JavaPlugin.class
and I'm a weird man 🤓
.-.
I want to upgrade config.yml when the version is outdated
just that
you still don;t need files
I should use that?
you can getResource from teh jar for the new config
getConfig() will get teh one in the plugins data folder
Hi, i make a plugin which should fix that the teams suffix isnt shown in chat, so i need to edit the Chatmessage with the onChat Event. I heard that there is a way to do that and dont get in the way of other plugins which add Ranks and Set the rank name before the name. I dont want to interfer with these, is there a guide or a specific tutorial which shows that?
set the resource as default to teh getConfig() merge and save
okay thanks, but I need to use BufferredWriter to write?
no]
hmm
but I want to keep user options
okay
?stash for me
they dont i dont really know why it doesnt show. It seems like it worked some time ago but now its not working. I wanted to add The teams suffix in chat but i dont need a complicated Rank plugin. I want to write a Plugin which is so simple only fixing this.
paper actually has a good guide for this: https://docs.papermc.io/paper/dev/chat-events
saveDefaultConfig();
getConfig().options().copyDefaults(true);
getConfig().setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("config.yml"), Charsets.UTF_8)));
saveConfig();```
oh I see thanks 😄
not tested but that "should" add any new entries to an already existing config
you could even prefix it with a saveDefaultConfig()
so you know there is always a config
yeah I'm already doing that
comments aren't added...
um, not sure comments will pass as defaults
humm
comment parsing is default true, but they will not be used from a defaults
there is no way to allow them to be used?
not that I know of
any idea how to check if item got renamed in an anvil? like has bold name, i cannot use hasDisplayName as it creates conficts so i need to check if it is bold or not
check with the renaming event
does that event even exist
couldnt find one
thats just saving a resource
yeah
yaml is cool
how to get an entity a player is looking at
there is an event named anvil active or something
Nice rendering lmao (swords render fine)
r u working on minigames?
Nothing does. It is impossible
no NO
is this paper only? Can i do this while working with spigot api?
i don't need an event tho
if you want to change chatmessages the easy way, just cancel them and send one from server, then you have the full freedom :)
how you're gonna check if they've renamed an item in the anvil
?
paper only
rad r u german
yea
as i said if the name of the item is bold it means it got renamed by anvil
ok
No there is no way. What do you need this for?
bet there is, just say you don't know, there is a tag in item data that says whatever a text is bold or not, i want to access that
why not using the event?
nuh uh
Bold statement
doesnt include an itemstack
there is not way to check if it got renamed
you can check if it gets renamed
but not check the actual name
🧐
mehran
Your question was if there is a way to check if an item was renamed in an anvil or not. And the answer to that is: No there is no direct way.
Again: What do you need this for and what is the correlation between bold text and renamed items?
we are not talking bout anvils
i think he is talking about that renamed items have an italic name
and he is tryna get that info
He cant use the displayName apparently. So this is going to be hard.
Pretty sure there is simply a better solution to whatever he is trying to do.
He just has to spill the beans to us.
i have a slimefun item that has to be checked to do X , i am using its name to do that, and as i am dealing with player heads i don't want a player to rename a random head to use it for X
Pretty sure slimefun has NBT tags on their items. Nobody should ever use the displayName of an ItemStack to check if it is a custom item or not.
no idea how NBT tags work tho
how to get an entity a player is looking at
Let me take a look at what they do real quick. Last time i checked a few years ago they did some atrocious things in their code.
raytrace? idk
You can use World#rayTraceEntities()
Or is it Player#rayTraceEntities() idr
Yeah, rayTraceEntities. Just make sure to filter out the ray caster.
so pass the player's location and facing vector?
thank you, if you find the part of the code that address it send me it please
will it return a list, or just the first entity it runs into
RayTraceResult
declaration: package: org.bukkit.util, class: RayTraceResult
Read em docs
k
They... extend org.bukkit.inventory.ItemStack
not very orthodox practice ig
i am working on a custom build i made myself because i had to adapt some features
not sure if api would help
Alright i found their pdc tag
how do I stop my plugin from loading (if something goes wrong during initialization)
where is this defined?
Throw an uncaught exception in onEnable and the plugin will shutdown
Or you can just call PluginManager#disablePlugin
None is "safer". Your plugin stops in both cases
private static final NamespacedKey SLIMEFUN_ITEM_KEY = NamespacedKey.fromString("Slimefun:slimefun_item");
public static boolean isSlimefunItem(ItemStack itemStack) {
if (itemStack == null) {
return false;
}
ItemMeta meta = itemStack.getItemMeta();
if (meta == null) {
return false;
}
PersistentDataContainer dataContainer = meta.getPersistentDataContainer();
return dataContainer.has(SLIMEFUN_ITEM_KEY);
}
See if this works
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
Now you can
relog for the verify to fix
alr
doesn't work but maybe i can make a fix
ok neither the workaround neither that code works
how do i play the potion drinking sound correctly
playing it plays only first like 0.5s of the sound or smth
play it 6 times
I'm also curious now
Fr or no?
yes
Holy shit
with a slight delay between each
What about the code doesnt work?
how much delay 👀
the sound is 0.5 seconds but you need to overlap a little
it takes 3.5 seconds to drink a potion
so 70 ticks total
fixed
private static final NamespacedKey SLIMEFUN_ITEM_KEY = NamespacedKey.fromString("Slimefun:slimefun_item"); was the error the actual tag is slimefun:slimefun_item with lowercase s
first start playing one after another 0.5 seconds apart
Geniunely confused as to why that'd work? Wouldn't playSound restart the sound?
10 ticks apart
Hello there , iam trying to make a database.settings , but its empty everytime the server create it :
then shorten it slightly to be in time with yoru animation
right. Tell me if it detect slimefun items now
this is my database class
like first time 10 then 9, then 8?
does that sound right?
does a task ran with runTaskTimer and an event handler run on the same thread?
it does it does 😄 ty
just do a repeating task at 10 ticks. cancel when you played 6 times
aight sure
the file is being created but null values :
i didn't remember json allowing for annotations, that's nice
reminds me of golang
i don't see you saving it
The expose annotation is redundant for a default Gson instance.
You should create a default File if none exists
trying to make easy json file manager :
i think the saveconfig method is wrong
i think you need something like toJson Writer
how do i register a custom entity in net.minecraft.world.entity.EntityType?
public void loadConfig() {
File configFile = new File(plugin.getDataFolder(), "database.json");
if(configFile.exists()) {
this.settings = gson.fromJson(new FileReader(configFile), DatabaseSettings.class);
} else {
this.settings = new DatabaseSettings();
}
// Always save the config to merge default values
this.saveConfig();
}
now it should work
i also don't think flush is correct
you might wanna look into how writer works exactly
wasn't it something like print?
unless tojson does that which i bet it does
it's just very weird that's all
if it doesn't work then you have some weird condition that enables it to work there
I would probably use nio for this. I find it simpler:
public void loadConfig() {
File configFile = new File(plugin.getDataFolder(), "database.json");
if(configFile.exists()) {
String json = Files.readString(configFile.toPath());
this.settings = gson.fromJson(json, DatabaseSettings.class);
} else {
this.settings = new DatabaseSettings();
}
// Always save the config to merge default values
this.saveConfig();
}
public void saveConfig() {
File configFile = new File(plugin.getDataFolder(), "database.json");
if(!configFile.exists()) {
configFile.createNewFile();
}
String json = gson.toJson(this.settings);
Files.writeString(configFile.toPath(), json);
}
everything runs in a single thread as long as you don't use anything that's "async" right? or do I misunderstand how spigot works
i think yaml is more beautiful for end users
really?
plus there's no random {} to delete by mistake
You can map json to yml if you want. Im doing that with Jacksons YAMLMapper
nice , would love to try it out
String json = ...;
try {
JsonNode tree = this.objectMapper.readTree(json);
String yml = this.yamlMapper.writeValueAsString(tree);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
Other way around:
String yml = ...;
try {
JsonNode tree = this.yamlMapper.readTree(yml);
String json = this.objectMapper.writeValueAsString(tree);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
The mappers needed:
this.objectMapper = new ObjectMapper();
this.yamlMapper = new YAMLMapper();
for settings.yml , and database.yml right?
yeah
?
serialization is great because you can contract text
yaml is mostly formatted for end users
json beatifying is an after taught
nms is generally not supported. Its a anarchistic wasteland.
Try to check what others did and hope that it works for your version.
Prying open frozen registries is always a hustle. Pretty sure you will have to do that.
I think i should do the old way and use reflection
You will need both nms and reflections. If you use only reflections then you will have a much harder time.
EntityType has a static register method.
private static <T extends Entity> EntityType<T> register(String id, Builder type) {
return (EntityType)Registry.register(BuiltInRegistries.ENTITY_TYPE, id, type.build(id));
}
So all you need to do is call
Registry.register(BuiltInRegistries.ENTITY_TYPE, id, type.build(id));
With your custom id and an instance of EntityType.Builder
Which has a static of() method.
The factory is just an functional interface
Fairly confident that registry is frozen
Thanks , i got it working now .
Yeah already mentioned that
And even if you unfreeze it, there's a non-zero chance the client will crash because that registry is synched, as far as I know

it is!!
I know how to fix it but it requires severe reflections
and severe hacks
And as a bonus, you have no access to Bukkit entities because CraftBukkit doesn't understand that custom type
which break every minor update, if you want
no it isn't?
what do you think is better spawning bukkit entity [like 50 , or 100 or more depend on the server owner want .] or spawn entities using packets?
and it will send the packets to the user?
crap like trim materials and some other random stuff is
sounds like a design issue
it's like, 5 or 6 registries are synced
CB still won't be happy with you though :p So if you ever want to invoke getBukkitEntity() then you're SOL
lootbox with armorstand as the entity ..
nope!
That still works :P
if I'm not completely fried
Not anymore
a h.
It used to default to a non-specific CraftEntity but now it throws an exception
If we reworked CraftEntity.getEntity into an NMSEntity#createCraftMirror life would be good
your ideas guys?

But last time I pitched this I was turned down for having to modify every nms entity class
even though it allows for some very funny behavior
unless someone makes those methods final :(
displayentity ¯_(ツ)_/¯
I love how using a map is just not something that's done in that huge method
throw new AssertionError("Unknown entity " + entityType); 
what if you just trycatch it
for newer version yeah
😭
and do some hacky stuff
what about 1.16.5 and older?
You can @echo basalt, with Unsafe, technically edit the field ig?
ofc
update
and return a generic entity that wraps your entity
throwback to when I hacked in an universal craftscheduler on folia servers
All this conversation is making clear is that you're going through significant effort for something that's probably going to break and is not worth doing lol
5 days ago???
lmao yeah
but but but I need to run my CratesUltimateEpikProPlusDeluxeEdition++ that's 69420Petabytes (without dependencies) and has a 4.78Quadrilion line config to setup an overcomplicated version of a loot table!!!!
In the old days when i had no idea about how any of this worked, i just slapped a Scoreboard String on the entity (PDC wasnt a thing yet) and simply
checked the tags in the ChunkLoadEvent, then replaced the vanilla entity with my custom one.
just sent a 200mb .zip bomb to one of my customers
I believe at some point I made a system to assign a unique id with color codes on item lore
And associate data to that unique id
I remember a plugin doing that.
public static final String SECRET_NAME_PREFIX = "§a§c§a§9§r";
And then checked if the name contained this prefix (which ended with §r to reset the formatting)
Well yeah but in my case it was more sophisticated
Think of generating a uuid, grabbing both longs and rendering them as §hex
I just checked references tbh 💀
put the InventoryView in a map
database?? reload and your config is gon
😭
I've done all kinds of hacky stuff tbf
Extending nms entities and rewriting all movement logic to collide with client-sided blocks
uH
I once made a client-side chunk space that had actual loading and server-side culling with my friend
I think I had a client-sided world manager at some point
hm I once tried making fl studio in minecraft
had a system to order domino's within minecraft
that was fun
actually
you should use the java chromium embedded framework or whatever it was called and write an utility that would let you access the internet from a minecraft server
wait, why?
that sounds like such a huge undertake
Ok question, since this is something I always struggled with-- is there a hot-reload or better way to compile a plugin and restart a server yet? 💀 Such as JRebel for Minecraft
hello, when i start the minecraft's server my plugin don't start who help me to resolve?
just /reload
for compilating i use IntellijDEA Comunity
...and break everything
there could be a million reasons
should be fine for testing
It used selenium and a lot of wrapping to send requests
why does it not start? is there an error
it could process your entire pizza order in like 15 seconds it was wacky
I had a minigame and couldn't bother doing temporary worlds
so I just made it all client-sided
100% efficiency
there isn't a code problem
i mean in the startup log
is there an error in the servers console
impressive, but that is so hard to do
well tbf there's a lot you can do
eh
Not really
Just time consuming
specially given I hadn't set up mappings yet
ok i see
well, you are just a mad man
Which is why I was wondering if something better was made yet
It's quite simple you're only dealing with like 3 packets
but like at a big scale?
something better than reload? restart
something quicker 😈
its the same just with a forloop lol
that's nice
getting better hardware
^
I know my hardware is good 🤣
than your server shouldnt take long to boot
spigot and paper are both rather fast
shouldnt take more than 30 seconds i have a 1.8 server that boots in 5 seconds
1.8 servers boot up very quickly
comparing to 1.19.4 for example
Can confirm
i see the problem
^ this one is also not the luckiest, I've had some 1.8s today
well what is it
the compile version is 66.00 but the server support the 60.00
love dealing with that issue
compiled with java 22 but trying to run on 16 iirc
ah, that man be compiling against newer java and wondering why his plugin ain't working
I would recommend to compile against java 8 if you are planning to support most versions
hi , does anybody have any idea why my worldguard plugin doesnt work?
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
i think WorldGuard is not supported with spigot
i resolve installing Paper because paper is Bukkit+Spigot
WorldGuard is compatible with Spigot
how do i make a chest with items inside?
Place a chest
Get it's inventory
set item
Or are you talking about a chest item with items in?
like how do i get a chest which is at a specific location?
get it's blockdata
Hm
is there documentation or material for making config.yml s
how?
*BlockState is what you want
thanks
Block#getState
Block#getState
wait im 1000% sure it's getBlockState?
oh damn

