#help-development

1 messages · Page 1671 of 1

eternal oxide
#

then you are starting it more than once

crystal pike
#

it's inside the die method within a NMS entity class.

#

So that would be odd if the die method gets called infinite times

eternal oxide
#

It will only run once

crystal pike
#

It does not

#

Last 3 times I tried, I had to shut down the server and kill 4k+ entities.

eternal oxide
#

Argue all you like. That code will run ONCE> if you find it being executed more then it is being called more. a runTaskLater runs once

#

you are spawning a new entity as it dies?

crystal pike
#

Yes. after a 20 tick delay

eternal oxide
#

and you are trying to kill all entities?

crystal pike
#

Well I get that part.

#

But when I kill the first, it just keeps spawning.

#

Even though only one has been killed

eternal oxide
#

then your code is not doing what you expect it to.

#

Your logic is wrong

#

If teh code keeps running, its being called over and over

crystal pike
#

I see what you are trying, but I don't get it.

#

I simply extended EntityMonster

#

omfg.

#

nvm

#

I'm a dumbass

#

i think

#

yes

#

mb

#

xD

eternal oxide
#

runTaskLater physically only runs once and cannot run more than once.

mellow edge
#

if I make blockplacevent and cancel it will the block be still placed?

tardy delta
#

it will be placed and be removed

#

hmm is it a good plan to give every command class a cooldownmanager field?

grim ice
#

runTask makes code run on main thread right

chrome beacon
#

Yes

tardy delta
#

is there no System.currentTimeSeconds() ?

#

dont think

#

or just / 1000 i guess

lost matrix
tardy delta
#

i was trying to store my cooldowns in seconds and not in millis bcs thats the smallest unit i need

lost matrix
#

Store them as Duration

#

Or as Instant

lavish hemlock
#

the easiest way is to get the millis and divide by 1000

lost matrix
#

Depends if you have a fixed point system.

grim ice
#

can someone explain threads to me?

lost matrix
tardy delta
mellow edge
lost matrix
tardy delta
#

this is the code

long timeLeft = System.currentTimeMillis() - cooldowns.getCooldown(p.getUniqueId());
            if (TimeUnit.MILLISECONDS.toMinutes(timeLeft) < 5) {
                Utils.message(p, "&cPlease wait&e " + Utils.millisToHumanReadable(TimeUnit.MINUTES.toMillis(5) - timeLeft) + " &cbefore reusing this command!");
                return true;
            }
#

millis to human readable that method name goes brr

grim ice
#

does a spigot server have multiple threads? if so how many

tardy delta
#

main thread and io?

#

idk

lost matrix
# grim ice does a spigot server have multiple threads? if so how many

The spigot server has one main thread. There are a ton of extra threads like the ones spawned by the BukkitScheduler
but in most cases you will never use them as they are used for internal stuff (exception are the BukkitScheduler ones)
Ill do some chores and then ill write you an example for threading.

grim ice
#

o

tardy delta
#

o

#

😂

lost matrix
#

1.8 is not supported anymore.
But you can check if any variable is null by comparing them
to the null pointer if(var == null)

tardy delta
#

what is a chore

#

😳

maiden briar
#

How can I support both Java 8 and 16? I set language level to 8, but still get class has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 55.0

tardy delta
#

is that even possible?

hybrid spoke
maiden briar
#

Yes so I have to compile it completely to 16?

hybrid spoke
#

yes

maiden briar
#

Ok but the problem is, the executor is still Java 11

#

And I want to make my plugin work on Java 8 AND Java 16 servers

hybrid spoke
#

you could let it compile then with j8

maiden briar
#

Ok

hybrid spoke
#

you just cant use j8+ api functions then

eternal oxide
maiden briar
#

Ok thanks

lean gull
#

how do i check if something is either a certain item or another spesific item

tardy delta
#

anyways it is a good way of having an instance of this class in all my commands?
?paste

lean gull
#

(items are variables)

tardy delta
#

stfu

#

?paste

undone axleBOT
eternal oxide
#

what type of variables?

tardy delta
lean gull
#

itemstack

lost matrix
eternal oxide
#

itemStack.isSimilar(other item)

lean gull
#

?

#

how do i use that

lost matrix
#

?pdc

lost matrix
lean gull
#

1.17.1

lost matrix
# lean gull 1.17.1

Ok. Then pdc is your friend. Its a bit complicated at first but very powerful.

grim ice
#

(not complicated at all)

#

even easier than java

eternal oxide
#

What exactly is the ItemStack you are checking? Is it modified/renamed? or just a default item?

grim ice
#

itemmeta can change

#

pdc cannot unless u remove it

lean gull
#

oh so u just check for item tags?

eternal oxide
#

I'm guessing he wants to test an item he's created with one that was used, to see if its the same

grim ice
#

what

lean gull
#

no, i have two variables set to custom items, i want to check if the clicked item in an inventory is one of them

eternal oxide
#

you mean a GUI item?

lean gull
#

yup

eternal oxide
#

then isSimilar will work, as will == or .equals

lean gull
#

how do i do with .equals

grim ice
#

thats why

#

we tell you to leaarn java

tardy delta
#

itemstack.equals(other itemstack)

#

🥺

