#help-development

1 messages · Page 1398 of 1

dense goblet
#

the loader does the loading, api is just an interface

ivory sleet
#

Elaborate, compatibility as in possibly supporting legacy etc?

dense goblet
#

you can mess with the loader all you want and people won't need to change how they interface with the api

#

as long as the api maps to the new loader correctly and vice versa

quaint mantle
#

does this server provide help for older versions such as 1.12.2?

ivory sleet
#

I mean if the api is just interfaces why not shade it in? It’s plausible I don’t understand something here but yeah seems more logical to if they would have their api shaded

#

Yes space some people here do

quaint mantle
#

okay

#

my friend has asked me to strike a player with lightning when they kill a pig, but nothing happens so i'm not sure what's wrong, im not sure where to check for errors but nothing appears in the console log

    @EventHandler
    public void EntityDeath(EntityDeathEvent event) {
    if(event.getEntityType() == EntityType.PIG) {
        if(event.getEntity().getLastDamageCause() instanceof Player) {
            Player Player = event.getEntity().getKiller();
            Location Location = Player.getLocation();
            Block Block = Location.getBlock();
            Player.getWorld().strikeLightning(Block.getLocation());
        }
    }
    ```
worldly ingot
#

Though we advise against its use because we don't support it officially

worldly ingot
#

That being said, you could use that code in most Bukkit versions and it shoudl work lol. The only issue is this condition:
event.getEntity().getLastDamageCause() instanceof Player

#

last damage cause returns an EntityDamageEvent iirc

#

It will never be a player

quiet ice
#

Correct

quaint mantle
#

oh

worldly ingot
#

So you can get it, assign it to an EntityDamageEvent, check which event it was with an instanceof

quaint mantle
#

so

worldly ingot
#

If it was an instanceof EntityDamageByEntityEvent, cast it and work from there

quaint mantle
#

uh

#

if event.getEntity().getKiller() instanceof Player) {

#

?

worldly ingot
#

Suppose that would work as well. Yeah

quaint mantle
#

ok

#

thanks

worldly ingot
#

Though getKiller() is always a player

#

You should null check it instead

quaint mantle
#

oh

#

okay

#

does != work as a "is not" in java?

worldly ingot
#

Yes

quaint mantle
#

ok

#

thanks!

dense goblet
quiet ice
ivory sleet
#

I guess the uniformity is a good argument

dense goblet
# ivory sleet How would it introduce a disjoint? Or like could you elaborate just curious heh

Well fundamentally there would be a difference, partly in implementation but also partly in perspective. If you interface with vanilla through a mod, it "feels" the same as interfacing with, say, Tech Reborn. It allows you to detach from the idea that vanilla is the "base game", which imo is a good thing because you ideally want to keep your mod logic pretty independent (to ease with updating etc)

quiet ice
#

Basically do NOT use == and =! for everything that extends java.lang.Object

#

Enums and other singletons (such as threads) are an exception there though

brittle nova
#

It's a very specific question but I hope somebody can help me. So I want that there are particles on a location as long as the location is marked like pos1 or something. Bukkit.getScheduler().runTaskTimer(plugin, () -> { if(particlesActive){ PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(Particles.HAPPY_VILLAGER, true, location.getX() + 0.5, location.getY() + 0.5, location.getZ() + 0.5, 0.01f, 0.01f, 0.01f, 0.01f, 5); PlayerConnection connection = ((CraftPlayer) player).getHandle().playerConnection; connection.sendPacket(packet); } }, 20, 20); This is what I have till now

wraith rapids
#

that's not a question

quaint mantle
#

the code still doesnt work after
- if(event.getEntity().getLastDamageCause() instanceof Player) {
+ if(event.getEntity().getKiller() instanceof Player) {
still no errors, or im not looking in the right place for them

brittle nova
wraith rapids
#

it's a statement

brittle nova
#

So...?

wraith rapids
#

ask a question

quiet ice
#

PDC

#

PersistentDataContainer

brittle nova
wraith rapids
#

you can store the bukkitrunnable and put it in a Location -> runnable map

#

and then cancel the runnable once you remove pos1 from the map

brittle nova
#
            if(particlesActive){
                    PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(Particles.HAPPY_VILLAGER, true, location.getX() + 0.5,   
                    location.getY() + 0.5, 
                    location.getZ() + 0.5, 0.01f, 0.01f, 0.01f, 0.01f, 5);
                    PlayerConnection connection = ((CraftPlayer) player).getHandle().playerConnection;
                    connection.sendPacket(packet);
            }
}, 20, 20);``` That's what I have till now
wraith rapids
#

alternatively, you can check if a set of Locations contains pos1 in it every time you spawn a particle, and cancel the runnable if it doesn't

#

why are you using the protocol and nms for particles though

brittle nova
wraith rapids
#

the api

#

World::spawnParticle or Player::spawnParticle

brittle nova
#

World.spawnPaticle doesn't worked for me and I can't fixed it. So i used this

wraith rapids
#

why doesn't it work for you and what did you try to fix it

ivory sleet
#

Maybe he’s on a legacy version

wraith rapids
#

well that's not my fault

brittle nova
ivory sleet
#

Ah okay then the methods nny specified should be working fine

quaint mantle
#

how would i loop a command to run every few seconds, for example if i want the server to run "/?" every 1 second?

brittle nova
#
                player.getWorld().spawnParticle(org.bukkit.Particle.VILLAGER_HAPPY, location, 5);
}```This is what I did
#

And it doesn't work

brittle nova
timber abyss
#

Hi. Anyone has ready pack of server survival ? Just some simple plugins. Authme, log block, anty x-ray etc.

brittle nova
paper viper
#

are there any particles anywhere

brittle nova
paper viper
#

like are they at a different location?

#

or are they just

#

not there at all

brittle nova
#

there are not there at all

paper viper
#

hm

brittle nova
#

and i checked that particlesActive definetly is true

#

strange. When I do player.spawnParticle it works

floral flare
#

How do I get all the information from my MySQL table, in this case, all the players registered?

fringe escarp
#

Wouldn't that just be something like SELECT * FROM <table_name>?

#

I've got a quick question too: Do I understand correctly that Chat API stuff to make clickable chat messages are not part of the Spigot API? So I have to depend on BungeeCord which is like 14 MB just for that feature? :c

floral flare
#

I did, but how do I store it in a variable?

ivory sleet
#

No alfrink

#

Use the bungee chat api

floral flare
#

It becomes like an object, there is no way to reverse it

ivory sleet
#

It’s shaded in both bungeecord and spigot

fringe escarp
# floral flare I did, but how do I store it in a variable?

I'm not familiar with how you access the DB from code and I probably can't help you with that because I use MongoDB for my Minecraft stuff and SQLite at my workplace, but I'd imagine you can cast the object? You'll definitely find info on that online.

fringe escarp
fringe escarp
ivory sleet
#

Wym multi-server framework

fringe escarp
#

that's what it says here

ivory sleet
#

I told you it’s really not super overkill as the bungee chat api is shaded into both spigot and bungeecord so just add it to ur compile classpath?

fringe escarp
#

ah, I wasn't familiar with what shading is! Makes sense

ivory sleet
#

Ah sorry shouldn’t have made such bold assumptions lol

fringe escarp
#

I'm just not a java dev

ivory sleet
#

I see

#

What dev r u then 😮

quaint mantle
#

Imagine Dev

#

!

fringe escarp
#

C++! Haven't written any Java lately before I started this project like two days ago :P

quaint mantle
#

ew c++

fringe escarp
#

I really like C++, frankly

ivory sleet
#

C++ is nice (:

quaint mantle
#

sike

#

april fools

#

got you

ivory sleet
#

Vararg templates like geeez java look at this

ivory sleet
#

It’s not April 1st tho

opal juniper
#

ignore him

ivory sleet
#

Yeah whenever it isn’t python he starts circlejerking lol

sinful python
#

Okay dumb question but what is the thingy after the equals sign called so I can look up a tutorial on what it is/what it's used for
PotionMeta potionMeta = (PotionMeta) meta;
because I've never seen it before (I found it in an example plugin)

fringe escarp
#

You mean the manual cast?

queen topaz
#

Hey, I was wondering if there was a way I could implement my customized unicode into like skript or something

west berry
#

Hey is anyone good with multicraft?

#

I got a few questions

sinful python
fringe escarp
queen topaz
#

Is there a way i could integrate my customized unicode characters into the player tab and the chat?

simple summit
heavy island
#

Is the singleton design pattern a bad idea in java? I've got a class that I need to pass into many other classes because it's the general handler for a filter in my plugin. There should never be two instances of this class because if there were, there would be two different filters with differing contents.

ivory sleet
#

Idk I avoid singletons because it makes your program hard to unit test and it may also tightly couple your code which can be indefinitely hard to work with

#

Or maybe I should say static singletons

heavy island
#

I'm guessing that my issue is that the scope of the class is too wide.

ivory sleet
#

Wym?

dense goblet
#

is it ok/possible to save data in the world folder?

ivory sleet
#

I don’t think you should do that

#

But I guess it’s fine?

dense goblet
#

yeah it seems shady

#

but I want the data to be erased if the world is erased

ivory sleet
#

Ah

#

Then maybe use the world folder I guess

dense goblet
#

ig it doesn't matter much because I would store it per-chunk and overwrite it if a chunk is newly generated

ivory sleet
#

Oh yeah

dense goblet
#

but still it would take up space uselessly

#

so yeah using the world folder seems like the most sensible option

ivory sleet
#

Yeah it would remove the awkwardness for you a bit

heavy island
#

it's a class that at first only contained a bit of information about something but grew to contain so much information that it has to be passed to many other classes in my plugin. I think my issue is that I made the scope of the class too large and I'm struggling with handling the places it needs to be passed because of it.

fringe escarp
#

I use a singleton to handle database stuff. It's worth considering doing things differently though if you find a good approach, but with that f.e., I like doing it using a Singleton

ivory sleet
heavy island
#

indeed

fringe escarp
ivory sleet
#

I adhere to SOLID a lot tbf although in spigot plugins it isn’t needed though might still be worth paying attention to.

#

But Skyy assume that class is a context class then maybe it’s fine

odd gulch
heavy island
#

yes

#

I should not

ivory sleet
#

Benz arguably you don’t need to create an interface (dependency inversion) for everything such that you depend on high level abstraction instead of low level for instance.

simple summit
#

I made an interface to define my "big bag of crap" API and have my plugin implementation implement that interface, then I pass that around - because most everything needs the plugin anyway

#

and within my various classes i use a decoupling strategy to make testing easier

ivory sleet
#

SRP is probably something which is more essential to follow. But then for instance we have liskov substitution principle which if you declare a field to have the type HashMap instead of Map won’t make your entire application break but yes it’s generally good to follow (If S is a subtype of T then it should be substitutable with any subtype of T)

west berry
#

Why is my .conf doesnt work with multicraft jar file...?

simple summit
#

for the decoupling strategy i define an interface (within a command class for example) called IDecoupler then i also create a class Decoupler implements IDecoupler - then i have 2 constructors - one that takes my plugin and another that takes an IDecoupler. I can then either make a stub implementation of IDecoupler in my tests or use mocks

odd gulch
#

Dependency inversion is far from simply introducing interfaces. I just disagree with not conforming to conventions simply because the piece of software you are developing is a Spigot plugin.

west berry
#

it doesnt make the server bungeecord

ivory sleet
#

I’m not saying because of spigot we shouldn’t follow solid but I would argue that it might not be the most vital thing you should crucially pay attention to.

odd gulch
#

Also you don't have to summarize the principles. I know what they are and they are easy to look up. I just wanted to point out that just because you are developing a plugin doesn't mean you shouldn't follow proper conventions.

simple summit
#

Oh, and my 'decoupler' wraps about every call to my plugin big bag of crap

odd gulch
#

Down the road no matter what you throw together you will thank yourself for maintaining proper conventions and consistency. But I do agree that it is a cost/benefit issue.

simple summit
#

I avoid singletons and global/static state - makes for brittle code over time

#

static helpers are fine - so long as they have no side effects (only take action on the given inputs and output)

ivory sleet
#

Of course it’s significantly better if you follow those. However as I stated before it may not be needed to strictly follow it. In my opinion getting something to work should be the primary priority. Then after that it may be beneficial to engineer what you’ve done such that it follows solid more strictly I guess if you wanna extend it later (:

odd gulch
#

That I can agree with. Refactoring is a crucial part if you want to be agile instead of rigorously planning and designing your software.

simple summit
#

+1 - don't worry about doing it right until you are doing the right it

ivory sleet
#

Yeah absolutely.

odd gulch
#

Loooots of prototyping xd

simple summit
#

That's coming from someone with 16 years industry experience as a software developer here... just saying

ivory sleet
#

Hehe

simple summit
#

Was quite the revelation when I reconciled "test first is the only right way to create software" with my answer to "why don't i test first" being "because i can't - because IDK what i'm building yet"

#

Just NEVER allow your prototype / exploration code to become the delivered solution

#

stop yourself once you reach the point of knowing what you need to do and how to do it

#

That's the moment to go back and do it right

odd gulch
#

Behavior Driven Development really gave me the right reasoning for TDD. Write tests for the behavior you seek next.

simple summit
#

Indeed BDD is my preferred flavor of test first

#

works better with the human mind than "what do i test next (that doesn't yet exist)

#

anyway, back to refactoring my projects to share maven modules lol

#

It's funny because with all the experience I have - I've never touched maven before working on spigot plugins cuz the big tech companies i've worked for always do things their own way and don't generally use standard tools :/

honest storm
#

ross

#

dm? 😛

simple summit
#

Feel free

west lance
#

Anyone know how to listen for any event ?

ivory sleet
#

It’s avoided but I guess just register an event handler method for every event class which isn’t abstract

simple summit
#

as in wild card? like listen for them all? it's a reflection tick

heavy island
#

isn't there a saying about refactoring that somewhat says that you should be refactoring for at least the same amount of time you're writing new code?

west lance
#

Because

ivory sleet
#

(Could use EventExecutor) to do it more convenient

west lance
#
    Bukkit.getPluginManager()
        .registerEvent(
            Event.class, bukkitEventListener, hookPriorityToEvent(priority), bukkitEventListener, plugin);```
