#help-archived

1 messages · Page 221 of 1

quick arch
#

I got item stack from String correct :pogchamp:(somewhat)

native shore
#

nice thx now I dont have to write it on my own 😂

livid spruce
faint lance
#

thisis my xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.github.ANN0Y1NGHACKER</groupId>
    <artifactId>Plugin</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>

    <name>Plugin</name>

    <description>Plugins with spigot</description>
    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <url>ANN0Y1NGHACKER.github.io</url>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
               ```
#

            <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.16.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>
quick arch
#

?paste

worldly heathBOT
grim halo
#

oh god...

frigid ember
#

essentially I need a way for bungee cord to function while the server.properties is set to online mode

livid spruce
balmy sentinel
#
<dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.16.1-R0.1-SNAPSHOT</version>
</dependency>
native shore
#

i never really worked with bungeecord but usually it should work in online mode too

balmy sentinel
#

@faint lance

native shore
#

you get any errors?

balmy sentinel
#

add that

mellow wave
#

@frigid ember What you need to do is set the server to offline mode and the bungeecord to online mode then make sure that all players connect via the bungeecord. This can be ensured with a plugin

faint lance
#

spigot not found

formal nimbus
#

@formal nimbus Then look at Inventory Frameworks source
@mellow wave I've found it, but not the source, only the JAR.

mellow wave
#

I'll dm it to you

formal nimbus
#

how hard is it to decompile?

#

oh thx

quick arch
#

Just use IF

native shore
#

decompile in java is probably the easiest thing on earth

frigid ember
#

@mellow wave Is there any way to have the server be in online mode? when I set the server to offine mode the players lose their data.

balmy sentinel
#
<repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>

change your spigot-repo

mellow wave
#

Set bungeecord to true in the spigot.yml

balmy sentinel
#

if that doesn't fix it then idk @faint lance thats what mine looks like and NMS works fine for me.

faint lance
#

It didnt work but thanks anyway

grim halo
#

You need to run BuildTools so the files get installed in your maven repo

frigid ember
#

@mellow wave Set bungeecord to true in the Hub server or the server with the user data?

mellow wave
#

All servers

frigid ember
#

Including the server of just bungeecord?

mellow wave
#

Every server that is connected to the bungeecord

#

The bungeecord doesn't have a spigot.yml

frigid ember
#

Yeah my bad

#

So doing this allows the server to be in online mode>

#

?

mellow wave
#

The server will still be in offline mode but have online mode UUIDs. Atleast if I remember correctly. But make sure that no one can connect without the bungeecord or you will have problems

pseudo crown
#

does anybody have any idea how you change the light level of a block (using nms presumably because there's no method for setting light level, only getting)?

mellow wave
#

I believe you have to use NMS. I recommend using LightAPI for this since it does it for you

frigid ember
#

If I am using paper would I do it in that yml file as well

mellow wave
#

If it has a bungeecord option set it to true there

quick arch
#

reflection dum

mellow wave
#

and who are you talking to?

quick arch
#

probably Choco

#

His reflection serializer broke for me, and I couldn't fix it

mellow wave
#

ow

quick arch
#

so I just used nms for it

mellow wave
#

Yeah sometimes NMS just helps

quick arch
#

Totally didn't take 7smile7's stuff

#

Got the first part kind of right 🤔

half marsh
#

so i made a plugin and it works perfectly fine on my system, but when i upload it on an actual server it stops working and im not sure why its doing what it does

#
        File maindir = new File(this.getDataFolder().getAbsolutePath() + "");
        if (maindir.isDirectory()){
            File[] files = maindir.listFiles();
            System.out.println("\n\nmaindir is a directory");
            for (File f : files){
                System.out.println(f.getAbsolutePath());
            }
        } else {
            System.out.println("\n\nmaindir isnt a directory or doesnt exist");
        }
#

im just trying to get into the "monsters" folder which i know is in there, but it says it doesnt exist

#

so i looked up all the absolute paths in my plugin directory to double check

#

so monsters is in there right

#

but then when i try to go into that directory using

#
        File maindir = new File(this.getDataFolder().getAbsolutePath() + "\\monsters");

#

it dont work

#

it doesnt exist

bold anchor
#

\is incorrect

#

\\

#

File maindir = new File(this.getDataFolder(), "monsters");

half marsh
#

should that make it not work on my end though

bold anchor
#

That'll work everywhere

half marsh
#

no i mean

#

why would what im currently doing here work here while not working there

bold anchor
#

Working where

half marsh
#

on my localhost server

bold anchor
#

Just do what i said.

half marsh
#

i mean ill try this out but im just trying to understand why

frigid ember
#

ok

half marsh
#

is it because im running windows and that server is running linux or uhh

frigid ember
#

and i have this nether star thing

lone fog
#

Probably

half marsh
#

allrighty

#

thanks for helping

frigid ember
#

i want it to open the inventory when i click the nether star

#

what do i do

half marsh
#

kody simpson has a fantastic tutorial on a menu manager

#

makes making menus really easy

#

i recommend it

frigid ember
#

for me?

half marsh
#

wdym for you

frigid ember
#

nvm

lone fog
#

When you click it how

#

Holding it? In the inventory?

unkempt ridge
#

Is this a good method for creating pages within menus? No one answered my questions so I'm looking on the forums, but haven't found anything promising. https://paste.md-5.net/ajojuheder.cs

quick arch
#

Coll, you were asking for the custom block speed packets, yeah?

lone fog
#

Ye

quick arch
#

Gotta find their nms name

warm stirrup
#

any ideas? or is that just how it is :/

quick arch
#

hm there's no PlayOutArmAnimation 🤔

jagged torrent
#

are you shading in nms or what xdd

warm stirrup
#

i.. i am

jagged torrent
#

35mb damn

#

w h y

quick arch
#

o

#

Just make them all optional

warm stirrup
#

i did?

quick arch
#

🤔

warm stirrup
#

<optional>true</optional> on em all right?

quick arch
#

oh

jagged torrent
#

no

mellow wave
#

Set them to provided in the POM

jagged torrent
#

^^

mellow wave
#

And don't shade them

quick arch
#

^

frigid ember
#

@mellow wave I set everything to offline mode and turned on bungee on all servers, and the server is working with bungee, but the players are still not recieving items from when the server was set to online mode

quick arch
#

I haven't used maven in 6+ months ._.

warm stirrup
#

uhhh ok lemme see what i can do

quick arch
#
PacketPlayInBlockBreakAnimation
PacketPlayInArmAnimation
PacketPlayInBlockDig

@lone fog

frigid ember
#

If anyone thinks they can help: I am setting up a server network and had a factions server open before enabling bungeecord. Bungeecord requires that the server be set in online mode, but when I do this all players lose their progress from the day the factions server was open. Is there any way to enable bungee but still keep the old player data?

quick arch
#

They're probably somewhat wrong but hey, close enough

lone fog
#

Thanks

quick arch
#

👍

#

I'll probably make a plugin soon that allows configurable custom blocks

warm stirrup
#

"and dont shade them" how do i include my other modules? while keeping the filesize down

#

im new to maven

mellow wave
#

You shade your modules not the NMS

#

By setting your dependency scope to provided it will prevent them from getting shaded

#

Basicly add <scope>provided<\scope> in each dependency

warm stirrup
#

so what i think you're saying is... i don't add provided to the dependencies connected to my modules, but add it to the spigot artifact in each module?

nimble oar
#

@frigid ember The links are the same?

frigid ember
#

Wait

#

1 sec

mellow wave
#

@warm stirrup Yes that's correct. Add provided to all spigot artifacts

warm stirrup
#

ok that makes sense lemme see what happens

frigid ember
#

Fixed

nimble oar
#

@frigid ember what is the problem tho?

frigid ember
#

..

#

"OK so what I want to do is whenever I click the nether star it opens up the guy, so how would I link them"

nimble oar
#

Did you get this code from somewhere else? This is complete code.
You only have to add :
new NetherStarMenu().openInventory(event.getPlayer());
into the click listener in the nether star "script".

frigid ember
#

GUI

#

FR?

nimble oar
#

Is this all your code?

#

Hm

#
 @EventHandler
    public void inventoryMove(InventoryClickEvent event) {
        if(event.getClick() == ClickType.NUMBER_KEY){
            event.setCancelled(true);
    }
   }
  • This also cancels all inventory clicking using number keys.
#

Is that intended?

mellow wave
#

What you need to do is listen to the PlayerInteractEvent and then open the NetherStar GUI with the code Septicuss sent

frigid ember
#

It is yes

#

Because people could hockey the item out

lone fog
#

🏒

frigid ember
#

Hottkey

#

Auto correct

nimble oar
#

But you are currently cancelling the hotkey movement with all items, not just the nether star

warm stirrup
#

i know what ur talking about palm and i fixed that in a plugin i made maybe a few weeks ago. ill pull it up once im done testing this to show the code

frigid ember
#

K

warm stirrup
#
        if (e.getClick().equals(ClickType.NUMBER_KEY)) {
            if (e.getHotbarButton() == 8 || testItem(e.getCurrentItem())) {
                e.setCancelled(true);
                return;
            }
        }```