eternal oxide
#
if (!next.isSimilar(event.getCurrentItem())) return;```next being the item you created and stored in your variable
grim ice
#

even if you learnt 2 minutes worth of java u would know how to use .equals

lean gull
#

i do know, i just forgot how to use ||

#

in .equals

tardy delta
#

lol

grim ice
#

bro

#

thats not something you forget

#

just go learn java smh

eager hinge
#

some good stuff is going on here

grim ice
#

will it take you a month like it did with me or what

eternal oxide
#

He's trying

lean gull
#

it is something you forget if you have a memory like mine

onyx shale
#

disgusting

grim ice
#

has prob 10x ur knowledge

#

so just shut up lol

onyx shale
#

oh god

#

you must be new

ivory sleet
#

?ban @onyx fjord spam in thread

undone axleBOT
#

Done. That felt good.

grim ice
#

DAMN

#

rip kacper

tardy delta
#

LOL

onyx shale
#

ayy there goes his

#

booster rank

grim ice
#

how old are you?

onyx shale
#

very old

lean gull
#

conclure can you give 2hex another warnning for being toixc please? thanks

onyx shale
#

boomer old

knotty ruin
#

yes toixek

grim ice
#

i didnt do anything?

#

even the ppl im talking with can agree i was not toxic lmao

knotty ruin
#

seems fine to me

eternal oxide
#

You tixoc boy

onyx shale
#

a boomer whose been here since 2017

ivory sleet
#

2hex tbf you’re not the most civil person around here

onyx shale
#

and coding for long😂

grim ice
hybrid spoke
#

i am very civil

onyx shale
#

i agree

grim ice
#

I've been here for over a month and I've seen no niceness except from a few

#

:D

onyx shale
#

well usually you get what you give

#

i know alot of nice boys here

#

an overwhelming amount

tardy delta
#

🙉

lean gull
#

he is right though, there are not many civil and nice people on here

tardy delta
#

here wo go again

hybrid spoke
onyx shale
#

well thats minecraft dev into a nutshell,spigot is in the middle allowing some freedom actually

#

go into paper and be a dick and see you getting booted in minutes

eager hinge
#

Hey, has anyone worked with packets? Could it do something like showing an entity to only one player?

daring sierra
onyx shale
#

@eager hinge thing is a packet is useless without sending it,meaning you decide who gets it

grim ice
hybrid spoke
#

right. he is even worse

lean gull
daring sierra
hybrid spoke
#

reda is a bad girl

onyx shale
eternal oxide
#

lol, you had everyone blocked, until you were talking to yoruself 🙂

lean gull
#

i only blocked mean people

eternal oxide
#

I guess I'm mean then

lean gull
#

i guess that is everyone huh

grim ice
daring sierra
#

🤣

hybrid spoke
#

more like you blocked people who tried to help you but you couldnt handle the critism

grim ice
#

im not even getting started with this

onyx shale
#

oh boy that hits deep for some

grim ice
#

if i do im getting banned

daring sierra
lean gull
#

yup

daring sierra
lean gull
#

doesn't make you nice though

eternal oxide
#

great advancement

onyx shale
#

deeper than the ISP time to respond to my port forwading issue

grim ice
#

bro

grim ice
#

i wouldve agreed if u blocked anyone

onyx shale
tardy delta
#

the world is changing

grim ice
#

u fucking blocked the nicest human here lmfao

eager hinge
grim ice
#

ur not finding anyone nicer than elgar

daring sierra
#

Anyways, Have fun help-dev lurkers

hybrid spoke
onyx shale
#

i suppos if 1.17 didnt change the way

#

((CraftPlayer) p).getHandle().playerConnection.sendPacket(packet)

hybrid spoke
#

playerConnection is b now iirc

onyx shale
#

damn

#

ahh yes i see

#

fkn

#

yoink

#
private static void sendPacket(Player player, Object packet) {
    try {
        Object nmsPlayer = getNMSPlayer(player);
        Object connection = nmsPlayer.getClass().getField("b").get(nmsPlayer);
        connection.getClass().getMethod("sendPacket", Packet.class).invoke(connection, packet);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
#

wait

#

though

#

b

#

this can be simplified

lost matrix
# grim ice im not even getting started with this

Ok number one:
Understanding how the minecraft main thread works.
Minecraft is like many other games tick based.

This means the main thread wants to schedule N ticks every second. For Minecraft
this number is 20, which will result in 50ms per tick that can be used to run code.
If the code takes longer then the TPS (ticks per second) effectively drops down.

Some of the tick time is used by NMS code some by Bukkit/Spigot and
some by plugins. If the server has nothing to do then it just waits some milliseconds
so the tick takes exactly 50ms.

grim ice
#

o

onyx shale
#

nvm same shit i guess

#

((CraftPlayer)p).getHandle().b.sendPacket(packet);

eager hinge
#

so i can just create some kind of entity packet and send the location each tick?

lost matrix
grim ice
#

o

lean gull
#

still need help btw :p

lean gull
#

...then don't respond?

onyx shale
#

first you create a entity then you call the spawn packet with it

eager hinge
#

do i need to remove the packets afterwards?

onyx shale
#

packets are more fragile.. they get bonked fast

lost matrix
# lean gull still need help btw :p

I didnt read the posts above but are both methods not working?
Elgarl suggested the isSimilar() method from ItemStack
and i that you should use the PDC of the ItemStack. There is even a guide for that.

onyx shale
#

for example teleporting away with a packet spawned entity will remove it

#

once you come back

lean gull
#

i prefer .equals

onyx shale
lost matrix
tardy delta
#

UwU

#

cutie

onyx shale
#

what a good abandoned plugin

eager hinge
tardy delta
#

can he climb blocks?

onyx shale
#

yes has pathfinding

eager hinge
#

how did you do the legs

onyx shale
#

4 armorstands

#

the pain of doing rotations was attrocious

tardy delta
#

cool

grim ice
#

how do u all work with armorstands

onyx shale
#

was meant to be a free alternative to those premium pets plugin.. sadly my passion died

grim ice
#

i dont understand it at all

onyx shale
#

so in the end its left in the trash can

onyx shale
maiden briar
#
[05:31:40 ERROR]: Error occurred while disabling <> v1.0.0 (Is it up to date?)
java.lang.NoClassDefFoundError: me/tvhee/tvheeapi/spigot/api/crafting/CraftingRecipe
        at me.tvhee.tvheeapi.spigot.core.BukkitPluginLoader.onDisable(BukkitPluginLoader.java:110) ~[?:?]

????

onyx shale
#

thanks for specifically not including the ondisable

tardy delta
maiden briar
#

No, just my own api

#

I have no problems with other classes

tardy delta
#

ah but uhh maybe a screen of onDisable() would work better than this

lean gull
#

ok i figured it out

maiden briar
#
@Override
    public void onDisable()
    {
        CraftingRecipe.unregisterAll(); //Exists
        this.tvheeAPIPluginLoader.disablePlugin();
    }
lean gull
#

i found a stackoverflow thing

tardy delta
#

playin minecraft for 18 hours

grim ice
#

e

tardy delta
maiden briar
#

The first

tardy delta
#

possible that i cant find the unregisterall method?

maiden briar
#

Oh let me show

tardy delta
#

🤔

maiden briar
#
public static void unregisterAll()
    {
        for(CraftingRecipe recipe : registeredRecipes)
            recipe.unregister();
    }
tardy delta
#

ah

maiden briar
#

That does Bukkit.unregisterRecipe()

tardy delta
#

is that 1.17 or something

lean gull
#

could still use help with this

maiden briar
#

The actual method is removeRecipe

tardy delta
#

i can throw my file manager but that goes brr

maiden briar
#

I was wrong

tardy delta
#

oh

maiden briar
#

But I still get the error, the class is just in the jar as normally and other classes also work fine

#

I also have never had this issue before

#

I am wrapping it in try/catch, let's see if it catches

ivory sleet
#

?kick @reef wind

undone axleBOT
#

Done. That felt good.

tardy delta
#

what did he do?

maiden briar
#

Yes confusion

tardy delta
#

🧠

ivory sleet
#

I told you not to call me that

#

No this is a warning

hybrid spoke
#

why are you so strict about threads?

tardy delta
hybrid spoke
#

they wont do anything

#

you can just join and leave them

#

so anything written in there doesnt harm others

reef wind
#

Gay

ivory sleet
#

?ban @quaint mantle disrespectful

undone axleBOT
#

Done. That felt good.

reef wind
#

wtf

ivory sleet
#

I have told him countless times now

opal juniper
#

bruh

tardy delta
#

this goes fast

maiden briar
#

Ehm when I wrap my problem in try/catch I even do not get the message in the logger I set in the catch clause

ivory sleet
# hybrid spoke why are you so strict about threads?

I’m not strict about threads however they should be used to distribute peoples problems in the help channels, once they have no use then they should be archived. It makes it easier to navigate those threads that are still unresolved. We have a channel for general off topic, in fact verified also. We don’t need one more.

median anvil
#

how can I delete the minecraft world on startup

#

I've tried using the the plain java way by grabbing the file and using file.delete(), but it isn't working.

#

I'm even using the Bukkit.unloadworld() before attempting to delete it, but it's still not working

tardy delta
#

world.getWorldFolder().delete()?

eternal oxide
median anvil
#

main world. I'm going to try what you said

eternal oxide
#

at what point in your "startup" are you attempting to delete it?

#

Note the main world can not be "unloaded"

median anvil
#

before world load

#

i just had that incase it attempted to load the world

eternal oxide
#

I've not looked at the load sequence so can;t tell you if its possible or not. I just know once loaded you can;t unload.

median anvil
#

well i want to generate a new world on startup, i've seen other servers do it so it has to be possible.

eternal oxide
#

?stash

undone axleBOT
median anvil
#

okay so getting the world file and using .delete() on it is doing nothing. is there a way to force delete it?

eternal oxide
#

You can;t delete folders with contents. you need to perform a recursive delete

median anvil
#

oh, okay, ill try.

#

It worked thank you @eternal oxide

quaint mantle
#

Is there a wildcard for materials? E.g. Material.ALL or *

unreal quartz
#

in what world would that make sense

eternal oxide
#

There are Tags

quaint mantle
#

because im trying to see if the item a player is holding is any item

unreal quartz
#

if it's not material.air or if the itemstack is not null

quaint mantle
#

ok i was just being dumb nvm

eternal oxide
#

what do you mean by "is any item"

gilded spruce
#

how to make arrays public for other methods?

pulsar schooner
#

Declare it outside the method

gilded spruce
#

bruh lol

#

okay ty

pulsar schooner
#

I would recommend learning a little Java before plugin dev

#

Like a lot little

unreal quartz
#

like 20 years of experience little

maiden briar
#
@Override
    public void onPluginLoad()
    {
        saveDefaultConfig();
        String worldName = getConfig().getString("plugin.world");

        if(worldName == null)
            throw new RuntimeException("Could not find the default world name, please specify it at \"plugin.world\"!");

        File worldFile = new File(getDataFolder().getParentFile().getParentFile(), worldName);
        getLogger().info("Detected world folder: " + worldFile);

        if(worldFile.delete())
            getLogger().info("Successfully deleted the world!");
    }

Only the last 2 lines do not function, it does not delete the world folder and does not print the message

fading lake
maiden briar
#

How would I do that?

pulsar schooner
fading lake
#

loop the contents until there are no child contents (empty directories and files) and delete them

quaint mantle
#

org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event org.bukkit.event.player.PlayerEvent. Static getHandlerList method required!
I get this error when loading my plugin.
Heres my code

public class AllPlayerStat implements Listener {

    @EventHandler
    public static void playerAttributeEffect(PlayerEvent event) {
        if (event.getPlayer().getInventory().getItemInMainHand().getType() != Material.AIR) {
            AttributeModifier attackSpeed = new AttributeModifier("attack_speed", 20.0, AttributeModifier.Operation.ADD_NUMBER);
            event.getPlayer().getInventory().getItemInMainHand().getItemMeta().addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, attackSpeed);
        }
    }
}
maiden briar
#

Ok for every file I need to delete it

#

I will try

lean gull
#

someone pls help

tardy delta
#

what is a playerevent?

ivory sleet
#

Yeah you cannot by definition listen to PlayerEvent

quaint mantle
#

o ok

ivory sleet
#

Because it does not have a HandlerList

quaint mantle
#

right good to know

fading lake
tardy delta
#

its a tutorial

fading lake
#

I know its a tutorial but Im on cell data

eternal oxide
maiden briar
#

@fading lake something like this?

private List<File> removeDirectory(File direcotry)
    {
        List<File> notDeleted = new ArrayList<>();

        File[] subFiles = direcotry.listFiles();

        if(subFiles == null)
            return notDeleted;

        for(File file : subFiles)
        {
            if(file.isDirectory())
                notDeleted.addAll(removeDirectory(file));

            if(!file.delete())
                notDeleted.add(file);
        }

        return notDeleted;
    }
#

Yes it is working!

#

notDeleted is just to print that it failed

#

@fading lake this still gives me this problem: [07:02:10 ERROR]: Failed to save player data for tvhee

fading lake
maiden briar
#

It was when I kicked a player

#

If I remove the world myself it just works

#

I saw it left 4 directories without deleting them

fading lake
#

Is the world deleted before or after the kick

#

and what directories

maiden briar
#

in onLoad

fading lake
#

what directories

maiden briar
#

Those are all empty

fading lake
#

Your method isnt deleting them, hang on I might have one of my own

maiden briar
#

Ok

#

I think regenerating the world does not work as expected

#

But if I delete it myself it all works

#

Ok but I am trying it through my plugin

fading lake
#

youll have to change some of it like the loggers n stuff

maiden briar
#

Ok I will add them to the list

#

Ok implemented, testing...

#

I don't get any, but directly after Bukkit shouts at me

#
[07:15:22 WARN]: [org.bukkit.craftbukkit.v1_16_R3.util.WorldUUID] Failed to write ./world/uid.dat
java.io.FileNotFoundException: ./world/uid.dat (No such file or directory)
        at java.io.FileOutputStream.open0(Native Method) ~[?:?]
        at java.io.FileOutputStream.open(FileOutputStream.java:298) ~[?:?]
        at java.io.FileOutputStream.<init>(FileOutputStream.java:237) ~[?:?]
        at java.io.FileOutputStream.<init>(FileOutputStream.java:187) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R3.util.WorldUUID.getUUID(WorldUUID.java:42) ~[patched_1.16.5.jar:git-Paper-788]
        at net.minecraft.server.v1_16_R3.WorldServer.<init>(WorldServer.java:327) ~[patched_1.16.5.jar:git-Paper-788]
        at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:554) ~[patched_1.16.5.jar:git-Paper-788]
        at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:298) ~[patched_1.16.5.jar:git-Paper-788]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1069) ~[patched_1.16.5.jar:git-Paper-788]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-788]
        at java.lang.Thread.run(Thread.java:834) [?:?]
#

Ok and if I directly stop the server after the plugin, it still left the 3 folder

#

But no warnings in console

#

What are the components?

#

The non directory files

#

Ok

#

I think that is happening here, because there are 3 empty directories left

#

@fading lake it did not print anything, but still left the directories

fading lake
#

does your plugin have access to delete them?

maiden briar
#

Yes I don't know that

fading lake
#

That method should be deleting the entire thing

maiden briar
#

Ok it is randomly fixed if I restart the server again....

fading lake
#

show me how youve implemented it

maiden briar
#
private void removeDirectory(File file)
    {
        if(file == null)
            return;

        if(file.isDirectory())
        {
            File[] files = file.listFiles();

            if(files != null)
            {
                for(File childFile : files)
                {
                    if(childFile.isDirectory())
                        removeDirectory(childFile);
                    else if(!childFile.delete())
                            getLogger().warning("Could not delete file: " + childFile.getName());
                }
            }
        }

        if(!file.delete())
            getLogger().warning("Could not delete file: " + file.getName());
    }
#
File worldFile = new File(getDataFolder().getParentFile().getParentFile(), worldName);
getLogger().info("Detected world folder: " + worldFile);
removeDirectory(worldFile);
getLogger().info("Successfully deleted the world!");
fading lake
#

nono where its being called

maiden briar
#

There above

fading lake
#

odd

#

wait

#

The error could be stopping it from running theoretically

#

what line is the error coming from

tardy delta
#

hmm i am making instances of a commandclass to execute something

maiden briar
#
java.io.FileNotFoundException: ./world/uid.dat (No such file or directory)

I still get this, and if I try to do Bukkit.getWorld() in onEnable it returns null

fading lake
#

what line is the error coming from

maiden briar
#

at java.io.FileOutputStream.open0(Native Method) ~[?:?]

#
 at java.io.FileOutputStream.open(FileOutputStream.java:298) ~[?:?]
        at java.io.FileOutputStream.<init>(FileOutputStream.java:237) ~[?:?]
        at java.io.FileOutputStream.<init>(FileOutputStream.java:187) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R3.util.WorldUUID.getUUID(WorldUUID.java:42) ~[patched_1.16.5.jar:git-Paper-788]
#

Shall I replace the current method temporairely?

fading lake
#

no just put the try/catch around it

maiden briar
#

Ok I will catch nothing then?

#

deleteFile(file); does not exist

#

Pls send me also that method

#

Or is this a reference back to the method?

#

That is the fix!

#

But Bukkit.getWorld(world) still returns null

fading lake
#

That method does it for me which is why I'm lost, I'm convinced its erroring and then just not deleting the directories

maiden briar
#

It is deleting it in onLoad and I am calling it in onEnable

fading lake
#

Worlds load after onload im pretty sure yeah

maiden briar
#

Yes I know, but I am calling it in onEnable

#

I mean Bukkit.getWorld(world)

fading lake
#

yes, and by the time you call it on onenable, the world doesn't exist

maiden briar
#

Ok what to do then?

#

Unload it in onEnable, removing the folder, regenerating?

fading lake
#

Thatll do

maiden briar
#

Ok I will try it

fading lake
#

What I do is I have a map that doesn't load when the server starts, then when my plugin enables, I delete the old world and duplicate the unloaded one

#

takes more storage but is safer

maiden briar
#

Ok

#

Yes I want a new one every time I restart, an entirely new one

fading lake
#

Oh I haven't used that before, interesting

maiden briar
#

No errors now

fading lake
#

does that work with specific maps? i.e hub worlds etc

fading lake
maiden briar
#

No, still same world

fading lake
#

ah

#

are you company hosting or doing it on your own box (vps, homehost, dedi)

maiden briar
#

Company

fading lake
#

Which one

maiden briar
#

From this company (ManHuntMC) I got a test server, the server is from HQS Hosting

#

I got it for free to test

dire marsh
#

What's manhuntmc? Dream's hosting service?

maiden briar
#

It is

maiden briar
dire marsh
#

Probably comes preinstalled with drop modifying plugins.

fading lake
#

"I host my server on hypixel survival"

maiden briar
#

What Hypixel survival?

fading lake
#

he said it was a mod, yet mods don't affect serverside stuff which was super sus

dire marsh
fading lake
#

I am

maiden briar
#

Oh ok

fading lake
#

you can't add plugins and stuff to it can you?

maiden briar
#

No I can

#

I uploaded my own plugin

#

I can try changing the seed, and regenerate chunk by chunk

#

I don't want to

fading lake
#

I don't think they use the permission system, I know mineplex doesnt which makes opping useless

maiden briar
#

I mean I am not using hypixel's service

fading lake
#

If your company wont generate a new world, I think either one of my or @last temples methods from above will be your best option

maiden briar
#

Ok which method?

#

Oh I am dumb, forgot to unload

fading lake
#

depends, either mine, duplicating an unloaded world and deleting the old one, or using the worldcreator which morice said

#

if unloading doesnt work, try either of the above

#

you may need to nms unload it tho

old dock
#

Is this a channel for plugin help aswell?

maiden briar
#

Still not working

fading lake
#

whats the issue gummeh

old dock
#
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage("Player command only");
            return true;
        }

        Player player = (Player) sender;

        if (cmd.getName().equalsIgnoreCase("gmc")) {
            player.isOp();
            player.getGameMode().equals(GameMode.CREATIVE);
            player.sendMessage("§6You are already in gamemode §cCreative");

        }
            else if (cmd.getName().equalsIgnoreCase("gmc")) {
            player.isOp();
            player.setGameMode(GameMode.CREATIVE);
            player.sendMessage("§6Your gamemode has been updated to §cCreative");
        }
            return true;
        }
    }

#

What am i doing wrong

fading lake
#

ask morice nicely how worldcreator works

#

any errors?

old dock
#

Nope

maiden briar
#

No errors

unreal quartz
#

you're not checking their gamemode

old dock
unreal quartz
#

if (statement) {
// code
}

fading lake
#

struggling to read its format

#

but from what I can tell, hes got conditions without the ifs

unreal quartz
#

player.getGameMode().equals(GameMode.CREATIVE) this line on its own does absolutely nothing

old dock
#

I see, I think i could just better start off again

fading lake
#

post the code in a block

#

Or if its easier

#

?paste

undone axleBOT
fading lake
#

then give us the link

quaint mantle
#

is better:

#

?learnjava

undone axleBOT
fading lake
#

Any courses that claim to teach you java not by doing or by no example are usually bullshit

maiden briar
#

@fading lake they advise there to create a totally new different world (other name) and to replace it, but how would I do that?

fading lake
#

my method or morices?

#

if morices I don't know, havent used that before

maiden briar
#

No nothing

old dock
#
 
if (gamemode == GameMode.CREATIVE()) ```
#