#

If I do that

#

It errors of HandlerList not found

ivory sleet
#

Yes of course

heavy island
#

there's no way to quickly listen for every event without registering every event

simple summit
#

ya, you can't register for the base type

heavy island
#

afaik, at least

simple summit
#

i'll post a snip of how i do it

ivory sleet
#

You could use smtng like dgraph or whatever it’s called

#

To loop through every class and then check if isn’t abstract and is a subclass of Event

#

Then register an event executor for it (:

west lance
#

Things is while using EventExecutor then I cannot do with EventHandler priority

simple summit
#

yup

ivory sleet
#

Yea you can

west lance
#

Am I stupid

#

Or I'm missing smtH?

ivory sleet
#

PluginManager#registerEvent takes one with priority

simple summit
#

I copied that from somewhere at some point

west lance
#

That requires a class

#

That extends Event

ivory sleet
#

Yes? Obviously

west lance
#

So you cannot do that using EventExecutor & Listener only

ivory sleet
#

Wat

#

Do smtng like Ross but have an interface/class that implements both Listener and EventExecutor I guess and use that then in registerEvent?

west lance
#

I do have that

ivory sleet
#

So what’s the issue

west lance
#

Yea well one now that is getting the classes

quaint mantle
#

if I wanted to spawn an armorstand with a custom head texture from say Minecraft-Heads, how would I do this? Im only stuck on how to put a custom skull on the armorstand

west lance
#

Cause I gotta hook into each event for each priority

#

That's damn a lot of listeners lol

#

Oh well

simple summit
#

There's only 2 ways to do it... 1 - the long way where you make a handler for every event type - or 2 - you use reflection like i posted

west lance
#

Yea I get that

#

Very stoopid

heavy island
#

just listening to an event isn't going to hurt you. All that really matters is what you're doing in your listeners.

simple summit
#

ya - there is no "every event" handler - that's not how the event system was built

west lance
#

I'm forwarding them into my system

odd gulch
#

I realize it is very old

west lance
#

Event doesn't contain EventHandler

#

So no

#

It throws error

heavy island
#

some events can be fired many, many times in a single second. Make sure that your initial checks are quick, otherwise you're going to lag the server pretty badly.

sharp moat
#

I got a question, prob best for staff to answer but if I release a plugin, but someone else already stole my name like 5 years ago, do I have to rename it?

ivory sleet
#

Benz I believe every event must fire at least once if HandlerList#getHandlerLists should give a collection of all handler lists as classes can come and go dynamically right?

west lance
#

I just check if there's the listener in a map by the event class name

#

That shouldn't slow down much

heavy island
#

are you trying to make a custom listener system?

west lance
#

I have an universal event system

#

So I'm forwarding bukkit to it

simple summit
ivory sleet
#

Not really

heavy island
#

what are the advantages of having a universal event system? I feel it would make code harder to read, given that the source of an event may not be obvious

ivory sleet
#

You could just use SkullMeta

#

Or maybe not

west lance
ivory sleet
#

Oh yeah it only takes an OffinePlayer iirc

west lance
#

And being able to write code that can work for different platforms easily

simple summit
#

ya, easy if you are dealing with a real player head - harder if you want decoration ones

ivory sleet
#

Yeah I figured

heavy island
#

you can use previously uploaded skins for skulls

west lance
#

Plus I can do stuff like ...

#
        Events.Simple
                .hook(PlayerJoinEvent.class, event -> {
                    simpleBenchmark(event.getPlayer().getName() + "-tool-init", () -> {
                        getInventory(event.getPlayer()).initTools();
                    });
                });```
ivory sleet
simple summit
#

You can, but you need to inject the texture URL into a player profile you create via reflection

#

the easy way - is to just use dispatchCommand 😛

#

and do it with vanilla spawn entity commands

ivory sleet
#

🤡

heavy island
#

switch between platforms... am I misunderstanding? I was pretty sure that Java is cross-platform by nature

simple summit
#

Programming is fun - i do it all day every day :x

ivory sleet
#

He meant Bukkit/Velocity/Nukkit/Bungee etc

heavy island
#

oh, I see

simple summit
#

So.... want me to share my custom skull solution... it's going to be like 3 classes and a few hundred lines of code 😛

west lance
#

LOOOl

ivory sleet
#

few hundreds 🐷

#

I’m curious now

odd gulch
simple summit
#

The plugin i wrote for the survival server i run is over 40k lines :x

ivory sleet
#

😅

west lance
#

I mean my library itself is 20k 😄

ivory sleet
#

@paper viper

simple summit
#

thats the SLOC from running a coverage report

ivory sleet
#

How many lines are media lib?

heavy island
simple summit
#

it's all code i authored lol

ivory sleet
#

My plugin is one line beat that

heavy island
#

I don't think it takes hundreds of lines. I haven't tested this myself, but someone linked it here a bit ago.

simple summit
#

GL with that

ivory sleet
#

You could just write a big fat utility and the make it into a one liner (:

sage swift
#

PlayerInventory should have 41 slots, right?

simple summit
#

I mean, a big part of the lines i quoted for the custom skull stuff is a general class for NSM/OCB reflection and an easy HTTP fetching class i wrote

#

i mean, you don't have to validate the skin texture 😛

west lance
#

I mean I Just use nbtapi

heavy island
west lance
#
  public InteliSkullItem texture(String texture) {
    this.texture = texture == null ? defaultTexture : texture;
    applyNBT(
        nbt -> {
          NBTCompound skull = nbt.addCompound("SkullOwner");
          UUID id = UUID.randomUUID();

          if (InteliVersion.isOrAfter(16)) skull.setIntArray("Id", _16_fromUUID(id));
          else skull.setString("Id", id.toString());

          NBTCompoundList compoundList =
              skull.addCompound("Properties").getCompoundList("textures");
          compoundList.clear();

          NBTListCompound textures = compoundList.addCompound();
          textures.setString("Value", texture);
        });

    return this;
  }```
ivory sleet
#

Weird use of a lambda but I guess nice

west lance
#

This is inside my item builder

ivory sleet
#

¯_(ツ)_/¯

west lance
#

So Consumer is my bitch

ivory sleet
#

Still no really need for that but I guess it’s cool

simple summit
#

I just do that part of the lifting with string concatenation 😛

ivory sleet
#

I just use static all in one class

#

Also open for prs (:

simple summit
#

classic C style

heavy island
#

I only use static. Sometimes I forget to add it to my inner classes, but it always works out in the end.

west lance
#

:DDD

ivory sleet
#

Lots of static, lots of fun right

heavy island
#

yes. I tried to use non-static when I first started making plugins, but it was too annoying

west lance
#

GUICE 🤮

simple summit
#

I do hate injection frameworks - the only person who understands an application built on them is the person who made it... and only for about 3-6mo before they forget the details and are also left wondering where the hell that wrong instance came from 😛

west lance
#

Like

#

How do you stay so consistent lol

simple summit
#

Anyone know of a plugin to obfuscate bedrock patterns? A quick google just tries to tell me how to obfuscate my plugins lol

west lance
#

bedrock patterns

simple summit
#

obfuscating bedrock patterns is on my 1.17 punchcard

west lance
#

What's that

simple summit
#

bedrock is always generated the same - there are tools that can be used to find a location from screenshots or streams / etc

west lance
#

I guess gotta make ur own

#

Or just have flat bedrock

simple summit
#

easy enough TBH, just figured i'd try to be lazy

west lance
#

If you're lazy, use flat

simple summit
#

hard part is getting the layers dynamically rather than just hard coding them

#

then ppl will bitch at me that it's too non-vanilla

west lance
#

Lol

simple summit
#

IKR

west lance
#

Well just have a chance of bedrock at 0-3

#

then if it's chance met, put bedrock if not stone

simple summit
#

until world gen changes, and there's top bedrock in the nether

#

it's easy enough to shuffle the layers on chunk create

#

just have to find a good enough way to future proof it

west lance
#

Hmm

#

version > 17 ? -... : 0

simple summit
#

i was thinking of "learning" the layer heights by doing a chunk scan - but ya

west lance
#

I guess just get the sections array lenght

simple summit
#

like the first time a chunk is generated if the plugin doesn't know where that world puts bedrock it searches for it then remembers

west lance
#

But thing is

simple summit
#

but then once world heights increase - any old chunks will be different than new ones and crap

west lance
#

I have high doubts that they will have same chunk structure

#

They'll probs rewamp the whole chunks system

simple summit
#

well, chunks / blocks will still be exposed in the spigot API 😛

west lance
#

Well spigot will have to adapt tho

simple summit
#

I'm thinking of just hooking the new chunk event and mutating the chunk just after it has been generated instead of trying to directly modify world generation

#

anyway, i'll get'er done one way or another

cinder thistle
#

that sounds horrible

#

imagine loading a new chunk and then all the sudden every block in it changes

simple summit
#

no lol

#

just shuffle the bedrock layers

#

so like 0-4

#

scramble them

cinder thistle
#

still would affect mining but I see

simple summit
#

mining in the bedrock sponge is already ... what it is lol

west lance
#
        fileController.prerequisites(
                fcp -> fcp.loadFromResources(resources -> {
                    resources.option(Paths.CopyOption.COPY_IF_NOT_EXIST);
                    resources.filter(path -> !path.contains("modules"));
                })
        );

Lol I just copied my whole plugin zip into the plugin folder, genius...

vital ridge
#

Hey, does anybody have any experience with entityportalenterevent?

#

I have a problem with that

#

Basically a normal portaltravelevent does not listen leaving end

#

So i have to use the portalenter

#

The problem is

simple summit
#

leaving end via the exit portal - that's a player respawn event

vital ridge
#

Ik

#

and thats basically

#

messing somethings up aswell

simple summit
#

ya, it sucks lol

vital ridge
#

basically

#

I have a plguin

#

and I need to check

#

if player leaves the end

#

and then he gets tped to a certain location

#

now im trying to do that under the entityportalenterevent

#

or whatever it is called

#

im using this code

#
@EventHandler
    public void onEnter(EntityPortalEnterEvent e) {

        System.out.println(e.getEntity().getWorld());

        if (main.eventStatus) {

            if (e.getEntity() instanceof Player) {

                Player p = (Player) e.getEntity();

                if (e.getEntity().getWorld().getName() != ("world")
                        || e.getEntity().getWorld().getName() != ("world_nether")) {

                    p.teleport(main.spawnLoc);

                }

            }
        }

    }
#

The thing is

#

this doesnt let me to go into the nether aswell

#

it just tpes me to the main.spawnLoc

#

Though i dont get why it does that

#

basically

eternal oxide
#

what is main.spawnLoc?

chrome beacon
#

Don't compare strings with !=

simple summit
#

^

west lance
#

Yea

simple summit
#

must use .equals

vital ridge
#

Oh okay

west lance
#

This is not javascript

vital ridge
#

main.spawnLoc is a location only set if a event starts

#

its a location of a trail start point

simple summit
#

and here's how I detect a respawn due to exiting the end via exit protal

        Location playerLoc = player.getLocation();
        // Exiting the end by the central portal triggers a respawn - detect that case here (yes the player is marked dead too)
        if (playerLoc.getWorld().getEnvironment() == World.Environment.THE_END
                && MoreMath.isBetween(playerLoc.getX(), -100, 100)
                && MoreMath.isBetween(playerLoc.getZ(), -100, 100)
        ) {
            if (playerLoc.getBlock().getType() == Material.END_PORTAL || playerLoc.getBlock().getRelative(BlockFace.DOWN).getType() == Material.END_PORTAL) {
                extraInfo = (extraInfo != null ? "; " : "") + "exit-end-via-portal";
            }
        }```
west lance
mortal hare
#

i've never seen kde user in spigotmc ever

west lance
#

Lol

mortal hare
#

you're the rare breed of powerusers

west lance
#

I'm guessing you're also a Lithuanian lol

mortal hare
#

what's about it?

west lance
#

As me

mortal hare
#

oh

west lance
#

Yea

#

Seeing a lithuanian is also a rare breed here

vital ridge
silver shuttle
#
            Material sellitem_material = sellitem_seller.getInventory().getItemInMainHand().getType();
            ItemStack[] contents = sellitem_seller.getInventory().getContents();
            int counter = 0;
            for (int i = contents.length; --i > -1;) {
                if (contents[i] != null && contents[i].getType() == sellitem_material) {
                    counter += contents[i].getAmount();
                }
            }

So this code ^^ gives me the total amount (counter) of items matching the item material of the item in hand.
How do I do the exact same thing except matching all metadata of an ItemStack, except amount?

simple summit
#

The players location will be at the "pre respawn" location when the event is fired.
So i check if they were in the end, on the central island, and look at if their feet are in an end portal block

tacit drift
#

is there a way to allow players

#

to run while eating normally

#

server side?

west lance
#

That's a client thingy

mortal hare
simple summit
#

No, exiting the end via the exit portal results in a respawn event being fired

mortal hare
tacit drift
#

so basically

simple summit
#

so this is how i determine if they are respawning due to exiting the end, or if they really died

tacit drift
#

it should be something intentional

#

:))

mortal hare
#

basically whenever he eats, increase his velocity maybe

tacit drift
#

and consistent

west lance
#

That actually is 199iq

tacit drift
#

i had a player saying that he has a noslow bug 🤣

west lance
#

It always slows down for the same amount

vital ridge
west lance
#

so you can hardcode the amount of velocity

vital ridge
#

I dont understand that part

mortal hare
#

the thing is it would allow to autosprint

vital ridge
#

and the MoreMath

mortal hare
#

without holding any buttons

#

while he is eating

west lance
#

AntiCheat what's that

#

I mean

#

You should get his velocity first of all

#

To see if he's moving or not

simple summit
#

That's just code outside the snip i took - MoreMath is my own utility library the function used is just as described 😛

        return min <= value && value <= max;
    }```
tacit drift
#

he said that he could run and bow because of the server

#

🤣

mortal hare
#

yes, but still, lets say he started eating before he stopped

tacit drift
#

and eat

#

etc

mortal hare
#

he would instantly would run again

#

since the velocity would change

tacit drift
#

but i still think that he was hacking

west lance
#

Okay this require a lot of brains to do

#

That's not possible

tacit drift
#

or is using a bugged client

west lance
#

You cannot just run and bow

mortal hare
#

that's impossible

tacit drift
#

"cheatbreaker"

#

🤣

cinder thistle
#

oh dear god

tacit drift
#

told him to reproduce the bug

mortal hare
#

that's possible only from clientside by sending invalid packets to the server

tacit drift
#

he said that he can't

cinder thistle
#

cheatbreaker after 2018?!

#

criiiinge

west lance
#

Lol

mortal hare
#

there's shift bug in 1.16

#

where people could look like using shifting hacks

tacit drift
#

we are on 1.8

mortal hare
#

but i think its patched

#

by purpur

tacit drift
#

and he was using 1.8

mortal hare
#

since i don't see any for couple weeks

west lance
#

1.8 doesn't have many bugs

#

If you use paper

tacit drift
#

taco

west lance
#

Just god dammit use an anticheat

tacit drift
#

we do

west lance
#

And you'll see invalid packets

tacit drift
#

updated ncp

#

and works (most of the time)

west lance
#

ncp damn

mortal hare
#

better, use protocollib, and code your own packetlistener which checks what packets his client sends to the server

west lance
#

That's a high quality anticheat

mortal hare
#

and build your own patch

tacit drift
#

anyway, thanks for the help 👍

vital ridge
#

is this needed?

#

seems like no

#

😄

cinder thistle
simple summit
#

No, that's just the point in the code you would know that they respawned due to exiting the end 😉

vital ridge
#

Okay but

#

the locations you check

#

in between

#

Why is this necessary?

#

you are getting like the center?

#

of the end

#

where the portal

#

usually forms?

simple summit
#

I'm checking that the player is #1 respawning from somewhere in the end #2 they were on the center island (really that +/- 100 check could be +/-10) and #3 that they were standing in an end portal block when they respawned

#

the players location inside the player respawn event handler is their location BEFORE they actually respawn - aka where they 'died'

cursive trellis
#

can anybody help whenever im following this turoial and i double click on the build tools.jar folder it only makes 1 extra folder however it should be making loads of other folders here the tutorial btw : https://youtu.be/clGVQXsVdiI
YouTube

vital ridge
#

I mean

#

&& MoreMath.isBetween(playerLoc.getX(), -100, 100)
&& MoreMath.isBetween(playerLoc.getZ(), -100, 100)

#

this is more like

#

special ensuring

#

i dont think its like too necessary

#

but its good

cursive trellis
#

can anybody help

west lance
#

Hmm guys how does one loop thru Path children?

simple summit
#

It's cheaper to check some floats than query blocks (well, that was my thought anyway - IDK if it's right)

west lance
#

Cause rn

#

I'm getting the same folder that it's at

#

if just iterating thru it

simple summit
#

But you are correct that it is not strictly necessary to check that the player is near the exit portal location before seeing what they are standing in to decide if they took an end portal

vital ridge
#

Ill use it anyways

#

but ill split them apart

#

like remove the &&

#

since i need to check a real respawn event

#

aswell

#

so i can just add else

silver shuttle
#
            Material sellitem_material = sellitem_seller.getInventory().getItemInMainHand().getType();
            ItemStack[] contents = sellitem_seller.getInventory().getContents();
            int counter = 0;
            for (int i = contents.length; --i > -1;) {
                if (contents[i] != null && contents[i].getType() == sellitem_material) {
                    counter += contents[i].getAmount();
                }
            }

So this code ^^ gives me the total amount (counter) of items matching the item material of the item in hand.
How do I do the exact same thing except matching all metadata of an ItemStack, except amount?

mortal hare
#

metadata

#

wdym by metadata

#

metadata is data container

silver shuttle
#

any ItemStack data like displayname etc

mortal hare
#

by lore?

silver shuttle
#

basically just count the amount of items matching ItemStack

mortal hare
#

well if you want to compare the metadata objects

#

just use ==

eternal oxide
#

isSimilar() shoudl compare all bar amount

mortal hare
#

or compare the itemstacks

silver shuttle
#

so if the itemstack is a diamond with amount = 1 and you have a stack of diamonds in your inventory counter = 64

mortal hare
#

like he's saying it to you

silver shuttle
#

I tried this

#

but it didnt work

#

returned 0

#

and sellitem_sell_item has Amount of 1

simple summit
#

using == was a troll

#

you want to look at .isSimilar() like ElgarL said

silver shuttle
#

okay hold n

silver shuttle
#

so like this?

simple summit
#

looks right enough to give it a run - ya

silver shuttle
#

yeah seems to worek

#

let me test it in the other instance

#

ayy it works!

simple summit
#

GG 😄

silver shuttle
#

Thanks a lot

#

also this really annoys me, can you change your spigot name?

simple summit
#

== and != almost never work - except for checking for null
This type of equality checks that the objects are the exact same INSTANCE

#

not if they contain the same information

silver shuttle
#

yeah I used it for same material before

simple summit
#

ya, material is an enum - there is only ever one instance of each material type so == works there just fine

silver shuttle
#

ok

#

its not possible to change your spigot name is it?

simple summit
#

== works fine for integers too - but not so well for floating point numbers (float/double)

silver shuttle
#

i hate this old ass name

simple summit
#

no idea on that one

vital ridge
#

Ross

#

I didnt use your method but

#

I found a better one

#

Not a method just a simple check

#

you check if players world is equal to end

#

aka the world he enters from

#

then you run a task later

#

and execute your code there, that worked fine for me

#

But thanks for the help tho!

wary harness
#

why do I get

#

this error

#

java.sql.SQLException: Operation not allowed for a result set of type ResultSet.TYPE_FORWARD_ONLY.

#

from some people which use my plugins they report it

#

I can't recriate it ?

eternal oxide
#

How are you accessing your resultset?

#

only with next() or others?

silver shuttle
#

Umm I kind of have a problem

#

How would I add a TEXT value with "" in it to the MySQL?

eternal oxide
#

escape them

silver shuttle
#

problem is

#

wait hold on

#

ok nvm

eternal oxide
#

or encode the string with Base64

silver shuttle
#

yeah I can just replace " in string with \" if I want it to be an ItemStack

#

so thatll probs work

#

thanks

#

Wait how would I do this: String itemsdbstring = String.valueOf(item).replace("\"", \"");

#

Does this work?
String itemsdbstring = String.valueOf(item).replace("\"", "\\\"");

item = testitem"name"
itemsdbstring = testitem\"name\"

#

How do I do that

#

it doesnt work

ivory sleet
#

Pulse to the rescue

paper viper
#

StringEscapeUtils, and the escapeJava method can do this

#

Or

#

if you don't have that

#
/**
 * escape()
 *
 * Escape a give String to make it safe to be printed or stored.
 *
 * @param s The input String.
 * @return The output String.
 **/
public static String escape(String s){
  return s.replace("\\", "\\\\")
          .replace("\t", "\\t")
          .replace("\b", "\\b")
          .replace("\n", "\\n")
          .replace("\r", "\\r")
          .replace("\f", "\\f")
          .replace("\'", "\\'")
          .replace("\"", "\\\"");
}
#

🤡

#

lol

silver shuttle
#

ummmmm

ivory sleet
#

What is this black magic

silver shuttle
#

oh

#

i get it

paper viper
#

just saying, base64 may be better

#

lol

cunning cloak
#

How would I make a GUI that when you click on a stick it would go to another inventory in a separate class?

torn oyster
#

anyone know the maven repo for essentialsX

torn oyster
#

that didnt work

chrome beacon
#

Show us

torn oyster
#

can i send my entire pom.xml

#

?paste

queen dragonBOT
torn oyster
#

its a mess

open vapor
#

whats the class name of the fireball entity

unkempt ore
#

Trying to get the world spawn accurately, but it seems World#getSpawnLocation is just giving me a location in integers

open vapor
#

because eclipse says that fireball doesn't exist

unkempt ore
#

So I end up with the location at the edge of the block when I teleport to it

torn oyster
#

fire charge i think

#

no

#

its Fireball

eternal oxide
unkempt ore
#

@eternal oxide Yeah, figured I could just pass the teleport method the double getters

#

But it's kind of annoying how the teleport method doesn't unpack the double methods to begin with

#

From a Location

open vapor
#

how do I set the explosive power of the fireball?

eternal oxide
#

Just pass the location itself. If it tp's you to the edge of a block then thats where the spawn is

unkempt ore
#

But when I set the spawn using /setworldspawn it tells me I set it down to decimals

chrome beacon
unkempt ore
#

Wait, no it doesn't

torn oyster
#

i know

#

i have tried it

unkempt ore
#

Yikes, I need sleep

torn oyster
#

but it searches for it in the spigot repo

chrome beacon
#

Add EssentialsX to your POM like the guide says

#

If it doesn't work post that POM

torn oyster
#

it says


Cannot resolve org.bstats:bstats-bukkit:1.8

torn oyster
#

nvm just this

torn oyster
chrome beacon
#

._. And what POM is that

torn oyster
#

wdym

chrome beacon
#

Show your POM

torn oyster
#

?paste

queen dragonBOT
torn oyster
silver shuttle
#

How do I remove the displayname from the itemdata of an ItemStack?

west lance
#

Just set it to " "

silver shuttle
#

no cant

#

I need it to be the default name of the item

#

or does that reset it?

chrome beacon
#

wat

silver shuttle
solemn shoal
#

how can i detect if a command is ran by console?

west lance
#

You just

#

create new itemmeta for it

chrome beacon
west lance
#

Wait can you

mortal hare
chrome beacon
solemn shoal
#

thats what im trying to use @mortal hare

west lance
#
if (sender instanceof ConsoleCommandSender)
silver shuttle
solemn shoal
#

doesnt work @west lance

west lance
#

wdym doesn't work

chrome beacon
wary harness
#

do it by is instance of Player

#

and then put !

#

at front

solemn shoal
west lance
#

in that case use instanceof Player

chrome beacon
solemn shoal
#

instanceof Player still fires it

wary harness
#

why ?

solemn shoal
#

if(sender instanceof Player) HumanInterface.SendResultsToPlayer(p);

mortal hare
ivory sleet
#

if (if) { } else if (else) { }

mortal hare
#

even NMS prevents setting amount

#

for Itemstack AIR

chrome beacon
wary harness
solemn shoal
#

nvm i found my issue

wary harness
#

xd

mortal hare
#

it throws TRAP exception whenever you set amount to AIR itemstack in NMS lol

ivory sleet
#

Dovidas maybe you’re using unsafe 👀

cunning cloak
#

How do I define Player in a listener?

hybrid spoke
gaunt eagle
#

i need a little bit help xD

#

Main:

#

Config:

cunning cloak
gaunt eagle
#

I can't see a mistake

hybrid spoke
cunning cloak
cunning cloak
#

I have

hybrid spoke
#
// psssst... learn java
Player p = (Player) e.getWhoClicked();
cunning cloak
#

oh

gaunt eagle
#

yeap here is

unreal quartz
#

not where you want it to be

gaunt eagle
#

oh

#

really xD:?

#

le me try that

worldly ingot
#

Yes. Right now, your config.yml is being exported under net/turkgamerz/minigames/

#

If you were to open your .jar file with some archive program like 7zip or WinRar, you'd see it there

#

Though Bukkit expects it to be in the root

gaunt eagle
paper viper
#

no idea what language that is

gaunt eagle
#

turkish

#

simply

unreal quartz
#

for all of them

gaunt eagle
#

gerekli-oyuncu = required-players
geri-sayim-suresi = cooldown-time
lobi-spawn = lobby-spawn
dunya = world
arenalar = arenas

#

xD

gaunt eagle
#

can u explain please ^^

#

same names ?
"dunya" and "dunya"?

unreal quartz
#

no you must move them to the same indentation level

#

so that looks like 4 spaces for 'dunya' under '0', since x, y, z, pitch, yaw are the same section it must be at the same level which is 4 spaces

spark swan
#

how do i get player killer on playerdeathevent

gaunt eagle
#

im dumb, sorry -_-

#

is it a problem if I use space or tab? So I can use both?

unreal quartz
#

don't mix spaces and tabs, generally causes problems

unreal quartz
spark swan
#

e.getEntity().getKiller();

solemn shoal
#

hey question

#

how can i send RGB text?

wraith rapids
#

use bungee chat components

solemn shoal
#

1.16 supports this but I can't find any api to use it

wraith rapids
#

bungee chat components and ChatColor.of or something

solemn shoal
#

ah

gaunt eagle
#

how can i fix it?

solemn shoal
#

ChatColor.of doesnt exist?

wraith rapids
#

import bungee's chatcolor

gaunt eagle
#

1.16.5

wraith rapids
#

bukkit's chatcolor is an enum

solemn shoal
#

ChatColor.valueOf(string) exists

#

ah

wraith rapids
#

there are like 3 chatcolor classes

ivory sleet
#

Oh yeah bungees isn’t an enum right

wraith rapids
#

myeah

#

they changed it to a regular class with public static final fields when rgb rolled around

solemn shoal
#

thank you

ivory sleet
#

Ah

gaunt eagle
#

isn't that yaw and pitch?

unreal quartz
#

looks like it

cinder thistle
#

I believe so

quaint mantle
#

yes it is

storm tiger
#

How do i load a plugin before other on bungee? softdepends doesn't seem to work.

wraith rapids
#

delete the other plugin's jar and force the server to restart

solemn shoal
#

mmm converting bungee's chatcolors to ansi sequences

storm tiger
#

deleting a plugin jar and forcing a restart does absolutely nothing lol, why would you even ask me todo that?

wraith rapids
#

it stops the other plugin from loading

#

therefore your plugin loads first

storm tiger
#

... your joking right.

wraith rapids
#

you just can't comprehend my genius

quaint mantle
#

there is a loadbefore thing right

#

im not sure if its on bungee

storm tiger
#

uh i think thats just bukkit

solemn shoal
#

time to see if this works

#

nope

wraith rapids
#

w0t

solemn shoal
#

when all your code works perfectly

drowsy helm
#

Anyone know what i can pass in the signature for the Property constructor when setting a texture for a GameProfile

#

oh wait im dumb lol

west berry
#

?paste

queen dragonBOT
torn oyster
#

is there a way i can make it so you can apply lvl 6 enchants to items

drowsy helm
#

addUnsafeEnchant

torn oyster
#

no

#

with anvils

#

lvl 6 books

#

combine with item

drowsy helm
#

could possibly give it custom nbt and listen to anvil prepare event

torn oyster
#

nonono

#

when i put it into an anvil

#

all it does

#

the output

#

is sharp 5

tall siren
#

Well, you have to take over the anvil at that point and add sharp 6 to the sword

#

You can't rely on an anvil to manage unsafe enchants

daring sierra
quaint mantle
#

omg

quaint mantle
#

TheAddons PR

tall siren
#

In other news, I'm trying to get the general statistic for Mobs Killed from a player, as seen here. According to my stack trace I need to specify an entity type, which I am well aware how to do, but that is not what I want to accomplish, as that would only output the kills of that mob. Any thoughts?

solemn shoal
tall siren
torn oyster
quaint mantle
#

a plugin i work on when i have no ideas

solemn shoal
#
String output = ChatColor.GREEN + "--RGB TEST--\n" + ChatColor.RESET;
for (int y = 0; y < 16; y++) {
    for (int x = 0; x < 32; x++) {
        byte r = (byte) (x*8),
             g = (byte) ((y-(x/2))*16),
             b = (byte) (y*16);
        output += ChatColor.of("#"+String.format("%02X",r)+String.format("%02X",g)+String.format("%02X",b))+"M";
    }
    output += "\n";
}
sender.sendMessage(output);``` @daring sierra
torn oyster
#

should i update from java 1.8 to java 11

quaint mantle
#

yes

#

now

hybrid spoke
daring sierra
#

yes

tall siren
#

explain?

daring sierra
torn oyster
#

does it need to be jdk

quaint mantle
solemn shoal
#

full RGB chat :pog:

quaint mantle
#

you need the JDK and SE

solemn shoal
#

right, no emotes

quaint mantle
#

SE to run and JDK for development

torn oyster
#

can u link jdk and se

hybrid spoke
#
int killed = 0;
for(EntityType type : EntityType.values()) {
  killed += FROM_STATISTIC
}

@tall siren

solemn shoal
#

@quaint mantle you dont need the JRE if you have the JDK

quaint mantle
#

?

#

dont you need the JRE to actually run java

drowsy helm
#

JRE = java runtime environment

#

you need it lol

torn oyster
#

does installing java require a restart

quaint mantle
#

no

hybrid spoke
torn oyster
#

is this the correct file

#

fore SE

#

for SE

solemn shoal
#

because the JDK comes with the JRE

quaint mantle
#

since fucking when

#

i had to install both

torn oyster
#

is it Java SE Development Kit

wraith rapids
#

since always

quaint mantle
#

so i have a leftover 600mb on my drive from unneeded SEs

#

yeah im confused idrc

torn oyster
#

is this the site i wanna go to for java 11

drowsy helm
#

yes

#

that is the oracle website

torn oyster
#

is it java SE or JDK

drowsy helm
#

jdk

#

SE is jsut standard edition jre

torn oyster
#

but what if i am not developing on that computer

drowsy helm
#

wdym

torn oyster
#

i have a dedicated server for my servers

#

yea

drowsy helm
#

mhm

wraith rapids
#

jdk includes jre

torn oyster
#

is that page the correct page for jdk

wraith rapids
#

it literally reads jdk in the link, i'd say probably yes

drowsy helm
#

it says jdk on th elink

torn oyster
#

o

#

ye

sage swift
#

jave!

#

jave levn

torn oyster
#

wait but would it be good to install a newer java if my servers are running

gaunt eagle
#

Did I not find folder creation in intelijidea, or am I blind 🤔

drowsy helm
#

depends what version you compile in

drowsy helm
gaunt eagle
#

ah

#

I think I can use package instead of folder xD

drowsy helm
#

whats the folder for exactly

gaunt eagle
#

minigames in lobby

#

kit etc..

drowsy helm
#

huh

#

like configurations

#

or classes

gaunt eagle
#

yeap, just so there's no chaos.

#

doesnt matter xD

drowsy helm
#

yeah thats what a package is for lol

wraith rapids
#

a package is just a folder for class files

#

and might have some metadata associated with it

#

just like you probably wouldn't want to keep all of your computer's files on your desktop, you also don't want to keep all of your classes in the same package

torn oyster
#

is this a good idea

#

or should i not do that

drowsy helm
#

yeah its fine

torn oyster
#

cuz paper still thinks im using java 8

drowsy helm
#

you can set primary version

torn oyster
#

i did that

#

now java isnt even installed anymore what did i do

#

restart?

#

@drowsy helm

round finch
#

i forgot how do i get all enchant there exist?

crisp iron
#

Enchantment.values();

round finch
#

search it up

#

thank you

crisp iron
#

No prob

digital plinth
#

so i have a system that sets a boolean in the main class to true

#

but after i set it to true

#

when i check the boolean from a different class

#

it didn't update the value it seems

dusty herald
#

show code

digital plinth
#

i CAN check boolean's value using == right?

digital plinth
digital plinth
dusty herald
#

you should be able to

#

you are able to

#

wait why check boolean values with == when you can just put the boolean

#

if(variable || !variable)

digital plinth
#

oh right

#

XD

dusty herald
#

why you no dependency inject !!!

digital plinth
#

umm the getInstance is the di?

torn oyster
#

how the hell do install jre 11

#

it only gets jdk 11

#

and i am confused because i cant run jar files anymore

digital plinth
digital plinth
torn oyster
#

bruh

#

i have

digital plinth
#

jdk = jre

torn oyster
#

nonono

#

but i cant run jar files

digital plinth
#

jdk includes jre

#

hmm

#

try reinstalling it

#

and run jarfix

torn oyster
#

i have

digital plinth
#

maybe ur jar file is corrupt

torn oyster
#

link?

#

is this it

digital plinth
#

ye

torn oyster
#

wtf

digital plinth
torn oyster
#

this looks sus

#

that looks sus lol

#

im gonna scan it

dusty herald
#

AdoptOpenJDK provides prebuilt OpenJDK binaries from a fully open source set of build scripts and infrastructure. Supported platforms include Linux, macOS, Windows, ARM, Solaris, and AIX.

torn oyster
#

whats that

#

do i choose OpenJDK 11

dusty herald
#

yes

torn oyster
#

hotspot or openj9

dusty herald
#

Hotspot ig I haven't downloaded from them in a whil

sharp bough
#
        for(World w : Bukkit.getWorlds()){
            //loops through all worlds
            for(Entity e : w.getEntities()){
                //loops trough all entities on each world
                if(e instanceof EnderDragon){
                    
                }
            }
        }

there has to be a better way of doing this right?

#

tag me please

torn oyster
#

why are my plugins not working with 11

#

AAAA

digital plinth
#

am i not supposed to get the instance of the booleans from the main class liek that?

digital plinth
#

weird

#

it shouldn't write two lines of pos2 saved as ...

sullen marlin
#

event.getHand

digital plinth
#

k

#

still whats with the double log

digital plinth
young knoll
#

Because the event is called twice

digital plinth
#

oh

young knoll
#

Once for each hand

digital plinth
#

why is that?

digital plinth
young knoll
#

Hence why MD told you to check e.getHand

digital plinth
#

but then the left click didn't have double log

digital plinth
young knoll
#

You can’t left click with your offhand

#

Only right click

digital plinth
digital plinth
# digital plinth

also i have a problem where changes made to a boolean on a different class don't carry over when i reference the same boolean from another class

young knoll
#

Sounds very vague

#

Are you accessing the Boolean from the same instance each time

digital plinth
#

ye same instance of the main class

#

the boolean is in the main class

young knoll
#

Gonna need more than that then

digital plinth
#

main class

quaint mantle
#

ew

digital plinth
#

:/

#

what?

quaint mantle
#

just make a single instance

digital plinth
#

of what?

#

main class?

young knoll
#

Yo command class

quaint mantle
#
Commands commands = new Commands();
// ***
digital plinth
#

okie

#

checks

quaint mantle
#

also idk if you want to but i usually do this when handling multiple commands under the same executor

private void registerCommands(CommandExecutor executor, String... commands) {
    Arrays.stream(commands).forEach(i -> i.setExecutor(executor));
}
#

completely optional tho

digital plinth
#

weirddd, no log saying pos2 now has a value popped up

quaint mantle
#

actually might wanna use a normal for loop

#

i just think the stream looks cleaner

#

Is there a way to give an invisible armorstand with a custom skull full invisibility? (without having to change the helmet slot to air)

digital plinth
young knoll
digital plinth
#

the pos1empty=false is not getting through

paper viper
#

Just wondering, why is my code for playing audio from a resourcepack having a bit weird behavior:

   for (final Player p : players) {
      p.playSound(p.getLocation(), "audio", 1.0F, 1.0F);
    }

Suppose the resourcepack has already been sent to players and the resourcepack is valid.

Running this first time, the sound plays. After that sound plays. I run it again. The thing is that for some odd reason, it won't play the audio for clients on the second play. However, if I just execute the loop again the audio will play properly.

#

Does anyone know how to fix this?

#

I swear that is the only place I am playing sound

crisp iron
#

Any more code you can provide?