#help-archived

1 messages · Page 136 of 1

wanton delta
#

never thought of that

#

thanks

#

/s

rustic socket
#

because of how clients & bukkit work and all, it might call a block damage event on the fake block, letting you reset the state & cancel the event

wanton delta
#

meh ill just resend a packet if they break the block, kinda hacky but it works i guess

#

cancelling the block break packet when the dig type is STOP_DESTROY_BLOCK doesnt cancel it like i would expect

#

thats the issue im running into

#

if that makes more sense

dim cape
#

For about the past week, the spigot version api (https://api.spigotmc.org/legacy/update.php) has been giving me a 403 when I try to get it from my server using php. It works fine when using a browser. Is there some new cloudflare rule?

fleet crane
#

@dim cape make sure you have a user agent

dim cape
#

i dont think i do, thanks

#

i never have so not sure why it suddenly stopped working the other day

#

yep working now that i set a user agent, thanks again

frigid ember
#

yo the command /minecraft:kill @e[type=horse] returns unknown entity

#

on version 1.8.8

subtle blade
#

1.8 has been unsupported for 4 years

frigid ember
#

yeh, but for me personally, I need to use it.

subtle blade
#

That's fine but don't expect any support here

frigid ember
#

alright

pastel arrow
#

@frigid ember /kill @e[type=EntityHorse]

sturdy oar
#

Omg noo

#

Don't kill the horses

#

They're beautiful animals

frigid ember
#

ty

#

it works

#

horses are dead now

#

😠

sturdy oar
#

😥

frigid ember
#

😃

pastel arrow
#

No problem

frigid ember
#

🔪

#

🩸

sturdy oar
#

Ok am reporting to FBI

#

Horse abuse

frigid ember
#

Pigs are next, and finally dogs. 😈

half finch
#

Does anyone know how to make an nbt chest with the spigot api? I assume you can do it through the ItemMeta but I don't really see how you would do it

fleet crane
#

BlockStateMeta --> set it to a chest with the desired contents

half finch
#

I was meaning more for the chest item not block

fleet crane
#

yeah

#

getItemMeta -> cast to BlockStateMeta -> treat as chest block

half finch
#

ooh, I see

subtle blade
#

Well, treat the result of BlockStateMeta#getBlockState() as a Chest

half finch
#

epic, got it working 🙂 thanks

wanton delta
#

so uh

#

lookin at schematic format

#

unsure of how to translate the 8-bit thingy to a block

subtle blade
#

Can't be its internal ID because those are integers I believe, 32 bits

#

PES_Think There's no specification on that?

wanton delta
#

doesnt look like it 😭

#

oh yea its a byte

#

so like

steady cedar
#

yeah 8 bits tends to be a byte

subtle blade
#

Right... though blocks don't fit within the range of a byte. There are definitely more than 255 blocks

#

Especially because states are included in that and make it exponentially larger

lone fog
#

Probably the old file format

subtle blade
#

It's vanilla

#

Nevermind, third party

#

Yeah, could be

lone fog
#

I think that's the legacy one

#

IIRC worldedit moved to a format by the sponge people

subtle blade
#

Still has it implemented on master

steady cedar
#

I said it once and I'll say it again

#

WorldEdit's api docs are next to war on the worst things that exist

lone fog
#

I just switched to using Mojang's structure format

subtle blade
#

So that explains the "how can blocks fit within 255 numbers?" question

gleaming helm
#

slime world format >> all

subtle blade
#

and block data is stored in ANOTHER array

#

So 3 byte arrays of block data

#

Though that's still legacy data as far as I can tell

steady cedar
#

@gleaming helm Hehe. Right shift

#

😂😂😂😂😐

wanton delta
#

oh thanks choco i was trying to look for that just now

#

saw that somewhere else but github page was outdated

subtle blade
#

Ye. The wiki you linked links to different implementations

wanton delta
#

wtf is a nibble

gleaming helm
#

herherher

#

@wanton delta

wanton delta
#

all of this is very confusing

gleaming helm
#

What

steady cedar
#

how is that confusing lol

gleaming helm
#

The first sentence says it all

#

I'll spell it out for you

#

In computing, a nibble[1] (occasionally nybble or nyble to match the spelling of byte) is a four-bit aggregation,[1][2][3] or half an octet. It is also known as half-byte[4] or tetrade.

steady cedar
#

A nibble has 16 possible values

#

2^4

wanton delta
#

woah

#

you dont have to be so harsh lmfao

#

im just saying in general

#

this byte stuff is confusing

steady cedar
#

8 bits is a byte

#

1000 bytes is a kilobyte

#

1000 kilobytes is a megabyte

lone fog
#

Technically 1024

steady cedar
#

1000 megabytes is a gigabyte

#

depends

wanton delta
#

thanks....?

#

dont really need to know that

steady cedar
#

You're welcome.

gleaming helm
#

The trick is

#

You don't have to store whole bytes at a time

steady cedar
#

You said the byte stuff is confusing

gleaming helm
#

Imagine you just have a list of bits

#

Because that's what the computer actually sees

#

It's just a big long list of bits

#

Doesn't matter if you split them into groups of 8, 32, 64, 4, 2, or don't split them at all

wanton delta
#

i know what bytes are

steady cedar
#

What's the byte stuff

gleaming helm
#

What "byte stuff" is confusing you then?

rotund orbit
#

I'm trying to load a ZonedDateTime I turned into a string and save into a file, but it remains null on startup. How exactly do you parse a string into the ZonedDateTime object?

wanton delta
#

could use gson

gleaming helm
#

ObjectOutputStream is a thing everybody here seems to forget exists

#

Also more efficient serializers exist like FST or JBoss Marshalling

wanton delta
#

im just suggesting a simple readable solution idk

gleaming helm
#

idk why everybody sucks off gson

wanton delta
#

seems like what hes going for

steady cedar
#

...he's trying to serialize something

wanton delta
#

well maybe he is, didnt say that

steady cedar
#

"A zoneddatetime I turned into a string" sounds like serialization but

#

Hm

rotund orbit
#

I just did .toString() on it

wanton delta
#

yea sometimes thats not the best ;P

subtle blade
#

Don't toString() it. Format it

wanton delta
#

but you have the option of saving it as json via gson, or using a serializer to make it into a string, or parse it your own way

#

oh yea its a time

#

probably could do that lol

gleaming helm
#

Extract the data you need to initialize it from scratch, and save that as a string

rotund orbit
#

I was originally trying to do this with a Date, but when loading from files it resulted in weird values.

gleaming helm
#

When you want to initialize, parse your string and then re-create the object from scratch

rotund orbit
#

What do you mean format it?

subtle blade
#

ZonedDateTime can be formatted using DateTimeFormatter.ISO_ZONED_DATE_TIME

#

and reparsed from String

#

ZonedDateTime.parse(string, DateTimeFormatter.ISO_ZONED_DATE_TIME)

#

(actually that second argument is redundant. There's an overload that assumes that as the default)

wanton delta
#

....i should read JD more LOL

subtle blade
#

I know that because I just recently worked with that very same API for my locked blocks

rotund orbit
#

How would I use the DateTimeFormatter to format it into a string?

subtle blade
#

zonedDateTime.format(DateTimeFormatter.ISO_ZONED_DATE_TIME)

#

There's a format() method for all temporal objects

rotund orbit
#

I'll give this a shot, thank you very much for your help!

subtle blade
#

o/

wanton delta
#

meh worldedit has their own thing for translating the block id to an actual block

#

😭

#

Schematica has this line

#

but its a mod so

#

works slightly differently

#

idk if theres a similar implementation on nms/spigot

#

final Block block = Block.REGISTRY.getObjectById(blockID);

#

well theres this actually

#

net.minecraft.server.v1_15_R1.Block.REGISTRY_ID.fromId()

rotund orbit
#

my problem was that I was doing zonedDatedTime.format() and not setting it to the original object lol

#

my bad

#

just fixed it

buoyant path
#

Could anyone help me in dms? I want to take some time to recode one of my project with proper design patterns and structure, I understand how they work I just need help applying them to my concepts

patent monolith
#

I just wanted to make sure I'm not misinterpreting this... reflection in this regard seems much different than regular code

#

It kind of reminds me of Python, where you have self or cls as the first argument for a method in a class

warm vine
#

can you help me with a couple of plugin problems ?

patent monolith
#

@warm vine which plugins?

tame current
#

Does someone know plugin for block stacking

#

which supports 1.13+

#

I need it for my skyblock server

#

Yes

#

For people to gain levels on skyblock

bright onyx
#

looking for a plugin that adds more types of tnt :>

tame current
#

i asked first

unique kraken
#

can someone help me understand why instantiating an interface works here? im kinda new to java and i cant find an explanation anywhere :(

naive goblet
#

That’s parameters and you’re not initiating. You’re just telling any instance that has a supertype of that interface can be there when invoking the method.

unique kraken
#

thanks! someone else ended up dming and walking me through what it was doing, but i appreciate the explanation!

glad fox
#

Is there a plugin that adds bots that can interact with their environment? (example, pvp or mining blocks)

naive goblet
#

AI functionality or just in presence?

glad fox
#

in presence

#

well with capability for ai functionality

naive goblet
#

Uhmmm

#

Idk seems like everyone would know it if it existed one

glad fox
#

I thought that too

#

but in hypixel skyblock dungeons there are npcs that go after the player

#

I might not have seen enough

#

they might not actually attack

#

but still

naive goblet
#

Well hypixel is hypixel after all

glad fox
#

yeah but don't they use spigot

#

well does anyone know how the npc plugins work?

#

maybe the mechanics they use can also be used for attacking and stuff

#

they just don't use it

radiant pollen
#

There are lots of ways to do custom npcs

glad fox
#

Zaxarner is there any way for them to attack?

#

or take damage

radiant pollen
#

Do you mean an NPC as in a player entity?

glad fox
#

yeah

radiant pollen
#

I mean, you'd have to code it yourself but yes

glad fox
#

code the npc plugin?

#

or code using the plugin

radiant pollen
#

You'd probably have to code your own plugin. There are plugins out there that have custom NPCs that attack, but I haven't seen one that was as customizable as you're probably wanting.

glad fox
#

hmm

#

thank you for the help you've given me so far

#

do you know where I could go to start?

radiant pollen
#

If you want to just use a plugin, Citizens has the Sentry character trait that makes NPCs attack. It's pretty customizable.

glad fox
#

is citizens paid

bright onyx
#

nop

#

free

glad fox
#

cool

radiant pollen
#

There's a "premium" version

#

Where you basically just pay for support.

opal bay
#

you could get denzien if you really wanna go that far

#

which is very nice to do*

radiant pollen
#

AFAIK

opal bay
#

yeah it is

#

you can pay, but you don't have to

glad fox
#

I have background coding experience, but I haven't coded in java. I'll probably pick it up fast because I recognize a lot of the ideas. Which plugin could I use to code a pvp bot?

opal bay
#

sentry could work for that

#

but not entirely sure how, what languages do you have background in?

glad fox
#

lua

#

and barely python

opal bay
#

i could never get into lua, gl man

#

suggest learning Java first before making any plugins though

glad fox
#

yeah lol I'm gonna do that

#

I'm just getting the stuff ready for when I do know it for motivation and so I can start right away

opal bay
#

:)

naive goblet
#

I suggest learning java while making plugins, not in beforehand

#

It’s a really good combination

opal bay
#

it's not bad but fundamentals of the syntax are pretty good to know :)

naive goblet
#

That’s pretty easy, if he touched python and lua that won’t be hard to learn

opal bay
#

I know nothing about python but yeah you're probably right

glad fox
#

Thank you all for your help!

opal bay
#

np<3

raven hound
#

So I'm kinda confused, In the Spigot plugin tutorial it shows how to make a config.yml but I dont know where to write the code its showing

opal bay
#

what spigot tutorial?

raven hound
naive goblet
#

Code it’s showing?

opal bay
#

are you using an IDE?

raven hound
#

Yes, Eclipse

opal bay
#

first off I suggest using intellij over that

naive goblet
#

Idm

#

Both works

raven hound
#

Yeah I'm familliar with eclipse more

opal bay
#

I understand :)

raven hound
naive goblet
#

@raven hound well you could put it in any class but That’s in main class

#

in onEnable

raven hound
#

Oh thanks

#

One more though

opal bay
#

yeees?

raven hound
remote crown
#

How do you place text at the bottom of the screen? Like in super vanish

opal bay
raven hound
#

Lmao noone helps me :(.

naive goblet
#

hamoudy

#

Why are you creating your own event ?

#

No need if it’s not an API you’re creating

hidden marsh
#

can someone help

#

the command suggestion on my server not working for default players but when op they can
Example when u type /t it will show other suggestion command like /tpa /tp etc.
but now it shows unknown command at position 1

remote crown
raven hound
#

Ok, @naive goblet but when i put this in my main class (onenable) i got lots of errors

So I don't know where im supposed to write this

frigid ember
#

how to fix this

#

please

naive goblet
#

@raven hound send the errors

raven hound
#

Yeah one sec

#

@frigid ember youre trying to load a world or a chunk from a newer version

naive goblet
#

@remote crown you want to make your own action bar plugin?

frigid ember
#

@raven hound but i am using 1.15.2

raven hound
#

¯_(ツ)_/¯

naive goblet
#

you can’t really just copy paste the code

raven hound
#

?

naive goblet
#

Well when you’re raw copy pasting you will end up with syntax errors etc

raven hound
#

yeah ill modify a bit and get back to you

naive goblet
#

Well what did you want to do in the first place?

#

I can try assist then

raven hound
#

Im trying to make the config.yml

#

as in the tutorial

naive goblet
#

Hmm yes

raven hound
#

k ill do that

naive goblet
#

That’s a configurable message?

raven hound
#

maybe joinplayer event

#

Well is it a plugin you're making?

naive goblet
#

Hmm what plugins do you have ?

raven hound
#

oof

naive goblet
#

I mean it’s probably a plugin that commits something whenever a player joins the server

raven hound
#

are any of them made by you?

#

does it have join messages?

undone narwhal
#

Hi guys, need a simple answer. (I never played Factions). Does a faction claim represent a chunk ?

naive goblet
#

Probs

#

I mean you claim land chunkwise

undone narwhal
#

Okay then a Faction claim is a chunk region

#

If I want to monitor player enter and leave, just have to check when the player change chunk

naive goblet
#

Yeah well a bunch of chunks

undone narwhal
#

Okay right thanks

naive goblet
#

Yep Rolyn

undone narwhal
#

ty

naive goblet
#

@frigid ember wym

#

Or I mean explain more

raven hound
#

I'm getting one warning. Description Resource Path Location Type The method registerEvents(Listener, Plugin) in the type PluginManager is not applicable for the arguments (MythicEvent, MythicalModeration) MythicalModeration.java /MythicModeration/src/com/gmail/ line 14 Java Problem

naive goblet
#

Send that error

#

Not a stacktrace ?

raven hound
#

maybe check console for errors

#

I'm getting one warning. Description Resource Path Location Type The method registerEvents(Listener, Plugin) in the type PluginManager is not applicable for the arguments (MythicEvent, MythicalModeration) MythicalModeration.java /MythicModeration/src/com/gmail/ line 14 Java Problem
anyone have a clue?

undone narwhal
#

@frigid ember Do you have a plugin that make the player or the server execute a command on login ?

#

itshamoudy is it your plugin?

raven hound
#

yeah its happening in my IDE

#

(eclipse to be exact)

naive goblet
#

hamoudy send code

undone narwhal
#

^

raven hound
#

``
import org.bukkit.plugin.java.JavaPlugin;

public class MythicalModeration extends JavaPlugin {
// Fired when plugin is first enabled
@Override
public void onEnable() {
// Register our command "kit" (set an instance of your command class as executor)
this.getCommand("kit").setExecutor(new CommandKit());
}
{
getServer().getPluginManager().registerEvents(new MythicEvent(null), this);
}
// Fired when plugin is disabled
@Override
public void onDisable() {

}

}

``

#

this is where the error is

naive goblet
#

Have you imported the right imports ?

#

Or even imported at all?

raven hound
#

yes

#

yes i have

naive goblet
#

And wtf new MyhticEvent(null)

undone narwhal
#

Put you're getServer().getPluginManager().registerEvents(new MythicEvent(null), this); inside the onEnable method

naive goblet
#

what’s the null for?

undone narwhal
#

And yes, wtf is your MythicEvent constructor ?

raven hound
#

Well i was just following eclipses intstructions to fix some errors

naive goblet
#

Don’t lol

#

Simo not a single error just that?

#

Eclipse won’t fix anything for you sorry

raven hound
#

Put you're getServer().getPluginManager().registerEvents(new MythicEvent(null), this); inside the onEnable method
isnt it already in?

naive goblet
#

Okay send ur MythicEvent

#

You should probably put this instead of null

#

But not sure

undone narwhal
#

No it's not, you opened Brackets no where itshamoudy ^^

hidden marsh
#

can someone help
the command suggestion on my server not working for default players but when op they can
Example when u type /t it will show other suggestion command like /tpa /tp etc.
but now it shows unknown command at position 1

naive goblet
#

Are you working with the TabCompleter?

hidden marsh
#

Yap like that

raven hound
#

No it's not, you opened Brackets no where itshamoudy ^^
where exactly?

naive goblet
#

How’s the code looking Sensei?

hidden marsh
#

mine seems have problem before its working perfectly

naive goblet
#

Send

hidden marsh
#

No i dont have any code used

#

just an server error

naive goblet
#

Oh

hidden marsh
#

Yep i cant figured out why its happening

naive goblet
#

Innit a config option to disable completions?

#

You may have messed that up?

hidden marsh
#

i enable it on spigot.yml

naive goblet
#

What did you put?

hidden marsh
#

0

naive goblet
#

Put -1 and try again

#

Or maybe 1

hidden marsh
#

commands:
log: true
tab-complete: 0
send-namespaced: true
spam-exclusions:

naive goblet
#

Yeah set it to -1

#

Ps

hidden marsh
#

alright wait

#

should i restart or just /spigot reload ?

undone narwhal
#

@raven hound ```java
{
getServer().getPluginManager().registerEvents(new MythicEvent(null), this);
}

#

This is not inside the onEnable() {
}

bold anchor
#

It's in an init block

undone narwhal
#

^

#

And then you'll be able to change the null to this

raven hound
#

Ok thanks

hidden marsh
#

@naive goblet

#

now it not work on me also

raven hound
#

is this correct?

#
     // Fired when plugin is first enabled
    @Override
    public void onEnable() {
        // Register our command "kit" (set an instance of your command class as executor)
        this.getCommand("kit").setExecutor(new CommandKit());
    }
    
        getServer().getPluginManager().registerEvents(new MythicEvent(this), this);
    }
    // Fired when plugin is disabled
    @Override
    public void onDisable() {

    }}

 

rocky river
#

Anyone know how to check through spigotmc whether the latest version of the plugin is installed, and possibly add the possibility of an update under the command?

hidden marsh
#

default players always see unknown command at position 1

undone narwhal
#

@raven hound there is a closing bracket under this.getCommand.... which shouldn't be there

raven hound
#

@undone narwhal i get three warnings after removing

bold anchor
#

Then fix them

raven hound
#

this is why i was asking here XD

bold anchor
#

Just because it shows the other errors now doesn't mean that you magically generated them.

hidden marsh
#

anyone knows ?

#

why non op players dont have tabcompleter

raven hound
#

maybe a perm

hidden marsh
#

they just see default players always see unknown command at position 1 when typing commands

#

what should it be ?

bold anchor
#

Do you have luckperms?

hidden marsh
#

i use permissonex

bold anchor
#

Why?

hidden marsh
#

they just got the thing 2hours ago

#

but before we dont have the prob

slate ocean
#

@undone narwhal check dms

hidden marsh
#

is there a perm node needed ?

raven hound
#

depends

#

can you link me to the plugin

hidden marsh
#

i add crazyenchants

#

and this all happens

#

i tried to uninstall it

#

but nothing happens

raven hound
#

did you remove its folder

hidden marsh
#

Yeah I did

raven hound
#

seems intresting ¯_(ツ)_/¯

hidden marsh
#

confuse rn

raven hound
#

Just because it shows the other errors now doesn't mean that you magically generated them.
yeah but i need help fixing them, its my first time making a plugin

undone narwhal
#

@slate ocean Can you please stop spamming me ? Thanks.

frigid ember
#

What is the DamageCause when a player quit the world bottom bedrock ?

#

( ping me pls )

frigid ember
#

yes

#

thx

hidden marsh
#

really confuse now

bold anchor
#

.set(player.getUniqueId(), player.getLocation())

#

Something similar to that

#

I just assumed you wanted to save it to a yaml config

frigid ember
#

Placeholders?

#

Dunno sorry

bold anchor
#

Yes

#

Also, that layout looks more like toml than yml

steady cedar
#
- bob:
  world: name
  location: 
     x: 0
     y: 0
     z: 0
- john
   world: name
   location:
     x: 1
     y: 1
     z: 1
#

something like this

vagrant widget
#

tf

steady cedar
#

what are u tryna do

#

lol

undone narwhal
#

Open your src file, and search for a blue folder

steady cedar
#

yeah go to src/main/java

#

no, @vagrant widget

vagrant widget
#

ohhhhhhhhhh

steady cedar
#

you set keys to values

#

really that simple

#

loop through your "players"

#

set the world to the world's name

frigid ember
#

You can do like

Cords: Worldname, X, y, z

#

And yaw

steady cedar
#

no

#

nono

#

haha no

bold anchor
#

Location stores world

#

No need to store it yourself

steady cedar
#

Yeah

#

location is ConfigurationSerializable

#

yea

vagrant widget
#

wait i'm honestly confused.

steady cedar
#

you just gotta do

#

config#set("user's name", user's location)

vagrant widget
steady cedar
#

is targetID a string

#

.toString()

#

targetID.toString(), targetLoc

#

@vagrant widget dude

#

you're using maven

#

you put the source files

#

in src/main/java

#

and your test files

#

into src/main/test

#

so right click the blue "java"

undone narwhal
#

Your packages go into "java"

steady cedar
#

Location location = (Location) getConfig().get(player's uuid as a string)

#

player.getUniqueId().toString()

#

lol

high root
steady cedar
#

^ or that

#

neato

#

probably does the same thing under the hood

#

@frigid ember try learning java

#

you won't be so confused

#

Location location = getConfig().getLocation(player.getUniqueId().toString());

#

that's-

#

that's how you get it

#

lol

raven hound
#

And im confused because I keep getting the same error:

#
    // Fired when plugin is first enabled
   @Override
   public void onEnable() {
     
       this.getCommand("kit").setExecutor(new CommandKit());
   
   
       getServer().getPluginManager().registerEvents(new MythicEvent(this),;
   }
   // Fired when plugin is disabled
   @Override
   public void onDisable() {

   }}



high root
#

getServer().getPluginManager().registerEvents(new MythicEvent(this),;
that line is incomplete

steady cedar
#

lol

undone narwhal
#

wow

pastel condor
#

what enchantment can I add to an item just to give it a cool shiny effect?

steady cedar
#

why are you using a comma?

high root
#

getServer().getPluginManager().registerEvents(new MythicEvent(this),this); @raven hound

undone narwhal
#

Cause eclipse said this isn't cool

raven hound
#

yeah thats what i put

undone narwhal
#

@pastel condor Depending on you're version, you can even create a custom glow encahnt

steady cedar
#

@frigid ember poggers

#

yes

high root
#

@frigid ember check first if the location is null. If there is no entry in the config with the player uuid you will get a NPE

pastel condor
#

how would I do that? @undone narwhal

#

have something implement enchantment?

raven hound
#

getServer().getPluginManager().registerEvents(new MythicEvent(this),this); @raven hound
@high root did that same error

steady cedar
#

@raven hound listen to me

raven hound
#

yes

steady cedar
#

learn java, and you won't have such a tough time

#

i know it hurts when i say it, but dog

#

please

#

if you want to spare others the pain of helping somebody who's never touched java

#

learn it

raven hound
#

ouch

pastel condor
#

thanks

high root
#

@high root did that same error
@raven hound How does the constructor of the MythicEvent class look?

raven hound
#
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

public class MythicEvent extends Event {

    private final String playerName;

    public MythicEvent(String playerName) {
        this.playerName = playerName;
    }

    private static final HandlerList HANDLERS = new HandlerList();

    public HandlerList getHandlers() {
        return HANDLERS;
    }

    public static HandlerList getHandlerList() {
        return HANDLERS;
    }

    public String getPlayerName() {
        return this.playerName;
    }}


steady cedar
#

i'm gonna cry

#

I'm actually going to cry

undone narwhal
#

LMAO

high root
#

Oh

steady cedar
#

I'm gonna SOB

high root
#

I see the problem

undone narwhal
#

us too ^

steady cedar
#

you implement listener.

#

mate.

#

what are you trying to achieve.

high root
#

I think he wats to create a custom event

raven hound
#

^^^

steady cedar
#

then why did you

#

register the listener

#

you know what

#

I can't even blame him

#

that's retarded language

#

registerEvents lol

high root
#

Ok, @raven hound

steady cedar
#

Ignore the name of the method, that actually means "registerListeners"

undone narwhal
#

Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "command goes here without /");

steady cedar
#

that convention always confused the hell out of me

#

no / in dispatchCommand

#

yes / in PlayerCommandPreprocessEvent

#

tf is that

high root
#

@raven hound
getServer().getPluginManager().registerEvents(Listener, Plugin) is used to REGISTER listeners. To create a custom event you don't do that

turbid jewel
#

Quick question, how do I reset a world? InstantReset plugin somehow doesn't work for me

raven hound
#

Nemo, I was trying to make a message on join

steady cedar
#

i'm crying

#

from sadness

#

use a for loop?

high root
#

Nemo, I was trying to make a message on join
@raven hound Then create a class called, for example, OnPlayerJoinListener. Make that class implement Listener. Then create a method called onJoin with parameters PlayerJoinEvent. Then on your main class register it using getServer().getPluginManager().registerEvents(Listener, Plugin)

steady cedar
#

use a for loop

#

i just told you

raven hound
#

@raven hound Then create a class called, for example, OnPlayerJoinListener. Make that class implement Listener. Then create a method called onJoin with parameters PlayerJoinEvent. Then on your main class register it using getServer().getPluginManager().registerEvents(Listener, Plugin)
@high root thanks

steady cedar
#

🥄

#

🥣

#

yum

raven hound
#

spoonfeed XD

high root
#

how do I get all the args after args[2]
@frigid ember

for(int i = 2; i < args.length; i++) {
    // CODE HERE
}
opal bay
#

hahahahahaha it's the joek

steady cedar
#

ur misleading him bro

opal bay
#

bRo

steady cedar
#

statements end with ; in for loops

raven hound
#

hOw

steady cedar
#

that will only increment once

#

pretty sure

opal bay
#

why did the array start at two

#

WhERe IS teh BrAccET

raven hound
#

lma

#

lmao

steady cedar
#

@opal bay it started because of a reason

#

but

#

like a string reason

#

but even then it's wrong

opal bay
#

oh okay

steady cedar
#

that only increments once

#

lol

#

and if he wants to do it like that

opal bay
#

god arrays are annoying

steady cedar
#

he also needs ;;

opal bay
#

hey let's start the array at zero but count it from length at one

high root
#

god arrays are annoying
@opal bay Ther are usefull if you understand them

steady cedar
#

no shit lol

#

here's why

#
stringbuilder 
for (int i = 2; i < args.length; i++) {
append to stringbuilder
}
#

yes

#

of type StringBuilder

#

and when I say append to stringbuilder

#

you want to append args[i]

opal bay
#

java is an OOF language

#

oop

#

;)

steady cedar
#

you forgot

#

the FOR

#

in the FOR loop

#

also not separated by a comma

high root
#

xdxdxdxdxdxd

steady cedar
#

separated by a semicolon

opal bay
#

un actyakky cibfu

#

fjsdhb

high root
#

also not separated by a comma
@steady cedar True I miss that one

steady cedar
#

@frigid ember i'm not gonna spoon feed you any longer. learn java

opal bay
#

spork feed

steady cedar
#

He said fork feed

#

i'm DONE LOL

#

that was funny as fuck tho

#

ngl

high root
#

omg

opal bay
#

why would i be null

high root
#

i'm starting to feel @steady cedar

opal bay
#

Jochyoua has left the server.

high root
#

If no ban reason is specified the args length won't be that long

opal bay
#

and i is an int that is already defined so either way

high root
#

yes

#

but

steady cedar
#

pain

high root
#

Im going to wite i need time

steady cedar
#

@frigid ember

#

Just look up for loops

#

on google

#

and it'll click INSTANTLY

#

trust me

#

Pain

#

i swear to god if you go to another discord asking the same question

opal bay
#

don't give up friend, we're just

#

pain

steady cedar
#

I'm gonna

#

Hurt something

opal bay
#

hurt me

high root
#

@frigid ember
if a player uses the command
/yourplugincomand firstArgument secondArgument thirdArgument
The in the args var the indexes are
args[0] = firstArgument
args[1] = secondArgument
args[2] = thirdArgument
To join this you can use a stringbuilder and the append method
the with sb.toString you get your new string

steady cedar
#

you're confusing me too nemo

#

listen simon

high root
#

how?

steady cedar
#

the arguments STARTING at the second index ENDING at the MAXIMUM index(so the amount of arguments)

#

THOSE are the ones you wanna put together

#

So you want to add to a string repeteadly

#

repeatedly idk

#

how to spell

#

Now what do we do when we want to do something repeatedly

#

We use a for loop(or a while loop)

opal bay
#

you scared him idriz

#

mean panda

steady cedar
#

Shut up pokemon

#

yeah

opal bay
#

wow

steady cedar
#

so do that

#

but in java

#

damn

opal bay
#

"do that but in java"

steady cedar
#

yes

#

look that up but in java

#

😐

high root
#

in python it's for i in range (1, 10)
@frigid ember This is not python. It is not that diferent

steady cedar
#

"for in range in java"

opal bay
steady cedar
#

also the reason i don't give you the full answer

#

is so you work it out

high root
steady cedar
#

and know how to do it next time

high root
#

|| means or, && means and

steady cedar
#

That's AN INFINITE LOOP

opal bay
#

i know

high root
#

NoDONT DO TAHT

vernal lance
#

¯_(ツ)_/¯

high root
#

while (5 > 3) {
@frigid ember while repeats the loop as long as the condition between the parentesis is true. Since 5>3 is ALWAYS true, that will enter a loop and never get out

vernal lance
#

Honestly learning how to code is basically learning how to use google

steady cedar
#

Yes!

#

When it hits a limit, rather

#

And that limit is the arguments length

high root
#

so what I want to do is make it keep checking args[2], args[3], args[4] and so on and so forth, and once it comes upon an empty one it stops
@frigid ember Whe nyou get an indexoutofboundsexeption

steady cedar
#

No just use a for loop

vernal lance
steady cedar
#

don't overcomplicate this

vernal lance
#

I haven't used while in quite a while

steady cedar
#

lookup for integer loops in java

#

look up "for integer loops in java"

#

and you'll understand

vernal lance
#

the link I sent has literally code specifically for that lol

#

if someone just gives you code

high root
#

No need to add the integer to de search, beacuse for loops are used almost always with integers

vernal lance
#

you wouldn't understand it for the future

#

true

high root
#

better idea

steady cedar
#

depends

high root
#

@frigid ember usa a foreach loop

steady cedar
#

sometimes it shows enhanced for loops so

#

no

high root
#

no

steady cedar
#

that would loop all the args

#

lol

high root
#

true

steady cedar
#

he wants to start from 2

high root
#

he wants to start at 2

steady cedar
#

@frigid ember args.length

#

that's the limit

#

you stop when the index is the length of the arguments

odd knoll
#

Remember length returns size and indexes start at 0 as well 😉

steady cedar
#

(well subtracted by one)

#

why comma

#

no

high root
#

for (i = 2, i < ??????, i++) {
@frigid ember almost
for(int i = 2; i < args.length; i++)

steady cedar
#

not comma

#

;

#

yes

#

Now

high root
#

is i defined already?

steady cedar
#

you want to declare a stringbuilder outside of that loop

#

yes int i = 2

#

Now outside of the for loop(right above that statement) make a StringBuilder

#

and inside of that for loop(under that statement) do stringbuilder.append(args[i]).append(" ");

high root
#

You probably also want to append " "

steady cedar
#

what that does

#

is it adds to the string builder

#

the string at index i

#

and adds a space

high root
#

then use String str = stringbuilder.toString() to build the string and store it in str

steady cedar
#

Mate..

#

i give up just write the code for him lol

#

i'm heading out pce

high root
#

also hold on
@frigid ember wat

#

did you forget the { ?

#

Show it please

#

Omg

#

of

#

look

#
if(confition1) {
  if(condition2) {
    some variables
    for() {
      code in for loop
    }
  } else {
   other stuff
  }
}

You are trying to acces the " some variables" from "other stuff" but they are not in the same {} block

#
if(confition1) {
  if(condition2) {
    some variables
    for() {
      code in for loop
    }
  } else {
   other stuff
  }
}

You are trying to acces the " some variables" from "other stuff" but they are not in the same {} block
@frigid ember you have this problem

#

are you in eclipse?

#

press ctrl+shift+f to autoformat your code

#

str will NEVER be null

#

the only thing that it can be is empty

#

so when you do "ban" + player + " " + str it will get converted to "ban player "

#

empty is not the same as null

#

Also playerBanned is a a Player not a String so you want to use playerBanned.getName()

#

if (str.isEmpty() == false) {
@frigid ember str.isEmpty() returns true or false so doing
str.isEmpty() == false is the same as doing
true == false or false == true

#

and that comparison doesn't make much sense

#

look, you check if str != null, this ALWAYS will be true because in this case str can not be null, the only thing that can be is empty

#

and it doesn't really mater if it is empty

#

NONO

#

That will ALWAYS be false

#

just omit the check

#

if str is empty

#

then when you add it to form the command nothing will be added

bold anchor
#

In this case it will never be empty

#

“ “

high root
#

Also @frigid ember , you have your dispatch command inside the for loop. This means that every iteration the command will be launched

#

Because you have to move str outside the loop

#

If not, you create a new str every iteration

bold anchor
#

Simo, it will always atlwast be “ “

#

Cause he is appending that to rhe stringbuilder

high root
#

Simo, it will always atlwast be “ “
@bold anchor No

bold anchor
#

Are you blind? I can literally see it

high root
#

@bold anchor if i strarts being = or > than args.length the for loop won't run

#

Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "ban " + playerBanned.getName() + " " + str);
@frigid ember good

#

explain

bold anchor
#

PlayerPrecommandProcessEvent thingy

frigid ember
#
    private final EnumSet<Material> types = EnumSet.of(Material.LOG, Material.LOG_2);

        if (woodDestroyed.get(player.getUniqueId()) >= 2) {
            if (chance >= 10) {
                event.getPlayer().getInventory().addItem(new ItemStack(Material.LOG, 2));
            } else if (chance >= 25) {
                event.getPlayer().getInventory().addItem(new ItemStack(Material.LOG, 1));
            } else if (chance >= 65) {
                event.getPlayer().getInventory().addItem(new ItemStack(Material.LOG, 0));
            }
    }```
Currently have this but it has to be ALL logs so I probaly cant use an enumset cuz its 1.8.8 and it also has to catch the block and only give the material if it is a LOG and it also shouldnt add in the inv actually but where the block is destroyed
#

so maybe this instead of material but than it counts for each block event.getBlock().getType()

high root
#

@frigid ember can you explain more what you want to do with the helpop?

#

use permissions and a permission manager like luckperms

#

wat

#

oh

#

ok

high root
#

@frigid ember
Have a list where you store the players that you did the /check command on and listen to PlayerCommandPreprocessEvent. If the player that runned the command is in the list cancell the event

#

@frigid ember what d oyou want to do?

#

so in @EventHandler?
@frigid ember In a class that implements listener, in a method with the @EventHandler

frigid ember
#

basically get some fortune when you mine logs after achieving a certain amount of logs before you get it

high root
#

is there a simpler way to disable commands?
@frigid ember Yes
Have a list where you store the players that you did the /check command on and listen to PlayerCommandPreprocessEvent. If the player that runned the command is in the list cancell the event

#

basically get some fortune when you mine logs after achieving a certain amount of logs before you get it
@frigid ember Listen to block break event, check if it is a log, do something

#

u sure?

frigid ember
#
    private final EnumSet<Material> types = EnumSet.of(Material.LOG, Material.LOG_2);

        if (woodDestroyed.get(player.getUniqueId()) >= 2) {
            if (chance >= 10) {
                event.getPlayer().getInventory().addItem(new ItemStack(Material.LOG, 2));
            } else if (chance >= 25) {
                event.getPlayer().getInventory().addItem(new ItemStack(Material.LOG, 1));
            } else if (chance >= 65) {
                event.getPlayer().getInventory().addItem(new ItemStack(Material.LOG, 0));
            }
    }```
Currently have this but it has to be ALL logs so I probaly cant use an enumset cuz its 1.8.8 and it also has to catch the block and only give the material if it is a LOG and it also shouldnt add in the inv actually but where the block is destroyed
#

I have this rn

#

but the enumset doesnt hold bytes

#

event.getBlock().getType()

#

and this instead of material.kig

high root
#

event.getBlock().getType().toString().contains("LOG") @frigid ember or something like that

pastel condor
#

Nooooo

#

event.getBlock().getType().equals(Material.mymat)

frigid ember
#

but I have multiple materials

high root
#

event.getBlock().getType().equals(Material.mymat)
@pastel condor Don't use equals with Enums, use ==

frigid ember
#

it has to give fortune on oak if it is oak

#

fortune on birch if the player destroys birch

pastel condor
#

😑

frigid ember
#

but not if it mines grass

#

/grass_block

high root
#
@EventHandler
    public void PlayerCommandPreprocessEvent(PreprocessEvent e) {

@frigid ember oh my god

@EventHandler
public void onPlayerSendCommand(PlayerCommandPreprocessEvente e) {
#

fortune on birch if the player destroys birch
@frigid ember getblock().getdtata or something. I don't know I havend used 1.8.8 in ages. get the block, check if it is a log, check the type of log

rustic socket
#

@frigid ember Why are you making this so hard for yourself? ```java
event.getPlayer().getInventory().addItem(new ItemStack(event.getBlock().getType(), amount, event.getBlock().getData()));

high root
#

^^

frigid ember
#

that'll only work for oaklogs?

high root
#

No

#

because you create an item stack with the block data

#

but idk

#

1.8.8 is really old

shut girder
#

Hey, I'm having a issue with bungeecord, can someone that knows a lot about bungeecord message me.

high root
#

you shudn't use it

shut girder
#

@high root I'm on 1.7.10 lol

high root
#

wat

#

1.7

shut girder
#

xd

high root
#

u e crazi

shut girder
#

There's a lot of people still using 1.7.10

frigid ember
#

probaly for hcf or something

shut girder
#

^^

frigid ember
#

yes

shut girder
#

I have a hcf server ;p

frigid ember
#

nice

high root
#

how do I find if the player is in the config list
@frigid ember how are you saving the player in the config?

#

when the staff member does /check %player% it saves him
@frigid ember like, players.playeruuid or something like that

rustic socket
#

store their UUID and then get it through the same method

frigid ember
#

It kinda works @rustic socket

#

if only the x log is included

#

now it does it for everything

#

every log

rustic socket
#

isn't that what you wanted, @frigid ember?

frigid ember
#

no it also does it for grass

#

give multiple

#

I need it only to do that for each type of logs

#

so oak,birch,darkoak etc

rustic socket
#

it's your job to filter which blocks to apply it to

frigid ember
#

yes but what should I use to do it in 1.8.8

rustic socket
#

the code for that has even already been given in this conversation

high root
#

targetName = uuid as a string
@frigid ember Then use ConfigurationSection#contains(String). You would hace to do

if(youronfigFile.contains(player.getUniqueID().toString)) {
  do something

}
frigid ember
#

event.getBlock().getType() == (Material.mymat)

#

this?

high root
#

^^ yes

rustic socket
#

Sure, try that

frigid ember
#

that wont work right? for all the logs

#

so just get rid of the enumset

rustic socket
#

This is where the boolean OR operator comes in

high root
#

maybe

frigid ember
#

But than I have to include multiple if statements

#

to do the next step

#

if statements x amount of logs

rustic socket
#

PlayerCommandPreprocessEvent?

high root
#

PlayerCommandPreprocessEvent will get launched every time a player uses a comand

rustic socket
#

or do you mean whether the command you want them to execute is successful?

high root
#

event.setCancelled(true)

undone narwhal
#

Check if the command string starts with /helpop

#

if no then cancel

#

Yes

high root
#

gtg bye

#

no

undone narwhal
#

yes

#

^^

high root
#

helpop is usually used with more arguments

rustic socket
#

if (!e.getMessage().startsWith("/helpop"))

undone narwhal
#

Of yeah

high root
#

so getMessage will get you something like:
/helpop why u teleport me
for example

rustic socket
#

No clue, try it and see

undone narwhal
#

I'll probably do more like !e.getMessage().toLowercase().startsWith("/helpop")

#

I think you should put the / not sure but Idriz told it previously

steady cedar
#

you only put check

#

in the plugin.yml

high root
#

Simon

#

That is the spigot development

#

For questions avout development of plugins

#

Like what you were doing a moment ago

hidden marsh
#

Can someone help

#

commands:
log: true
tab-complete: 1
send-namespaced: true
spam-exclusions:

  • /skill
    silent-commandblock-console: false
    replace-commands:
  • setblock
  • summon
  • testforblock
  • tellraw
#

non op players dont have command suggestion

sturdy oar
#

do they have permissions for the command

#

and most importantly... does the plugin have command suggestion?

#

not all do 🤷‍♂️

hidden marsh
#

like /tp

#

/tpa

#

before it shows to them

sturdy oar
#

so EssentialsX?

hidden marsh
#

yap

sturdy oar
#

are you using a permission plugin like LuckPerms?

hidden marsh
#

Permissionex

sturdy oar
#

.-.

bold anchor
#

Why are you not using luckperms?

hidden marsh
#

should i ?

sturdy oar
#

are you on 1.15.2?

hidden marsh
#

yap

bold anchor
#

Luckperms works from 1.7 -> latest

sturdy oar
#

yeah it works everywhere basically

hidden marsh
#

but before i dont have this error

#

after i add crazyenchant this happen

#

what should i do ?

bold anchor
#

Well, permissionex also has lots of exploits.

#

And the plugin is probably the cause then, this crazyenchant

sturdy oar
#

wasn't that plugin bad

#

someone told me it was laggy in their server

hidden marsh
#

alright

#

imma try using luckperms

#

and delete crazyenchants

naive goblet
#

For the record pex is outdated and doesn’t have any up-to-date safe version afaik

sturdy oar
#

I think PEX2 is probably still not going to compete with LuckPerms

naive goblet
#

Depends

bold anchor
#

Luckperms is great atm, but people still use the old outdated pex

#

who knows

naive goblet
#

I mean it’s pretty unnecessary to invent the wheel again so probably not

bold anchor
#

Even though luckperms is great some people just don't feel like using it.

sturdy oar
#

Luckperms is great atm, but people still use the old outdated pex
@bold anchor I know insanely big server (even running on bungee) still using it

hidden marsh
#

yah im kinda used to pex

sturdy oar
#

and they insulted me because i told them to change it lol

naive goblet
#

Most people use pex because it’s pex not because of what it actually is

hidden marsh
#

But imma try to use luckperms and see what happen

#

should i ? owo

sturdy oar
#

owo yes

naive goblet
#

I mean essentially pex works fine but use LuckPerms if you can and avoid pex

sturdy oar
#

you can also import permissions from PEX -> LuckPerms

#

so you don't need to re-write them by hand

hidden marsh
#

ohhh

#

how

sturdy oar
#

one sec

bold anchor
#

It's called migration

sturdy oar
#

also their website\documentation much cooler

bold anchor
#

They also have an active discord

sturdy oar
#

yeah it's bigger than this lol

lyric stream
#

Hey, how can I enable my plugin before all of the others?

sturdy oar
#

only think is STARTUP flag

#

but still it may load after other ones

bold anchor
#

You can load it on STARTUP, but other plugins would have to depend on your plugin for it to load before before others.

lyric stream
#

So

#

I have written a core api

#

but my lobbysystem enabled before the api does

sturdy oar
#

you need others to depend on it

lyric stream
#

so i always get a null pointer exception

bold anchor
#

Then make the lobby system depend on the api as i said.

lyric stream
#

okay like

#

this?

bold anchor
#

Probably

lyric stream
#

Okay, I'll try

#

Nope

#

Still a nullpointer exception

#

oh no

#

it loads before

#

but i still get a null pointer exception

#

i don't understand

sturdy oar
#

then ur code has something wrong in it

lyric stream
#

like

#

its working within the api

#

but when i try to access it via the lobbysystem

#

it throws a nullpointerexception

#

HAHA OMG

#

sorry

#

im so dumb

undone narwhal
#

What is the line with the NPE ?

lyric stream
#

Sorry mb

#

i tried to use a method

#

which is called one line later for initialization

#

ooof

#

Thanks for ur help! ❤️

sturdy oar
#

🦐

hidden marsh
#

im confuse where is command for changing players group

#

using luckperms

sturdy oar
#

if i remember correctly

#

lp user <name> parent set <group>

#

not sure tho i haven't administrated servers in some time

naive goblet
#

I’d use add instead of set

hidden marsh
#

its kinda hard to use luckperms Xd

#

how do i use prefix of luckperms

#

since im using essentials for prefix

bold anchor
#

lp user/group <name> meta addprefix <weight> <prefix>

hidden marsh
#

the prefix not showing hmmm

#

what placeholder should i use on essentials

#

{GROUP} ?

bold anchor
#

Just shit out essentialschat and use the luckperms chat for better compr

#

Compat*

hidden marsh
#

OHhhh

#

good idea

#

wait

rocky river
orchid silo
#

is there a list of commands this plugin adds anywhere?

rocky river
#

which plugin

orchid silo
#

spigot/bukkit 1.15.2

sturdy oar
#

/help

#

also spigot isn't a plugin?

rocky river
hidden marsh
#

omy

#

how to set default rank for this ?

#

luckperms

#

rip

#

still got the error

#

non op still cant see suggestion cmd

rocky river
#

will I get an answer here or stupid spam?

hidden marsh
#

T.T

#

how to inherit

raven hound
#

i made the three gm commands (a, c, s) using this code

#
        if (p.getGameMode().equals(GameMode.CREATIVE)) {
        if (p.getGameMode().equals(GameMode.ADVENTURE)) {
        if (p.getGameMode().equals(GameMode.SPECTATOR)) {
    
        p.setGameMode(GameMode.SURVIVAL);
        Bukkit.broadcastMessage("Your gamemode has been updated to survival!");
        
        return true;

        
        } else if (p.getGameMode().equals(GameMode.SURVIVAL)) {
            Bukkit.broadcastMessage("Your gamemode is already surviva;!");
            return true;
        }
        }
        return true;}
        return true;}}```
#

but when i used this code my commands stopped working

#

it just does nothing

hidden marsh
#

itshady

#

have knowledge about luckperms ?

lyric stream
#

getCommand("build").setExecutor(new BuildCommand());

#

Idk why, but i am getting a error in this line

#

NPE

bold anchor
#

Did you register build in your plugin.yml?

lyric stream
#

uhm

hidden marsh
#

JanTuck

lyric stream
#

oof

#

ty

hidden marsh
#

I did do migrate the pex to luckperms

#

then now they dont have perms

#

how do i fix it :<

bold anchor
#

Look on the luckperms wiki or ask on their discord for more help

raven hound
#

can someone help me with my error above?

soft tusk
#

YOu can help me with log spam?
My VPS server is spamming log hrs.err.pid.<Number>.log

undone narwhal
#

@raven hound Have you put the build command in the plugin.yml?

raven hound
#

?

        if (p.getGameMode().equals(GameMode.CREATIVE)) {
        if (p.getGameMode().equals(GameMode.ADVENTURE)) {
        if (p.getGameMode().equals(GameMode.SPECTATOR)) {
    
        p.setGameMode(GameMode.SURVIVAL);
        Bukkit.broadcastMessage("Your gamemode has been updated to survival!");
        
        return true;

        
        } else if (p.getGameMode().equals(GameMode.SURVIVAL)) {
            Bukkit.broadcastMessage("Your gamemode is already surviva;!");
            return true;
        }
        }
        return true;}
        return true;}}```

this is my error

#

nothing happens when i do one of these

#

and my commands are registered and i put them in the plugin.yml

high root
#

You are doing

if(player.getGamemode == CREATIVE) {
if(player.getGamemode == SPECTATOR) {
if(player.getGamemode == ADVENTURE) {

}
}
}

but how is going the game mode of the player to be all those at the time? I think you have to use ||

raven hound
#

how do i make it if the player has a different gamemode then ex. survival it turns it to survival

#

oh k ill do with ||

#

wait but theres no == in my code

sturdy oar
#

🤨

quasi sundial
#

Just wondering, does EntityInteractEvent trigger when stepping on a pressure plate?

#

Or if not, an event that does

undone narwhal
#

It does and the action enum is PHYSICAL

quasi sundial
#

ok thanks!

simple spruce
#

@raven hound I'd suggest learning Java first before doing anything

#

Not even Java actually just programming fundamentals

raven hound
#

Check if their source code is available

sturdy oar
#

ehm you know