would that be correct

#

alright, thank you everybody for the help

maiden briar
#

The problem is that I can't delete the main world

#

Ok then if I comment it out it also does not work

fading lake
#

that depends

#

if you make a new one straight after I think its fine in 1.13 up, but on 1.8+ it leads to crash, fire burning hell on earth dearh destruction

maiden briar
#

It is not working, here is my code:

mainWorld.setKeepSpawnInMemory(false);
//Bukkit.unloadWorld(mainWorld, true);
File worldFile = mainWorld.getWorldFolder();
getLogger().info("Detected world folder: " + worldFile);
removeDirectory(worldFile);
mainWorld = Bukkit.createWorld(new WorldCreator(worldName));

if(mainWorld == null)
    throw new RuntimeException("Could not create a new world!");

getLogger().info("Successfully regenerated the world!");
#

No errors btw

fading lake
#

why are you throwing a runtime exception lmfao

eternal oxide
#

Is this yoru own world or an Overworld?

maiden briar
#

overworld

eternal oxide
#

The overworld can never be unloaded

maiden briar
#

It doesn't even print the generating, only this:

[07:57:58 INFO]: [DogLeader] Detected world folder: ./world
[07:57:58 INFO]: [DogLeader] Successfully regenerated the world!
eternal oxide
#