#

this is what i did to disable hotkeys

#

testItem() just checks if the item is a specific item I set

#

thats for InventoryClickEvent

#

also olivo i think u saved it lol down to 58kb

#

i just need to fix errors in my actual code that appear now

#

ty

peak tiger
#

Hello there I recently updated papi I tried ecloud downloading some things didn't install at all

#

And some did

#

The one that didn't work and I need it is player

#

Any help

mellow wave
#

Did you ecloud download Player?

peak tiger
#

Ya ofc

lone fog
#

e.getHotBarButton is probably all they need

peak tiger
#

And reloaded it

mellow wave
#

Try running /papi reload

#

Alright try restarting and look for errors in the console

peak tiger
#

I tried via list but nope

#

It says successful installed and reload bur nothing happens and it doesn't appear in list

#

/papi ecloud list installed

mellow wave
#

Are there any errors in your console

#

Wait so it says it's installed?

#

or no

#

I'm confused

peak tiger
#

Ok I'm gonna start over

frigid ember
#

If anyone thinks they can help: I am setting up a server network and had a factions server open before enabling bungeecord. Bungeecord requires that the server be set in online mode, but when I do this all players lose their progress from the day the factions server was open. Is there any way to enable bungee but still keep the old player data?

peak tiger
#

Ok I'm gonna start over
@peak tiger .

mellow wave
#

@frigid ember Did you set bungeecord to true in both spigot.yml and paper.yml and restart?

peak tiger
#

I updated papi and all expansion Göt removed obviously so I started redownloading them essential and vault downloaded successful.
I tried with player is say successful and please do /papi reload when I do it nothing happens at all

#

And when I check in list it appears gray

mellow wave
#

If it appears in the list it should be installed

peak tiger
#

List all

#

Not installed

mellow wave
#

What are you using to hook in to the plugin

#

oh

peak tiger
#

What are you using to hook in to the plugin
@mellow wave wdym

mellow wave
#

What plugin is displaying placeholders?

#

But it doesn't really matter if it fails to install

peak tiger
#

Oh its info board reborn

mellow wave
#

As i asked earlier are there any errors

peak tiger
#

I'll check just a sec

mellow wave
#

Anyway I recommend going to the PlaceholderAPI discord instead of asking here

#

They can probably help more

peak tiger
#

Nope no errors

#

At all

mellow wave
#

Alright go to their discord and ask

void hawk
#

hey guys, do any of you have experience with votingplugin or votifier. My rewards arent working at all

mellow wave
#

I have set them up before

#

I recommend using NuVotifier :)

#

But anyway we need more information to help

frigid ember
#

@mellow wave The bunngee is enabled on every yml folder, bit the players are still losing their data from before bungee was installed

mellow wave
#

And you have restarted?

frigid ember
#

Yes

void hawk
#

yeah im using nuvotifier. This is my current rewards setup:

#

oh i cannot paste images one moment

mellow wave
#

?paste

worldly heathBOT
mellow wave
#

@frigid ember I'm not home atm so I can't help you further

void hawk
mellow wave
#

Does the vote reach the server?

#

Might want to remove those ips

void hawk
#

yeah mb just copied from console

#

didnt realise it showed them :/

mellow wave
#

Did you let VotingPlugin auto generate that section or did you add it manually

void hawk
#

i did it manually

low citrus
#

hi- so what versions of java is spigot compatible with? is it anything from 8 and above or should i just use the latest stable release?

grim halo
#

8+

#

If you want to publish plugins i would go with 8 as most ppl use this version. Although i would like to see more plugins requring java 11.

mellow wave
#

Found the issue

low citrus
#

how much does the version matter?

mellow wave
#

You put Item instead of Items @void hawk

#

and you need to create a sub section

grim halo
#

If you compile plugins on 11 then the machine that runs the server has to have at least 11.
Java 11 is the standard version for Linux now but for whatever reason a ton of ppl are still on 8.