I can sysout that too

maiden briar
#

Ok, do you know how to regenerate the overworld to a completely new world?

eternal oxide
#

once the overworld is loaded it is blocked from being unloaded by Bukkit

maiden briar
#

Yes, and they said I can't remove it in onLoad (and that causes errors)

eternal oxide
#

if you want a new Overworld, delete the files/folders in onLoad of your plugin

maiden briar
#

I tried that as first step

#

But I get errors, and Bukkit.getWorld() returns null

hushed garnet
#

Making lava-proof items — but these events aren't doing it 100%...

EntityCombustByBlockEvent()
EntityDamageEvent()```
The item looks destroyed visually, but still can be picked up.

What event would I target to prevent the visual destruction?
eternal oxide
maiden briar
#

I mean if I do that in onEnable

eternal oxide
#

that means Bukkit has already checked its world, but not loaded when onLoad is called

#

You also can;t use the WorldCreator in onLoad

maiden briar
#

Ok

eternal oxide
#

You could try just deleting all teh mca files, leaving the folders

maiden briar
#

Huh what it just randomly works

#

Is it normal that the spawn is in a cave?

eternal oxide
#

its rare, but possible

maiden briar
#

Ok, because the cave was 15 blocks from the daylight

#

Yes it really works

eternal oxide
#

it may be your old world spawn and just luckilly happened to be in a cave

maiden briar
#

Now I am spawning 20 blocks higher so that is not the cause

#

Thanks guys for wasting time on me

eternal oxide
#

or the ground is 20 blocks lower?

maiden briar
#

I checked with coordinates

eternal oxide
#

k

#

So removing mca was the fix?

maiden briar
#

Removing the entire folder

eternal oxide
#

ok

rare cave
#

how can i migrate a server from online mode to offline mode

quaint mantle
#

server properties
online-mode set to false

rare cave
#

without data loss

#

I have 600+ players

karmic grove
#

spoilers :)

#

hes a youtuber btw and he said hes making big plugin lol

eternal oxide
#

Online the player UUID is generated by Mojang. Offline the UUID is generated by the server based upon the player name

rare cave
#

yep

#

i have my own uuid system

eternal oxide
#

all player data is stored based upon the players UUID

rare cave
#

im trying to solve this problem by using an extra uuid system like this

wispy plume
#

Anyone is familiar with Forge and knows how can I get mod list? Hypixel somehow did that, and kicks me if I use certain mods. (they don't send plugin message on their own)

eternal oxide
#

plugin messaging channels. Forge has a mod query channel

wispy plume
#

You possibly know some wiki for that?

#

Listing channels and data?

eternal oxide
#

I did see a wiki on it at some point

#

?wiki

undone axleBOT
lost matrix
eternal oxide
#

not that wiki]

wispy plume
#

Didn't know they had a Discord 😳

lost matrix
eternal oxide
#

probably

lost matrix
#

1.7 - 1.12 löl

#

Oh there is a section for FML2 protocol (1.13 - Current)

trail flume
#

Hiya is there a way to make a sound follow the player? (Basically the sound continues playing even when out of range)

lost matrix
trail flume
#

How do I stream it?

lost matrix
eternal oxide
#

oppurtunity, Using an aromic reference, If you decide to access a filed with this keyword

grim ice
#

o

eternal oxide
grim ice
#

@lost matrix cant u just do new Thread

#

or smth

#

i didnt read it all

#

idk if u mentioned it or not

quiet ice
#

yes, you can, but I have heard that it may be dangerous to do so

lost matrix
grim ice
#

i see

#

ty

waxen plinth
#

aromic reference

waxen plinth
#

👃

opal juniper
#

easy async plugin

public void onEnable() {
new Thread()
}

quiet ice
#

it would be easier if spigot had mixins. Md, please add mixins

opal juniper
#

? i’m not familiar with mixins?

quiet ice
#

because then we could register the thread in the craftbukkit main, thus shortcircuiting bukkit classloading logic

opal juniper
#

quick read of wikipedia and i agree with you

worldly ingot
#

Mixins defeat the purpose of Bukkit lol

crystal pike
#

Is it normal for summoned entities to be removed on server restart?

opal juniper
#

no?

crystal pike
#

Hmm.

opal juniper
#

an entity is an entity afaik

#

so there is no reason for the server to wipe them

eternal oxide
#

unless you spawned them using packets

tardy delta
#

is there a way to separate the boats in game? i want to have a method that drops a boat according to the wood type and idk what to check

#

maybe .getWoodType()

young portal
#

hi i wanted to ask why i can not add servers dynamically with the api to bungeecord

@Override
    public void execute(CommandSender commandSender, String[] args) {
        final String prefix = "§c/addserver <name>";

        if(args.length != 1) {
            commandSender.sendMessage(prefix);
            return;
        }

        String name = args[0];
        int port = ServerManager.getNextFreePort();

        ServerInfo info = ProxyServer.getInstance().constructServerInfo(
                name, InetSocketAddress.createUnresolved("localhost", port), "added by command", false);
        ProxyServer.getInstance().getServers().put(name, info);

        commandSender.sendMessage("added!");
    }

The command works, but when i add a server, every other server is removed from the list. An example:

The upper /server command was before issuing /addserver x, after i entered the command, server x appeared, but "lobby" and "test" were gone

#

im using the latest bungeecord build, i also tried it with waterfal#448 (newest) and a travertine version

opal juniper
#

something tells me that getServers() ain’t actually gonna return the internal map

#

in a mutable form at least

#

?jd

tardy delta
#

i cant really separate boats by this

#

one thing included multiple types

#

or wait

young portal
#

@opal juniper but however it still adds the server to the list, it just also removes all existing servers

#

issue remains the same using ConfigurationAdapter

lusty cipher
opal juniper
#

i’m not familiar with the bungee api though so i may not be the guy to take to about this

young portal
#

im gonna try and add 3 servers with a command instead of one

#

no work ):

opal juniper
#

tbh i’m not sure if you are supposed to add servers programmatically

#

this may be the mitigation against this

severe oracle
#

question: java player.getWorld().spawnEntity(arrowstormlocation, EntityType.ARROW); how do i spawn arrow like that and set its damage value ?

lean gull
#

hi i still need help with this
(sorry for not responding last time i asked, i went afk)

opal juniper
#

but you will want to give it a vector

#

and also you can listen to the EntityDamageByEntityEvent and modify the damage there

#

store the eid of the entity or something

#

just load it into a YamlConfiguration

#

@lean gull

lean gull
#

wat

#

u mean dis thing?
materials = YamlConfiguration.loadConfiguration(materialsFile);

opal juniper
#

or

severe oracle
#

i have another queston how do i spawn an arrow that kills iteself after some time ?

warm fractal
#

I have an ArrayList with blocks and I need to remove each block one by one with a delay, how can I do it?

opal juniper
#

YamlConfiguration config = new Yamlconfiguration;

config.load(File);

lean gull
#

ok but how do i set stuff in it

opal juniper
#

config.set…..

lean gull
#

example?

opal juniper
#

not at pc

#

config.setString(“example”, “examplevalue”);

#

iirc

lean gull
#

ok, and what do it do

ivory sleet
#

config.set

#

It takes an object and should work for every derivative of it iirc

prisma needle
#

Hey guys! Is there some way (perhaps a packet?) which will make a skeleton play the shooting bow animation?

ivory sleet
#

Yeah probably is

#

Or well

lean gull
#

is this the real command geek or am i gettin jebaited

prisma needle
#

That is what I thought, however after some google searches I can't seem to find a solution

ivory sleet
#

I don’t know, does the bow get pulled like the string?

#

Like once the skeleton prepares to shoot

opal juniper
#

Ow wow its the Actual commandGeek

prisma needle
#

Yeah, basically I want the skeleton to be in the state where the bow is pulled (ready to shoot)

lean gull
#

1 sec i gotta check somethin

opal juniper
#

buenny

#

if you @ me if you need more help

#

i will probs respond faster

lean gull
#

oh cool it's the real one

ivory sleet
#

However it’s probably assumable it’s totally client sided

prisma needle
#

yeah that doesn't matter, taking a look at that rn

ivory sleet
#

Well if it’s client sided, then you probably can’t trigger the animation yourself. Unless you fake a bow shoot maybe.

prisma needle
#

wdym?

ivory sleet
#

From what I understand it might be the case that the client is acting on its own when the bow shoot animation is happening

#

Which means you cannot control it with a packet

#

However you could fake a bow shot

prisma needle
#

well for my specific case, I need a skeleton to pull back it's bow when a player pulls back its bow... it's sorta a morph system, I need the animations to be the same

#

I don't need any actual functionality of an arrow being shot, just the looks

ivory sleet
#

Yeah hmm

ivory sleet
prisma needle
#

hmmm ngl that page doesn't make a ton of sense to me... but I can't find anything related to skeletons or a bow being pulled...

opal juniper
ivory sleet
#

Oo yeah

opal juniper
#

Although there is nothing specific to skeletons / bows on there

#

so idk

prisma needle
#

yeah can't find anything there either unfortunately...

opal juniper
#

maybe it is just a general "use item" which the client works out that it means fire bow

prisma needle
#

ahhh perhaps you are right

#

ah found something!

severe oracle
#

is there a property on Arrpw.class to set timer until it despawns ?

opal juniper
#

doubt

#

its just the global

prisma needle
#

rip still couldn't find anything related to making entities use their item...

glossy scroll
#

@young portal because the server actually has to point somewhere

#

if you add the server localhost:123456 you need to actually have a running minecraft server that is at that address

tardy delta
#

is a new instance of a command class made every time the command is executed? i assume not

young portal
#

as you can see in the screenshot, the server i added is listed, but every other server dissappeared. The Lobby server dissappeared as well and its obviously running because in the very same message it says im on the lobby server @glossy scroll

tardy delta
#

okay

wild reef
#

Hey I encountered a little problem. So on my local test server my plugin is running fine. But when it's running on my friends server it throws the following exception:

[15:47:08 ERROR]: Could not pass event CreatureSpawnEvent to LandSystem v1.0
java.lang.NoClassDefFoundError: org/bukkit/generator/WorldInfo
        at schmidi.services.WorldService.containsWorld(WorldService.java:26) ~[?:?]

Line 26 looks like this:

return this.registeredWorlds.stream().map(World::getName).anyMatch(name -> name.equals(worldName));

Couldn't find something relatable online by now, can anyone help?

grim ice
#

they dont have

#

an external library

#

that you have

#

prob

wild reef
#

leme check very quick

eternal night
#

no, your friend has to update their spigot server to latest

grim ice
#

o

#

but is their plugin "latest"

eternal night
#

it definitely is

grim ice
#

you cant now

#

know*

eternal night
#

I can

grim ice
#

?

eternal night
#

the class called did not exist till 2 weeks ago

wild reef
#

so update spigot could fix it?

grim ice
#

oh

wild reef
#

oh okay

eternal night
#

yes, have them run build tools and build latest

#

the new server jar should be able to run your plugin just fine

wild reef
#

alright thank you @eternal night I will tell him

eternal night
#

👍

lean gull
#

can anyone help?
Material announceAdvancementsMaterialDisabled = (Material) cfgn.getMaterialsConfig().getString("announceAdvancementsMaterialDisabledConfig");
https://i.imgur.com/7WsS0Qm.png

eternal night
#

you cannot cast a String to a Material ?

lost matrix
lean gull
#

what's that do

tardy delta
#

🥺

warm fractal
#

How can I reload a chunk in 1.17 spigot? I'm trying PacketPlayOutMapChunk but it doesn't work, or i'm doing something wrong.

tardy delta
#

a player with a group

#

then the group above?

#

or a server admin?

lost matrix
# lean gull what's that do

Material is an Enum. Usually you convert a String to an Enum by calling the Enums valueOf() method.
Material has a better method which doesnt throw an exception. Material.matchMapterial(String)

tardy delta
#

i dont get it

warm fractal
sharp bough
#

wtf is this question lmao

#

theres so much data missing

tardy delta
#

team group higher than admin that doesnt makes sense

sharp bough
tardy delta
#

i dont understand what youre talking about

sharp bough
# lean gull *w h a t*

do you understand how variables work, how to cast something, and how you use different types of variables ?

lost matrix
# warm fractal the old World#refreshChunk

Why "old". Its deprecated because it might not work on every client implementation as some throw away the chunk packet if they have it in their cache.
What you could do is

  1. Send the chunk unload packet
  2. Send the chunk map packet again
tardy delta
#

smh

sharp bough
tardy delta
#

assume thats a no

ivory sleet
#

?ask

undone axleBOT
#

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.

lean gull
#

idk man im quite new to this

sharp bough
lean gull
#

you gonna ?learnjava now?

tardy delta
#

u know what an enum is?

lean gull
#

no

sharp bough
#

so a variable is something, you can assign a variable to a type, for example

int num = 2, this defines the variable num with type int to 2

lean gull
#

that part i already know

tardy delta
sharp bough
#

a variable is in the memory, you can also storage data in the disk, to understand this you need to understand how a cpu, ram, disk, and motherboard work

tardy delta
#

he doesnt

sharp bough
# lean gull that part i already know

ok, when you cast a variable what you are doing is changing the type of a variable for example

string numString (string) = num

what this is doing is defining the new variable numString with type string to the (string) value of the variable num

lost matrix
# lean gull you gonna ?learnjava now?

One question. Why do you refuse to just sit down and learn the few java basics?
It will save you and use countless hours of struggle. You will progress so much faster
with spigot if you just go ahead and learn the java basics. It will go a long way.

lean gull
tardy delta
#

not

sharp bough
#

i mean i dont know anyone that does that

lean gull
sharp bough
#

do you understand how hard is it for us to help you if you ask that?

#

we have no fking idea what you mean

tardy delta
#

i dont think thats possible

warm fractal
upper vale
#

Not possible since most punishment plugins store their punishments themselves

lean gull
#

i'm starting to see why i should share more code sometimes...

tardy delta
lost matrix
tardy delta
#

😂

lost matrix
#

Or build bows

tardy delta
#

with that sticks

lost matrix
#

If the stick hold up after beating then it will be a robust bow

tardy delta
#

xd

sharp bough
opal juniper
#

was gonna say

tardy delta
#

i ruined my childhood

#

lol

severe oracle
#

how do i check if a player has open invoentry ?

umbral pagoda
#

hi

umbral pagoda
#

can anyone give me code for update scoreboard every 5s

tardy delta
#

getOpenInv

opal juniper
lost matrix
#

Check if the return value is not of type Crafting

tardy delta
#

7smile is too fast for me

umbral pagoda
#

@lost matrix

#

can anyone give me code for update scoreboard every 5s

quaint mantle
#

wat

lost matrix
severe oracle
#

then why does java if (player.getOpenInventory() == null) not work ?

lost matrix
warm fractal
#

Another question, I have a Location, how can I get all nearby blocks from a direction, for example I want to get all blocks in a radius of 5 in north direction of my location... I don't know if this makes sense, but it is...

severe oracle
#

wont it return internal crafting if i have player inventory open ?

sharp bough
#

would it be too bad if we start banning players that beg for code or refuse to learn java?

lost matrix
lost matrix
severe oracle
#

well i wanted to check if a player has no open inventorys

#

including player inv

lost matrix
young portal
severe oracle
#

btw is there an event that executes every tick ?

young portal
#

TickEvent...

tardy delta
#

Lol

severe oracle
quaint mantle
#

That sounds made up

young portal
#

that was a joke, you can use a runnable to run every 1 tick

#

sorry

severe oracle
#

thanks

lost matrix
lost matrix
lost matrix
grim ice
#

i always wonder

#

how was java made

lost matrix
severe oracle
lost matrix
lost matrix
grim ice
#

yes

lost matrix
quiet ice
#

java was made just like any other language: starting small and then bootstrapping over and over again

grim ice
#

how was C made

narrow furnace
#

...

maiden thicket
#

java was made w java

#

ez

quiet ice
#

Starting small and then bootstrapping over and over again

narrow furnace
grim ice
#

no like

#

what language was c made with

lost matrix
quiet ice
#

Assembly also started small and then boostrap over and over again.

maiden thicket
#

assembly

narrow furnace
lost matrix
narrow furnace
#

lmao

narrow furnace
quiet ice
#

well, technically assembly is a set of languages

#

but who cares?

grim ice
#

o

maiden thicket
#

imagine knowing assembly

narrow furnace
#

what did you think i meant when i said assembly

lost matrix
maiden thicket
#

yikes

grim ice
maiden thicket
narrow furnace
#

how

maiden thicket
#

the adam

#

of all language

#

s

quiet ice
grim ice
#

OH

#

U MEAN ASM

maiden thicket
#

buh

quiet ice
#

NOT ASM

grim ice
#

waht then

quiet ice
#

Well, not objectweb ASM at least

narrow furnace
maiden thicket
#

assembly is machine code

narrow furnace
quiet ice
#

#help-development is java-centric. Most people would think ASM means objectweb ASM because most of the time it means exactly that in java world

lost matrix
maiden thicket
#

ye

sharp bough
#

just code in binary

lusty cipher
#

what can I do if I forgot my bStats password? the guy didn't respond to my email

quiet ice
#

well, rip. Nothing you can do really

grim ice
#

im rly curious

#

how was coding even invented

lusty cipher
#

Ok because I'm not sure. Do I have to do anything on the website for custom graphs? Or is it just code in my plugin?

maiden thicket
# sharp bough just code in binary

01000010 01110101 01101011 01101011 01101001 01110100 00101110 01110011 01101000 01110101 01110100 01100100 01101111 01110111 01101110 00101000 00101001 00111011

quiet ice
#

The same way the laws of general relativity were "invented"

maiden thicket
#

ez

quiet ice
#

I mean, the search engine was created centuries ago, I bet coding was invented a few millennia ago

sharp bough
# maiden thicket 01000010 01110101 01101011 01101011 01101001 01110100 00101110 01110011 01101000...

01101000 01110100 01110100 01110000 01110011 00111010 00101111 00101111 01110111 01110111 01110111 00101110 01111001 01101111 01110101 01110100 01110101 01100010 01100101 00101110 01100011 01101111 01101101 00101111 01110111 01100001 01110100 01100011 01101000 00111111 01110110 00111101 01100110 01100011 01011010 01011000 01100110 01101111 01000010 00110010 01100110 00110111 00110000 00100110 01100001 01100010 01011111 01100011 01101000 01100001 01101110 01101110 01100101 01101100 00111101 01010010 01101001 01100011 01101011 01110010 01101111 01101100 01101100 01001110 01101111 01100001 01100100 01110011

maiden thicket
#

deception

quiet ice
#

This is all ASCII, why would you bother sending this shit

narrow furnace
undone axleBOT
narrow furnace
#

why are you asking these questions

quiet ice
#

To be honest, you should binge watch all of Tom Scott and related channels' videos if you are asking such questions

lost matrix
lost matrix
#

Computerphile, Tom Scott and consorts

ivory sleet
#

Was gonna say computerphile (3

lost matrix
#

Wait let me share my fav programming channels.

quiet ice
#

Ben eater is also an interesting one if you want to know how computers work

unreal quartz
#

tom scott 😍

lost matrix
#
jdh
LiveOverflow
Ben Eater
carykh
Code Bullet
CodeParade
Computerphile
Dani
Devon Crawford
John Hammond
Ottomated
Sam Hogan
The Coding Train
severe oracle
#

i am sorry for asking this but i still don't know how to check if a player has no inventoryes open

ivory sleet
#

isn’t like Player::getOpenInventory or something

lost matrix
severe oracle
#

ok

ivory sleet
#

Oo yeah the player inventory is always open isn’t it

severe oracle
#

and how do i do that ?

#

player.getOpenInventory().getType() == InventoryType.PLAYER doesen't work

unreal quartz
lost matrix
#

Michael Cera

umbral pagoda
#

ineed to update scoreboard place holders

#

o.getScore("§8| §fPlayers: §a" + PlaceholderAPI.setPlaceholders(p, "%bungee_total%")).setScore(2);

#

like this

#

and this update code not work

#

public void update(Player p){

    new BukkitRunnable(){
    @Override
    public void run(){

    if(p == null){
    this.cancel();
    }else{

    Scoreboard SB = p.getScoreboard();

    }

    }
    }.runTaskTimer(Main.plugin, 0, 5);
    }

}

#

@lost matrix

lost matrix
#

?paste

undone axleBOT
umbral pagoda
#

@lost matrix

umbral pagoda
#

@lost matrix

severe oracle
lost matrix
umbral pagoda
#

@lost matrix >?

narrow furnace
lost matrix
violet depot
#

I need a little help

umbral pagoda
#

in my code

narrow furnace
#

??

violet depot
narrow furnace
#

@umbral pagoda

umbral pagoda
narrow furnace
#

?paste

undone axleBOT
lost matrix
umbral pagoda
narrow furnace
#

where

#

are the indents

violet depot
#

Can anyone help me?

narrow furnace
#

wtf

umbral pagoda
#

scoreboard placeholders

narrow furnace
#

thats how u wrote it?

umbral pagoda
#

not updated

#

stay 0 0

lost matrix
# narrow furnace wtf

Dont question him. He is a real software engineer. Thats how its supposed to look.

narrow furnace
#

didnt realise

#

my bad

#

🙏

violet depot
#

i need a little help

lost matrix
#

?ask

undone axleBOT
#

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.

lost matrix
#

I have... no idea what im reading.
Could you try to explain it again with short sentences? Try using some dots pls.

narrow furnace
#

how do you type for 4 minutes straight and come up with that

lost matrix
violet depot
stark marlin
#

Is it possible with the API to request the player to open the advancements menu?

bronze night
#

Yo guys, i have a quick question. I am making a plugin for my friend's server and i wanted to add a cyclic message(If number of players is more than 0 then broadcast, wait 10 minutes and check if number of players is more than and continue the loop). And i want the message to be broadcasted but i don't know what to put there to broadcast the message(in the 34th line). Could anyone help me?

violet depot
#

I am working on a Plugin Whenever a player activates the plugin a Pig and Carrot on a stick given to the player but i want to respawn the pig and give carrot on a stick to player whenever he dies. What is the better way to do it?

lost matrix
raven ore
#

https://i.imgur.com/GybtQua.png
Bukkit.getScheduler().runTaskTimer(plugin, new BukkitRunnable() {
@Override
public void run() {
if (timer <= 0) {
player.sendMessage("§cExtra §f➤ §cYou have 30 seconds to write this in the chat : §f" + message);
start = LocalDateTime.now();
plugin.keyboard_practice_list.put(player,message);
cancel();
} else {
player.sendMessage("§cExtra §f➤ §cPrepare your keyboard in : " + timer);
}
timer--;
}
},0L,20L);

lost matrix
lost matrix
bronze night
#

cause i tried to get the number of online players

midnight quarry
#

what is the max and min temperature in a Minecraft world?

stone sinew
raven ore
#

so what can i do ?

lost matrix
raven ore
#

nop

violet depot
stone sinew
#

Didn't realize the imgur was a error lol

stone sinew
lost matrix
raven ore
#

its the "cancel()" line

#

yeah

lost matrix
stone sinew
#

ok. making sure.

raven ore
#

1.8

#

please help me

stone sinew
#

Do you run Bukkit.cancelTasks() anywhere?

raven ore
#

nop

lost matrix
stone sinew
# raven ore nop

Can you show the whole class/method. Can't see a reason that would cause an error.

raven ore
#
player.closeInventory();
            player.getInventory().clear();
            timer = 3;
            timer_game = 30;

            Bukkit.getScheduler().runTaskTimer(plugin, new BukkitRunnable() {
                @Override
                public void run() {
                        if (timer <= 0) {
                            player.sendMessage("§cExtra §f➤ §cYou have 30 seconds to write this in the chat : §f" + message);
                            start = LocalDateTime.now();
                            plugin.keyboard_practice_list.put(player,message);
                            cancel();
                        } else {
                            player.sendMessage("§cExtra §f➤ §cPrepare your keyboard in : " + timer);
                        }
                        timer--;
                }
            },0L,20L);

            Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {

                @Override
                public void run() {
                    Bukkit.getScheduler().runTaskTimer(plugin, new BukkitRunnable() {
                        @Override
                        public void run() {
                            if (plugin.keyboard_practice_list.containsKey(player)) {
                                if (timer_game <= 0) {
                                    player.sendMessage("§cExtra §f➤ §cSorry but your time is up");
                                    plugin.giveSpawn(player);
                                    plugin.keyboard_practice_list.remove(player);
                                    this.cancel();
                                    return;
                                }
                                plugin.title.sendActionBar(player, "§7✦ Time remaining : §f" + timer_game + "s§7 ✦");
                                timer_game--;
                            } else {
                                this.cancel();
                            }
                        }
                    },0L,20L);
                }
            }, 60L);

        }

    }```
lost matrix
violet depot
lost matrix
midnight quarry
#

like I know maximum is 2.0, but I am not sure about minimum

median anvil
#

does anyone know how to get all blocks inside a bounding box?

lost matrix
lost matrix
midnight quarry
lost matrix
# median anvil does anyone know how to get all blocks inside a bounding box?
  public static void forEachBlock(final BoundingBox box, final World world, final Consumer<Block> blockConsumer) {
    for (int x = (int) box.getMinX(); x <= (int) box.getMaxX() - 1; x++) {
      for (int y = (int) box.getMinY(); y <= (int) box.getMaxY() - 1; y++) {
        for (int z = (int) box.getMinZ(); z <= (int) box.getMaxZ() - 1; z++) {
          blockConsumer.accept(world.getBlockAt(x, y, z));
        }
      }
    }
  }
median anvil
#

ty

raven ore
#

@stone sinew ?

lost matrix
stone sinew
raven ore
#

ok sorry

white quiver
#

Quick question from a total Java noob
How exactly do I compile my plugin from a directory with all the class files + subdirectories to a .jar file?

eternal night
#

are you using a build tool ?

#

like maven or gradle

#

(if not, please do)

vague mason
#

Why don't you just save like 2 diagonals and then just check if block is between those two?

terse orbit
#