low citrus
#
11.0.2 (build 11.0.2+9)
Windows    64-bit    zip (sha256) 179 MB
Mac    64-bit    tar.gz (sha256) 174 MB
Linux    64-bit    tar.gz (sha256) 179 MB
Source    Tags are jdk-11.0.2+9, jdk-11.0.2-ga```so ig i should download this version?
void hawk
#

do i also need the "diamond"

#

above the item material decleration

jagged torrent
#

@low citrus just download the version for your OS lmao

mellow wave
#

Diamond is the name of the subsection. There may never be more than one with the same name. But it can be named whatever you'd like

low citrus
#

yeah ok thx

void hawk
#

ok thanks

grim halo
#

Yes thats the lates v11

void hawk
#

can it be the same item on a different site tho? @mellow wave

mellow wave
#

Yes

void hawk
#

also, does the item go under rewards?

mellow wave
#

I believe so

frigid ember
#

how do i put the lit banes gui thing on a websit i have a domon aklredy

mellow wave
#

I already told you

frigid ember
#

?

mellow wave
#

You need to point the domain to the host and port which the litebans menu is running

frigid ember
#

what port

void hawk
#

is there a way i can test the configuration is correct & rewards have been given if ive already voted?

frigid ember
#

is it in config fil

mellow wave
#

Idk check what port it's using in the config

frigid ember
#

port?

mellow wave
#

@void hawk Use the votifier tester I sent

frigid ember
#

where is port

mellow wave
#

In the config I guess

frigid ember
#

i cant find it

mellow wave
#

Turns out the website isn't running as I expected it would

void hawk
#

@mellow wave it doesnt show anything different using that website or gives rewards tho because the reward hasnt been stated within the votesites file, do i need to create a field for it in that file to test reward output?

mellow wave
#

You need to add a different vote field for it

#

By default VotingPlugin auto generates those sections for you .. Unless they've changed it since I last used it

#

All you need to do is add the reward to it so you actually get something

frigid ember
#

anyioe know a free website builder that supports htmlinstead of a gui?

#

i mean

mellow wave
#

Instead of a GUI?

frigid ember
#

you can program html in

mellow wave
#

ah I see

frigid ember
#

its for the litban thing

#

COMO PONGO UN plugin EN ES SPIGOT

mellow wave
#

Litebans run php tho

frigid ember
#

idk

#

how do i put php

mellow wave
#

You need a website host

marble geyser
#

how can i get a uuid of an entity?

mellow wave
#

You won't get a good one for free

frigid ember
#

like godady?

#

is it domain

#

i got 1and1 domain

mellow wave
#

No you need a host not a domain

frigid ember
#

host?

grim halo
#

Entity#getUniqueId()

mellow wave
#

Something that runs the webside

marble geyser
#

ok thanks

frigid ember
#

like goggle sites

#

COMO PONGO UN plugin EN SPIGOT

mellow wave
#

What does that even mean :&

frigid ember
#

i think french

mellow wave
#

Spanish I believe

frigid ember
#

😐

#

i kinda understand

#

a plugin in spigot?

#

SI!!!

#

ok

#

COMO PONGO

#

?

mellow wave
#

Well I'm off for today

frigid ember
#

oh

#

ok

#

bye

#

help debería llamarse inútiles

opal adder
#

When priority is at HIGHEST that means that code runs last right?

bold anchor
#

Yes, monitor runs after tho

opal adder
#

Ah, that makes sense, I thought for the longest time HIGHEST was first

pastel condor
#

@frigid ember Put it in the plugins folder

grim halo
#

And dont you dare change the event outcome in MONITOR

void hawk
#

@mellow wave is there a default configuration for the votesites.yml you can link me to i cannot find it?

frigid ember
#

found org.bukkit.block.data.type.Wall

grim halo
#

Like. With code?

frigid ember
#

I hope this will work

#

Yes

#

Is it possible to do so?

grim halo
#

Yes

frigid ember
#

Phew

#

Got scared for a second

#

oh no, that data type doesn't exist

#

on 1.15.2

grim halo
#

rip

#

I found the Switch.Face Enum for 1.15.2

#

Used in FaceAttachable.AttachedFace

frigid ember
#

Thanks, will try that

frigid ember
#

well yes

#

found org.bukkit.block.data.type.Wall
oh no, that data type doesn't exist

#

1.15.2

lone fog
#

Ah

frigid ember
#

@grim halo may I ask where do you find 1.15.2 docs?

lone fog
#

Not sure you can

grim halo
#

I used the oak ones

frigid ember
#

I use paper docs -_-

void hawk
#

ok. Using the votingplugin just doesnt work on giving the rewards

#

even giving the basic rewards which the plugin provides as examples

lone fog
#

Works for me

naive goblet
#

1.7.10-1.16

frigid ember
#

wow thanks

#
            TextComponent msg = new TextComponent("Helpop" + args);
            msg.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(ChatColor.RED + "This is player: " + lore.toString()).create()));
            player.sendMessage("&4[Helpop]" + args);```
#

new HoverEvent

#

deprecated

jagged torrent
#

use the other constructor

#

HoverEvent(Action action, Content... contents)

bold anchor
#

just use the component builder

#

Of course if it doesn't have a hoverevent method ignore me

void hawk
#

okay, ive identified the problem. I have my reward file setup correctly and it gives me the reward. But when i add it to the votesites.yml as the following it removes the ability to see this in /vote, so how are vote files supposed to be referenced

#

Or you can either list rewards files (Files located in plugins/PLUGIN/Rewards), like so:
Rewards:

  • 'RewardFile1'
  • 'RewardFile2'
#

i have it stated as the following which breaks the plugin

#

Rewards:
- 'VoteReward'

dreamy forge
#

Is it allowed to advertise plugins (uploaded on spigot)?

frigid ember
#

ofc not

#

Serious Spigot and BungeeCord Help | Ask Questions Here

twilit radish
#

Where do I ask to get someone to make a plugin for me?

frigid ember
#

Guess that'd be General

lone fog
#

?services

worldly heathBOT
alpine yoke
#

Hey. using which event can I disable players right clicking an armor in hotbar and wearing it?

lone fog
#

InteractEvent

alpine yoke
#

let me check

maiden oyster
#

hi help me pls

alpine yoke
#

I want to make this as easy as possible

maiden oyster
#

whats luckperm discord pls

#

yes

alpine yoke
#

go to luckperms on spigot and on bottom click discord support server

#

lmfao

maiden oyster
#

xD

#

sry

frigid ember
#

^

alpine yoke
#

XDD

frigid ember
#

What does decaprated mean

alpine yoke
#

means its no longer cool

frigid ember
#

k

alpine yoke
#

and using it may make u glitch

#

xd

frigid ember
#

decaprated is wyen u slice the head off of something

#

No

#

As in java

#

lol

maiden oyster
#

oh

#

i did not tell my version

alpine yoke
#

?

#

version of you?

#

your version

maiden oyster
#

nop

alpine yoke
#

Human v595829038 BETA

maiden oyster
#

of decaprated

#

xD

#

bye

#

nop

#

jk

alpine yoke
#

lol

#

!verify is broken :<

tawdry lilyBOT
#

Usage: !verify <forums username>

alpine yoke
#

It says im verified

#

tho im not

maiden oyster
#

!verify

tawdry lilyBOT
#

Usage: !verify <forums username>

alpine yoke
#

cuz my old DC used to be verified

#

but its deleted

#