If I do Player.getUniqueID().toString() will it return the UUID or the Class@MemoryAddr

ivory sleet
#

Former

old dock
#

https://pastebin.com/CrSdKsSz (Whenever i execute the command it prints "/gmc" in chat after putting me in Creative, Anything i did wrong because i don't see it

terse orbit
eternal night
eternal night
stone sinew
# raven ore ok sorry
player.closeInventory();
player.getInventory().clear();
timer = 3;
timer_game = 30;

BukkitScheduler scheduler = Bukkit.getScheduler();

scheduler.runTaskTimer(plugin, new BukkitRunnable() {
    public void run() {
        timer--;
        if(timer <= 0) { // This is when the timer ends
            player.sendMessage("§cExtra §f➤ §cYou have 30 seconds to write this in the chat : §f" + message);
            start = LocalDateTime.now();
            plugin.keyboard_practice_list.put(player,message);
            cancel();
        }else {
            player.sendMessage("§cExtra §f➤ §cPrepare your keyboard in : " + timer);
        }
    }
},0, 20);

scheduler.runTaskLater(plugin, () -> {
    scheduler.runTaskTimer(plugin new BukkitRunnable() {
        public void run() {
            timer_game--;
            if (plugin.keyboard_practice_list.containsKey(player)) {
                player.sendMessage("§cExtra §f➤ §cSorry but your time is up");
                plugin.giveSpawn(player);
                plugin.keyboard_practice_list.remove(player);
                cancel();
                return;
            }else {
                cancel();
            }
            
            plugin.title.sendActionBar(player, "§7✦ Time remaining : §f" + timer_game + "s§7 ✦");
        }
    },0L,20L);
}, 60l);
``` In the code you posted above you did this.cancel() Your class isn't a runnable. Also here is a bit of cleanup to your code.
crystal pike
#

How would I go about using the ConversationContext when the conversation has ended?

#

Use it for what is needed, in the last prompt? or is there a better way, so you can access it outside the scope of the prompts.

lost matrix