and it claims my spigot profile :(

naive goblet
#

Wrong channel 😩

maiden oyster
#

oups

alpine yoke
#

this is serious spigot help

naive goblet
#

Lol

#

Fr

alpine yoke
#

I need help

#

I wanna be verified cool kid

maiden oyster
#

Fr me to @naive goblet

alpine yoke
#

I wish someone could fix this

#

:c

maiden oyster
#

😦

naive goblet
#

Someone?

#

Did you ask a staff yet?

maiden oyster
#

dose spigot work on PureCPU

alpine yoke
#

How do I ask staff yet? There is no support channel and staff aint reply here and I cant ping cuz rules

opal adder
#

Is there an efficient way to breaking blocks in a certain radius, rather than a triple nested for loop for it?

maiden oyster
#

yes

#

world edit

#

@opal adder

opal adder
#

I'm not talking about that

alpine yoke
#

he means like code-side

#

not player side

naive goblet
#

Fawe api

maiden oyster
#

ok

#

dose spigot work on PureCPU

opal adder
#

I'd rather know how to do it without using an API for it, I doubt it's that difficult. Unless there's a lot more into it than I thought lol

naive goblet
#

No idea

alpine yoke
#

oh, so I also have a question. cuz im coding skywars plugin. How do I make cages?

naive goblet
#

Yeah you’d most certainly have to use the nested shit

alpine yoke
#

Like i need a void that when i run it putting player.getLocation() it puts glass arround

frigid ember
#

Hello, do you know if there's a way to cancel a task which is in a foreach loop ? If I define an int a = Bukkit.getScheduler()...., I will only be able to cancel the last task right ?

opal adder
#

But it isn't stable, this method causes lag the moment I want to do anything past like a 5-10 radius. And while I only need a 3x3 radius, it seems to be slightly causing lag with a lot of people using it.

naive goblet
#

Yeah it’s cuz it’s sync probably

#

Lots of operations, although it shouldn’t lag with an area as small as you described

#

Did you apply block physics?

#

Grand why only the last?

opal adder
#

wym? I'm setting the block to air, and then doing other things after that. Like checking for autosmelt and stuff

#

it's a veinmeiner thing. I had to make my own to be sure it works with my custom items

opal adder
#

So how can I remove the block without doing that, and without breaking it naturally. I can't do that because I need it to function with certain things

naive goblet
#

Well iirc fawe sets blocks sync but it allows other server traffic to go through

opal adder
#

like autopickup or autosmelt

#

how can I set it sync myself?

naive goblet
#

You could obviously work around that

#

Sync?

#

It’s already sync?

opal adder
#

Sorry I think I'm confused

#

The thing you sent me is kind of saying using setType isn't really safe, but I'm not sure how else to remove the block

#

and still do what I need to do

naive goblet
#

Using setType with second param false might not be very “safe and friendly” but it should increase performance in most to next all cases

opal adder
#

Wait what?

#

This is how I'm doing it

#

newLoc.getBlock().setType(Material.AIR);

naive goblet
#

Block#setType(Material,false);

opal adder
#

wait what

#

what does false do here?

naive goblet
#

apply block physics = false

opal adder
#

But what does that actually do, and why is it better?

naive goblet
#

It doesn’t do the block physics check which is presumably something that’s done when a block is modified and tells other blocks around what happened

#

Nearby

opal adder
#

Interesting

#

Can it have negative affects?

naive goblet
#

Yeah it’s unsafe although you generally don’t have to think about that

#

It can have some weird side effects

wary ledge
#

i always forget

naive goblet
#

group is probably your package

#

artifact is the name

wary ledge
#

ok

subtle blade
#

yep. wtf.choco:VeinMiner for my groupId:artifactId for example

wary ledge
#

yeah ik

#

i've done all this before

tiny horizon
#

I started getting this error after I updated bungeecord to the latest version

#

On bungeecord, I have the latest version of ViaVersion, ViaBackwards, and ViaRewind

#

This is the error in the bungeecord console. Looks like this error is from ViaVersion.

frigid ember
#

yo how would I disable mob ai in the spigot source code itself?

jagged torrent
#

Spigot doesn't handle AI, the underlying NMS does

frigid ember
#

ah so I guess I have to mess with nms then

fleet crane
#

Mob.setAI(false)

void hawk
#

using redprotect is there a command you can execute to gain claim blocks?

wary ledge
#

i want to make a cooldown for something

#

but how

#

i could make a hashmap with a uuid and an int

#

when the player does the action i set the int to idk 10

#

then i can check if it says 0

#

but how do i make it count down

celest current
#

Is there an event handler for checking if a player is holding an item? Google is saying that only interacting with items will register as an event

odd knoll
#

Map<Player, Long> where long is system.currentTimeMillis then you can do if (!this.theMap.contains(player) || System.currentTimeMillis - this.theMap.get(player) < cooldownMillis)

acoustic jacinth
#

I want to send message when join
@Override
public void onEnable() {
for (Player me : Bukkit.getOnlinePlayers()) {
if (me.getName() == "EditDev") {
for (Player players : Bukkit.getOnlinePlayers()) {
if (players.getName() != "EditDev") {
for (Player players2 : Bukkit.getOnlinePlayers()) {
players.sendMessage("§cOwner joined");
}
}
}
}
}
}

balmy sentinel
#

@celest current PlayerInventory has a getHeldItemSlot()

sturdy oar
#

rip brackets

odd knoll
#

I don't see a need for the second for loop.

#

Also, .equals for strings.

lone fog
#

That is many loops

odd knoll
#

Also, that's not even a PlayerJoinEvent..

#

I assume you're new to Java and the Spigot API Edi?

quick arch
#

🤔

odd knoll
acoustic jacinth
#

There is so much text... but i will try. Do i just add a for loop and let it run until i jopin?

balmy sentinel
#

you won’t get far in this industry without doing your own research or reading. If you want to make a join message create an event, PlayerJoinEvent, and then listen for when specific players join.

acoustic jacinth
#

How do i say != with equals

sturdy oar
#

lmao

#

that's like java basics

acoustic jacinth
#
  @Override
  public void onEnable() {
    do {
      for (Player me : Bukkit.getOnlinePlayers()) {
        if (me.getName().equals("EditDev")) {
          for (Player players : Bukkit.getOnlinePlayers()) {
            if (!players.getName().equals("EditDev")) {
              for (Player players2 : Bukkit.getOnlinePlayers()) {
                players.sendMessage("§cOwner joined");
              }
            }
          }
        }
      }
    } while (!meOnline());
  }

  boolean meOnline() {
    for (Player player : Bukkit.getOnlinePlayers()) {
      if (player.getName().equals("EditDev")) {
        return true;
      }
    }
    return false;
  }
balmy sentinel
#

@acoustic jacinth please learn some basic Java and then come back and try coding with the Spigot API. Not trying to be mean, but you're not going to get spoon feed here.

sturdy oar
#

I some time spoonfeed stuff

#

But when it's this easy I do not

naive goblet
#

Jesus that code

#

Use streams 🤙

acoustic jacinth
#

Like twitch? how?

balmy sentinel
#

....

naive goblet
#

Lol no

lone fog
#

Also

#

Please use the playerJoinEvent

#

That is just an infinite loop

balmy sentinel
#

I never spoon feed because I'm a strong believer that you learn more when you do your own research and whatnot (i.e. reading the docs). I understand like people don't understand shit sometimes, but then it's just about pointing them in the right direction or to a tutorial.

acoustic jacinth
#

No it stops when i join

lone fog
#

Yeah well

#

The server will crash before that

naive goblet
#

I never spoon feed but I often give pseudo code

quick arch
#

that you learn more when you do your own research and whatnot
TRIAL AND ERROR!

#

:D

acoustic jacinth
#

Ok i will read the join event thing...

quick arch
#

🤔

balmy sentinel
#

that honestly won't help you @acoustic jacinth I'm sorry, but you really do need to learn some basic Java before you try dealing with APIs

acoustic jacinth
#

I do know some java 😦

sturdy oar
#

Imagine supporting multiple versions with NMS, I wouldn't ever do that

quick arch
#

I'm only supporting 1.16+

naive goblet
#

The first one king

quick arch
#

alright

frigid ember
#

Can someone point me in the right location for playing audio to an area w/ a radius set?

naive goblet
#

I mean abstraction and nms is nice

sturdy oar
#

there's not really a radius I think

#

the only I know is World.playSound

naive goblet
#

Better than going with non cached reflection

frigid ember
#

hmmm

#

mmm non cached reflection

#

delicious

naive goblet
#

And it’s probably little faster than reflection in it’s best phase as well

sturdy oar
#

Maybe there's those secret value combination that get you a radius, check the documentation for World.playSound

balmy sentinel
#

is it inefficient to check if a player is within a specific location and if they are, play the sound for the player?

acoustic jacinth
#

Where do i get PluginManager ?

naive goblet
#

Bukkit.getPluginManager()

void hawk
#

for some reason when i /kill me or other admins we do not loose our inventories regardless of gamemode?

acoustic jacinth
#

ok

frigid ember
#

@sturdy oar thanks, i'll take a peak
@balmy sentinel depends on the situation I guess?

sturdy oar
#

Server#getPluginManager

frigid ember
#

Taum, Godmode active?

sturdy oar
#

Server is faster than Bukkit getter

naive goblet
#

Taum can be cuz if permission

balmy sentinel
#

@frigid ember that was my solution for you lol. I'd give that a try tbh

frigid ember
#

Oh XD

naive goblet
#

TheViperShow how much faster?

void hawk
#

godmode is not active

sturdy oar
#

TheViperShow how much faster?
@naive goblet at least 1 nanosecond

naive goblet
#

Did you check or are you just saying that?

sturdy oar
#

I think less methods are called

naive goblet
#

Well I have no clue so just interested

sturdy oar
#

You can check it

naive goblet
#

It should be negligible anyways

grim halo
#

If it got JIT compiled there is literally no difference. some nanos on worst case

sturdy oar
#

Anyway I usually use Server for everything

#

I don't really like using the Bukkit static methods

grim halo
#

Any reason for that or just a preference?

void hawk
#

no i just checked with whois i dont have godmode enabled

naive goblet
#

Do you pass JavaPlugin#getServer() or do you store the Bukkit.getServer() ?

sturdy oar
#

I pass getServer() with injection

grim halo
#

Both the same instance. Doesnt matter

naive goblet
#

^

acoustic jacinth
#

This not loading...

public class OwnerJoin extends JavaPlugin implements Listener {

  @Override
  public void onEnable() {
    Bukkit.getPluginManager().registerEvents(new OwnerJoin(), new OwnerJoin());
  }

  @EventHandler
  public void join(PlayerJoinEvent event) {
    if (!meOnline()) {
      for (Player me : Bukkit.getOnlinePlayers()) {
        if (me.getName().equals("EditDev")) {
          for (Player players : Bukkit.getOnlinePlayers()) {
            if (!players.getName().equals("EditDev")) {
              for (Player players2 : Bukkit.getOnlinePlayers()) {
                players.sendMessage("§cOwner joined");
              }
            }
          }
        }
      }
    }
  }

  boolean meOnline() {
    for (Player player : Bukkit.getOnlinePlayers()) {
      if (player.getName().equals("EditDev")) {
        return true;
      }
    }
    return false;
  }

}
odd knoll
#

Again, why do you have that for loop inside the for loop inside the for loop?

acoustic jacinth
#

Its safer if one equals check fails. No?

quick arch
#

no

balmy sentinel
#

delete meOnline it's pointless. You can get the player with event.getPlayer() instead of looping through all online players. That event will be fired anytime a player joins your server

acoustic jacinth
#

But why it not loading

naive goblet
#

You should be doing stuff more implicitly as code flows

#

It will reduce the nesting

balmy sentinel
#

Bukkit.getPluginManager().registerEvents(this, this); If you're registering an event thats your main class just do this.

wary ledge
#

i want to make a cooldown, if i make x = 120 (2 min) and then count down to 0 what's the best way to count down

acoustic jacinth
#

I will read the strem thingy and it will look nicer ok

naive goblet
#

👍.

acoustic jacinth
#

to wat dos "this" point

naive goblet
#

Need_Not preferably store universal time and compare

#

it points to the class itself

acoustic jacinth
#

what is a need_nod and how do i compare universal time?

#

do i need that fot "this"`?

naive goblet
#

it’s used to access class leveled stuff instead of for instance local leveled stuff as local leveled stuff normally hides class leveled stuff

#

The time was to @wary ledge

acoustic jacinth
#

oh so "this" is for class level stuff? like static?

naive goblet
#

I can give you a pseudo code

acoustic jacinth
#

what do you men wit level? i onley know scope

naive goblet
#
class X {
  private int i = -1;

  public void setInt(int i) {
    this.i = i;
  }
}```
#

in the function, just i would point to the parameter meanwhile this.i would point to the class field

acoustic jacinth
#

so "this" points to the parameter or the variable in the class instance?

naive goblet
#

the variable from the class instance

acoustic jacinth
#

oh ok. So i dont can use the name again?

wary ledge
#

i was thinking make something like this

naive goblet
#

Wym

#

Edi

#

Neednot say

wary ledge
#
            int x = 120;


            while (x<0) {
                Thread.sleep(100);
                x--;
                cooldown.put(player.getUniqueId(), x);
                }
            }``` and then check if the cooldown is == 0 and if not it returns like "you cannot use this for x seconds"
acoustic jacinth
#

like. If i have a name "number" in my class and a name "number" in a method so i use "this" so i dont have "number" again and know wht to use

wary ledge
#

wait

#

i would need to set it to sleep(1000)

#

oops

odd knoll
#

What are you trying to make a cooldown for?

naive goblet
#

Well basically it’s used to access a class variable inside a function if the function has a local variable with the same name

odd knoll
#

Can't you just store the last time they used X and then check the time since then?

balmy sentinel
odd knoll
#

Map<Player, Long> where long is system.currentTimeMillis then you can do if (!this.theMap.contains(player) || System.currentTimeMillis - this.theMap.get(player) > cooldownMillis)
@odd knoll

acoustic jacinth
#

ok "this" is cool. i will red stream

sturdy oar
#

Did

#

I read

#

Thread.sleep

#

Oh no

odd knoll
#

Yh, it's unnecessary to do a timer like that.

unkempt ridge
wary ledge
#

i saw that thread

#

but i dont see what is counting down the time

odd knoll
#

You're not counting down the time, you're comparing when you need to check if they can use something.

#

They execute /help - you log the current time.

You have a 5 second cooldown, they execute /help again after 2 seconds. You use the time you logged since they last did the command and see it's not been 5 seconds.

naive goblet
#

Only schedule tasks if you’re really in need of them.

acoustic jacinth
#

what difference from "() ->" and "var ->" ?

naive goblet
#

First one is a runnable

sturdy oar
#

var?

naive goblet
#

Second on is a lambda taking a single argument

wary ledge
#

oh so im logging current irl time?

naive goblet
#

Or I mean first is an empty lambda

sturdy oar
#

You can't use "var" as lambda parameter name

#

It's reserved keyword

naive goblet
#

That was probably just an example

sturdy oar
#

Oh ok

acoustic jacinth
#

oh ok so it is like with method parameters just stipid and in one line

tiny dagger
#

first is a no paramter lambda

odd knoll
#

I need to make a cooldown for something actually, so I might as well give u an example Need_Not lol.

balmy sentinel
#

iirc, var is an added keyword in Java 10

odd knoll
#

Oh wait, no, I just need to make a lock 😐 I do need a cooldown

naive goblet
#

Yeah

#

It is edi

acoustic jacinth
#

but i now have a stream or lambda thing "players -> " but i cant see this in the next lambdas that is "players2 ->"

sturdy oar
#

I have a cooldown example in my plugin but it will probably only confuse you

naive goblet
#

Send ur code edi

odd knoll
#

And ugg, my code isn't per player sooo.

acoustic jacinth
#

Wait i fixed it... but i dont touch it... if i do any my ide just makes everything red

balmy sentinel
#

why are they're trying to use lambdas? I thought they were just trying to get join messages to work

acoustic jacinth
#

this do not better to red

sturdy oar
#

🤷‍♂️ 🤷‍♂️ 🤷‍♂️

acoustic jacinth
#
public class OwnerJoin extends JavaPlugin implements Listener {

  @Override
  public void onEnable() {
    Bukkit.getPluginManager().registerEvents(this, this);
  }

  @EventHandler
  public void join(PlayerJoinEvent event) {
    if (!meOnline()) {
      Bukkit.getOnlinePlayers().stream().forEach(me -> Bukkit.getOnlinePlayers().stream().forEach(players -> { if (!players.getName().equals("EditDev")) { Bukkit.getOnlinePlayers().stream().forEach(players2 -> players.sendMessage("§cOwner Joined")); } }));
    }
  }

  boolean meOnline() {
    return Bukkit.getOnlinePlayers().stream().anyMatch(me -> me.getName().equals("EditDev"));
  }

}

So this now works and better reading?

odd knoll
#

Oh god.

sturdy oar
#

about better reading idk

balmy sentinel
#

@acoustic jacinth that event is fired whenever a player joins the server so there is no need to check if they're online..

naive goblet
#

You’d do something like this perhaps

Bukkit.getOnlinePlayers().stream()
  .filter(player -> player.isSneaking())
  .peek(player -> player.setDisplayName(”sneaker”))
  .collect(Collectors.toList());```
sturdy oar
#

Nooo

#

Nooooooo

acoustic jacinth
#

i dont know what filter and peek and all means

naive goblet
#

It says there

#

And the code was just an example

acoustic jacinth
#

my eclipse do not yell at me so i keep this for now. my server is loading it maybe works

naive goblet
#

Aight

tiny dagger
#

i actually never used stream 👀

naive goblet
#

I mean I use it because it reduces boilerplate

wary ledge
#

ok so in the if(cooldowns.get(playerName) - System.currentTimeInMillis() * 1000 < cooldownTime) { line

#

i understand when the player runs it

#

it sets it to System.currentTimeInMillis()

odd knoll
#

Some things. 1) Make sure the map contains the player first.

acoustic jacinth
#

but my code is all in one line now... and i dont understand it anymore.
BUT IT WORKS NOW. THANKS s much ican now make better plugins with lambda and @EventHandler thing

odd knoll
#

Second thing, I think you have some things backwards.

naive goblet
#

Lmao

wary ledge
#

yeah i just realized that

odd knoll
#

cooldowns.get(playerName) - System.currentTimeInMillis() this will give u a negative.

wary ledge
#

what do i set player to

odd knoll
#

You set it to the current system time.

tiny dagger
#

one thing weird with streams is that they mess with the flow in a sense

wary ledge
#

System.currentTimeInMillis()

tiny dagger
#

usually lines go one after the other

wary ledge
#

correct?

naive goblet
#

Yeah Free I did actually come a cross that

balmy sentinel
#
public class OwnerJoin extends JavaPlugin implements Listener {

  @Override
  public void onEnable() {
    Bukkit.getPluginManager().registerEvents(this, this);
  }

  @EventHandler
  public void join(PlayerJoinEvent event) {
    Player player = event.getPlayer();

    if(player.getName().equals("EditDev")
      event.setJoinMessage(ChatColor.RED + "Owner Joined");
  }

@acoustic jacinth

acoustic jacinth
#

could i write all plugins in one clkass?

naive goblet
#

Lol

acoustic jacinth
#

Wait what do this do

naive goblet
#

You can write a single plugin in one file yes

#

But not recommended

balmy sentinel
#

yes, you can also put them all on one line.

#

:3

naive goblet
#

🤗.

tough kraken
#

got a question

if the player is going out of the nether, and then is ouside of the worldborder (because of nether-overworld scaling) i want to teleport him back to the border.

how can i do that? made a paint, maybe it tells what i want

yeah, painting-skills 10/10 lol

tiny dagger
#

you can write a plugin in a 1 line of code

#

java ftw i guess

acoustic jacinth
#

should i do that? when i use lambda i can make that. right?

#

but it so hard reading. i dont understand

naive goblet
#

Don’t do the lambdas very much then

tough kraken
#

why the hell should someone write a whole plugin in one line lol

tiny dagger
#

check world change event

naive goblet
#

Try understand what’s going on

tough kraken
#

i would have used the move event

naive goblet
#

That’s most important if you ask me edi

odd knoll
#

Then check their coords are within bounds and they're now in the overworld.

balmy sentinel
#

@acoustic jacinth you're clearly new to Java so don't try to learn lambdas for a bit. It's just going to confuse you further.

naive goblet
#

^

wary ledge
#

so let's say it sets it to 1596758206371 and then a while later they do it again and it says 1596758208218 i get -1847 (1.8s) would i then check if that is more than -120000 (2 min)

acoustic jacinth
#

no. i do write a plugin now only with lambda. i have to learn that so i can make better plugins

tough kraken
odd knoll
#

You're doing it all inverted if you have that.

acoustic jacinth
#

is code faste when in lamda and one line?

tiny dagger
#

wait

wary ledge
#

so -current from cooldown log

tiny dagger
#

minecraft isn't handling borders right?

balmy sentinel
#

lambdas don't "make your plugin better"

naive goblet
#

Edi shouldn’t matter

odd knoll
#

You should do System.currentTimeMillis - theLastExecutionTime. That gives you milliseconds since they last executed. Then you just make sure it's larger than the cooldown you want in milliseconds.

wary ledge
#

ok

naive goblet
#

Lambdas isn’t just in streams but it’s the -> expression

#

And it’s generally just reducing boilerplate

#

Although you have to treat them somewhat different

lone fog
#

Did someone say write an entire plugin in 1 line

balmy sentinel
#

If you're going to learn lambdas before you learn some more basic java you're going to confuse you're self further and end up doing more harm than good.

acoustic jacinth
#

can i make a forum post to to explain new players how lambda are used and how it makes my plgin faster?

naive goblet
#

Don’t

#

Because that’s not true most likely

acoustic jacinth
#

wait is not?

odd knoll
#

I'd recommend only making advisory posts once you heavily understand Java and have studied it a lot.

acoustic jacinth
#

but its hard reding-. why do i use?

naive goblet
#

Boilerplate != performance

lone fog
#

Code golf plugins

naive goblet
#

Reduces boilerplate

acoustic jacinth
#

is boilerplate from cooking recipe?

odd knoll
#

Streams can make things really clean but also a lot slower in a lot of cases. I only use them for loading or unimportant cases where response time isn't vital.

acoustic jacinth
#

i dont understand

balmy sentinel
#

@acoustic jacinth no offense, but a few minutes ago you didn't know how to negate .equals(). You need to learn some more basic java before you're ready to make tutorials educating people.

naive goblet
#

And I think java doesn’t create a new interface instance if it’s a lambda iirc. Might be totally wrong on this one though.

acoustic jacinth
#

what plugin do i try first?

#

lobby system?

naive goblet
#

Try make a give command

acoustic jacinth
#

i want lobvby system and kit

#

waitt

#

how do i make command?=

naive goblet
#

Implement CommandExecutor

#

and then set it on a command

acoustic jacinth
#

also in my class==? can i implement everything?

naive goblet
#

Almost

odd knoll
#

It's recommended you make different classes for different things.

#

If you need to implement multiple classes, you do implements ClassOne, ClassTwo

acoustic jacinth
#

but i can make one class and then use lamda and it gets smaller

lone fog
#

I mean yes

#

But that's not good practice

naive goblet
#

Most likely you can implement all the needed interfaces but for instance if 2 interfaces has the same method but different return types it would give you a compiler errror I think.

acoustic jacinth
#

tell me all classes i need so i can implement everyone

#

like ever need

lone fog
#

No

naive goblet
#

😩

lone fog
#

That's not

#

How

#

This works

tough kraken
#

i hate my life atm

odd knoll
#

That's not how you should code.

naive goblet
#

Edi you’ll end up with a spaghetti mess

odd knoll
#

Make different classes for different parts of your plugin and only implement in them what you need in that class.

lone fog
#

And a ton of unused methods

acoustic jacinth
#

ok... so i see BukkitRunnable in tutorial, do i import mor or only the 3 ?

naive goblet
#

Edi start with something simple, a join plugin?

#

You don’t use BukkitRunnable

lone fog
#

Don't bother manually importing unless you for some reason need to

naive goblet
#

Or I mean if you want go ahead

lone fog
#

IDE's will take care of it

acoustic jacinth
#

no i mena also implements BukkitRunnable

naive goblet
#

You can’t

#

BukkitRunnable isn’t an interface

#

You’d have to extend it then

tough kraken
acoustic jacinth
#

Ok i dont know. tell me a plugin i can write an i try and you tell me whats bad

naive goblet
#

Join message

#

And leave message

#

Give command

acoustic jacinth
#

wait. only one

naive goblet
#

You choose?

lone fog
#

Join message

#

Make a fancy message when an op joins

acoustic jacinth
#

ok so i can use the eventhandler i have with PlayerJoinEvent for this

naive goblet
#

Yep

#

Never seen a ServerOwnerDeveloper before 😮

acoustic jacinth
#

do i use "==" or equals for players?

naive goblet
#

equals

#

Depending on what you’re doing == might also work but .equals() will always work unless some wizardry

#

(For player)

balmy sentinel
naive goblet
#

Those words isn’t good for him

acoustic jacinth
#

oh ok. so do every class have equals or? i dont see it when creating

naive goblet
#

Yes every class has the method

#

That doesn’t mean it’s convenient to always use it

#

But most likely

acoustic jacinth
#

How do i say in this line not "A player has join" but with the name?

  @EventHandler
  public void join(PlayerJoinEvent event) {
    event.setJoinMessage("Welcome");
    Bukkit.getOnlinePlayers().stream().forEach(online -> { if (online.equals(event.getPlayer())) { event.getPlayer().sendMessage("A player has join."); } else { event.getPlayer().sendMessage("Welcome"); } });
  }
naive goblet
#

Player#getName()

bronze acorn
#

why did you do a stream lol

naive goblet
#

^

bronze acorn
#

just do forEach doesnt that work by itself

acoustic jacinth
#

Its faster

bronze acorn
#

i

balmy sentinel
#

no it's not

naive goblet
#

.

bronze acorn
#

huh

#

xd

balmy sentinel
#

lambdas don't make your code faster

naive goblet
#

It reduces boilerplate most likely

acoustic jacinth
#

den why do i use it? i dont understand my code because i looked at chat for short time anymore

naive goblet
#

Go with an enhanced for loop

acoustic jacinth
#

how i make enhanced? with "@"?

naive goblet
#

Huh

acoustic jacinth
#

do i add @enhanced to the loop

naive goblet
#

No

acoustic jacinth
#

then what is enahnced

lone fog
#

A fancy term for a loop that goes over a collection

acoustic jacinth
#

it sais that Collection has no index... i use Iterator ok?

frigid ember
#

can someone help me with making a playerlist menu with deluxe menus?

acoustic jacinth
#

because getOnlinePlayers() makes me a Collection

frigid ember
#

like it shows

naive goblet
#
for (int i = 0; 0 < Bukkit.getOnlinePlayers().size(); i++) {
  Bukkit.getOnlinePlayers().get(i);
}
//pretty same as
for (Player player : Bukkit.getOnlinePlayers()) {

}```
frigid ember
#

all the players heads

acoustic jacinth
#

i tried the get(i) but it sais that Collection has no get(i)

naive goblet
#

You can make it a list if needed by calling ArrayList<>(Collection)

#

Yeah

acoustic jacinth
#

i use iterator now...

naive goblet
#

My bad

ionic hound
#

Anyone know why ItemStackUtil is does not work
inv.setItem(11, new ItemStackUtil(Material.DIAMOND).setName("Click").buildItem());

lone fog
#

For (Player player : Bukkit.getOnlinePlayers())

naive goblet
#

What’s not working specifically

ionic hound
#

it shows up in red and i get the error java: cannot find symbol

naive goblet
#

Send error

bronze acorn
#

its get

#

lowercase

acoustic jacinth
#

what is different from getName and getDisplayName

bronze acorn
#

not Get

balmy sentinel
naive goblet
#

Coll being a casual C programmer :9

lone fog
#

Hush

naive goblet
#

Or I mean doesn’t C have capitalized names on methods?

lone fog
#

C# does

naive goblet
#

Close

acoustic jacinth
#
public class OwnerJoin extends JavaPlugin implements Listener, CommandExecutor {

  @Override
  public void onEnable() {
    Bukkit.getPluginManager().registerEvents(this, this);
  }

  @EventHandler
  public void join(PlayerJoinEvent event) {
    event.setJoinMessage("Welcome");
    Iterator iterator = Bukkit.getOnlinePlayers().iterator();
    while (iterator.hasNext()) {
      Player player = (Player) iterator.next();
      if (player.equals(event.getPlayer())) {
        event.getPlayer().sendMessage("Welcome");
      } else {
        event.getPlayer().sendMessage("A player has join:");
        event.getPlayer().sendMessage(event.getPlayer().getName());
      }
    }
  }
  
}

So i make plugin. this good?

lone fog
#

I’d edit it but I suppose it works

balmy sentinel
#

you already have a "Welcome" message sent to all players when someone joins the server. Therefore, event.getPlayer().sendMessage("A player has join:"); this is pointless.

acoustic jacinth
#

i can smell the progress

#

but i want to join player: "welcome" and to everyone else "A player has join:"

lone fog
#

You send welcome twice

acoustic jacinth
#

ah ok i understand.

#

oh my ide just give me the option "replace with enhanced for" i understand

balmy sentinel
#
  @EventHandler
  public void join(PlayerJoinEvent event) {
    Player player = event.getPlayer();
    event.setJoinMessage(ChatColor.YELLOW + "Welcome " + player.getName());
  }

@acoustic jacinth I don't know why you're trying to make this more complicated than it is.

hybrid path
#

Should I shade all my dependencies or how should I do them?
I'm thinking of releasing my project soon but I am unsure about licensing. One dependency uses the Apache, the other the MIT license. Can I just have the users using my plugin put the dependencies in plugins/? Note: The dependencies are not spigot plugins but rather normal java libraries.

median terrace
#

hey i was wanting to setup a situation on my 1.12.2 forge server where i can load/unload resource packs a player has installed, without them manually having to do it themselves.

do i use World Resourcepacks 1.7?
do i use Force Resourcepacks?

id include links to be more specific, but when i tried my message was automatically erased.

thank you guys for having me with you.

naive goblet
#

Sean if you’re using gradle I can help

lone fog
#

Why are you here

#

This isn’t forge

hybrid path
#

Yeah I am @naive goblet

naive goblet
#

Lov ya

#

Okay so you neee the shadowJar gradle plugin

hybrid path
#

I know how to shade btw, it's just I don't know if I should do it because of licensing issues?

acoustic jacinth
#

Ok i will sleep now. but i will make better plugins. do i post here if i make one?

median terrace
#

idk... just here off a recomendation, i have about a year of mc exp, but most that time has been spent trying to play with server stuff, so im very green.

acoustic jacinth
#

can i make my plugins premium?

balmy sentinel
#

@acoustic jacinth no this channel is for helping people with their code and Spigot/Bukkit development in general

naive goblet
#

What dependencies specifically

#

Sean

balmy sentinel
#

You need to have 80+ messages 20+ positive ratings and 3 free resources before you can post a premium resource.

hybrid path
lone fog
#
  @EventHandler
  public void join(PlayerJoinEvent event) {
  event.setJoinMessage(ChatColor.YELLOW + "Welcome " + event.getPlayer().getName());
  }```
#

No need for a variable :p

naive goblet
#

Most likely just give credit on github if you have your project there

balmy sentinel
#

I know lol, I copied my code from earlier where they wanted to give themself a custom join message, but I forgot to remove it

hybrid path
#

And if I aim to upload it to spigotmc.org, it is fine to have them shaded?

acoustic jacinth
#

oh so i can send my join plugin and i can write to many people and ask them
i can make 3 plugins tomorrow and write a lot of players and then i make a premium plugin

frigid ember
#

wait Edi LOL ?

#

please tell me ur trolling

balmy sentinel
#

@acoustic jacinth they won't accept a simple join plugin.

naive goblet
#

Pretty sure yes. You might have to just credit the licensed projects in your plugin description as well else it should be fine.

lone fog
#

$10 to set welcome message plz

acoustic jacinth
#

no i do add join so i can havwe 3 plugins

frigid ember
#

looking for /fly plugin, only paying $25 and above dm me to make pls

hybrid path
#

Hmm ok, thanks. I'll peek around the dependencys github and websites for any clues if there needs to be anything else.

acoustic jacinth
#

my premium is a lobby with kit plugin

naive goblet
#

Yeah, presumably the license will tell you what you can do and can’t do and what you have to do in terms of service.

ionic hound
balmy sentinel
#

@acoustic jacinth no offense, but you're still new so don't make any premium plugins. Anything you can probably think of right now, already exists.

naive goblet
#

It’s always nice to credit authors for their products you’re using though

frigid ember
#

nty i want /fly premium only because it's more sm00th3r

acoustic jacinth
#

so i add a join plugin and a leave plugin and what was the 3 you send me?

hybrid path
#

Obviously, yeah

median terrace
#

i think maybe im in wrong server? haha

lone fog
#

Probably

#

Forge questions should probably go to forge

balmy sentinel
#

@acoustic jacinth They won't accept a join/leave plugin. They're already a ton of lobby managing plugins that can set join/leave messages and do a lot more than that as well.

median terrace
#

well, i mean iv asked about 25 servers this question to be fair

acoustic jacinth
#

wait do my plugins all need to accept from forum?

median terrace
#

most the time people say "you cant" or point me to another server

naive goblet
#

Wait

median terrace
#

ok

balmy sentinel
#

@acoustic jacinth they have to meet a certain standard yes, they don't get posted right away.

ionic hound
#

I am getting the error java: cannot find symbol. and it points to this
line inv.setItem(11, new ItemStackUtil(Material.DIAMOND).setName("Click").buildItem()); how do i fix this?

naive goblet
#

I mean shipgazer Forge 1.12.2 isn’t supported right?

lone fog
#

So wait, you want to change resource packs between the ones the player already has installed

median terrace
#

idk haaa. sorry i know im 1.12.2 server on forge

#

so

naive goblet
#

It’s fine

#

What was it about anyways

median terrace
#

i want it so if a player loads a world/area in my server

acoustic jacinth
#

but i see a lot of plugin that are super trash and get postet. and even more bad... skript. and they are only one line sometime

naive goblet
#

A chunk?

median terrace
#

it automaticly loads/unloads the correct resource pack from the ones they have downloaded already

lone fog
#

Not possible without a custom mod

acoustic jacinth
#

i will post and i will see. i will tell you my premium plugin when it doen

median terrace
#

i want this mod

frigid ember
#

? oh you didn't know?

lone fog
#

Doubt there is one out there

frigid ember
#

skript anticheats are worth $30+ on the market

lone fog
#

Probably need one made for it

median terrace
#

why not? it could be so usefl

#

you could do crazy things

lone fog
#

I mean sure

balmy sentinel
#

@acoustic jacinth you do you. I'm done entertaining this idea.

lone fog
#

But modpacks don’t often do stuff like that

median terrace
#

i found a reddit thread that starts to point out some of the potential it could have if you would like to see.

#

even if you have one world

#

it could be very useful

naive goblet
#

Ship I don’t think that’s very possible

lone fog
#

I mean you can already set a single resource pack for your server

naive goblet
#

Or I mean yes

median terrace
#

if we can use windows on mc

acoustic jacinth
#

but my friend told me that skript should "Skript soll reudig und allein am Bahnhof zoo sterben. Das ist so so bad."
wait i need to google translate

median terrace
#

then this must be possible

lone fog
#

I mean it is

#

But no one has wanted it before

median terrace
#

i can even have a player be prompted to dl rp from ingame

hybrid path
#

but my friend told me that skript should "Skript soll reudig und allein am Bahnhof zoo sterben. Das ist so so bad."
wait i need to google translate
@acoustic jacinth that's quite mean lol

median terrace
#

but i cant change ones they already have dled?

naive goblet
#

Occasionally you’d just make new textures instead etc

median terrace
#

people have wanted tho

lone fog
#

You would need the server mod to say “hey, activate this resource pack”

naive goblet
#

If you’re on Forge anyways

acoustic jacinth
#

So translater: He seid that skript: "Script is supposed to die mangy and alone at the station zoo. It's so so bad."

lone fog
#

And the client mod to find it and enable it

lone fog
#

I mean yes it would be cool

#

But what do you do if they don’t have it installed

acoustic jacinth
#

so i make anticheat skript and make premium?

frigid ember
#

yes then u make lots of money

acoustic jacinth
#

i will see... im sleeping now

balmy sentinel
#

@acoustic jacinth read this entirely. I can guarantee whatever you're going to code won't meet these standards. I'm not trying to be mean, but you're clearly new to this and nothing you code will be up to par with a premium resource. You need to learn more java, and learn more about the Spigot API. https://www.spigotmc.org/threads/premium-resource-guidelines.31667/

frigid ember
#

just kidding, dont do that, i was joking

hybrid path
#

The current minecraft server won't allow for a dynamic resourcepack switcher I think.
Isn't it currently that whenever you enter a dimension for a server you can be promted with a resource pack but never just randomly? Or can a server just randomly tell the client they should switch to some resource pack?

ionic hound
#

I am getting the error java: cannot find symbol. and it points to this line
inv.setItem(11, new ItemStackUtil(Material.DIAMOND).setName("Click").buildItem()); how do i fix this?

balmy sentinel
#

?paste

worldly heathBOT
balmy sentinel
#

you need to give us more than that. (full error and classes involved)

median terrace
#

@hybrid path
so say someone goes to nether, or another dimension/age

lone fog
#

You can randomly tell the client to switch

median terrace
#

i want it to load a different rp

lone fog
#

But only to the single one set in server.properties

hybrid path
#

Ah ok

ionic hound
#

Error:(33,33) java: cannot find symbol

median terrace
#

someone goes from say pokemon red world to spirited away world then errrr

#

it just dont look good

lone fog
#

So use a bungee network

median terrace
#

whats that?

lone fog
#

And give each server a separate resource pack

#

Link multiple servers together

median terrace
#

i have about 30 worlds

#

would that be a problem?

lone fog
#

Oh god

#

How does that even run reasonably

median terrace
#

myst

#

its so gud

balmy sentinel
#

@ionic hound what are you trying to do?

median terrace
#

so

ionic hound
#

make a gui@balmy sentinel

lone fog
#

I don’t see an import for ItemStackUtil

median terrace
#

say one person goes from a pokemon red world to a spirited away world using myst, works great, but if i was using the rp to make pokemon world look right, then when player changes to spirited away world itl look like poop until the player manually goes and fixes rp order and load/unload, i want this to happen automaticly on each world entry.

lone fog
#

Get a custom mod made

#

Or make a different server for each world

median terrace
#

oh okay, where do i start?

lone fog
#

With which one

median terrace
#

with the best way?

balmy sentinel
#
public Inventory myInv() {
  Inventory inv = Bukkit.createInventory(null, 54, "My Inventory");
  
  //set items 

  return inv;
}

@ionic hound do something like this and then if you want to open the GUI do player.openInventory(myInv());

lone fog
#

I mean I would say a server for each would run the best

#

But it would not be cheap

median terrace
#

my server is just a machine sittin in the corner of my room, you dont mean to go buy more like 30 more pcs do you?

lone fog
#

Unless that one can run all 30

#

Which is... doubtful

median terrace
#

no way

#

i think theres a misunderstanding, and im explaining things bad

#

im trying to do waht that guy in the reddit link i sent is trying to do.

lone fog
#

I’m aware

#

If you don’t want to make separate servers find someone to make a mod

stoic shell
#

hey is there a way to figure out what plugin is messing with scoreboards?

median terrace
#

buying 30-50 machines seems

#

overkill solution

lone fog
#

I mean you can run multiple pet machine

#

But I digress

stoic shell
#

a plugin that has been working for weeks now all of a sudden throws null pointer exceptions when getting a scoreboard team during a PlayerMoveEvent