#help-development

1 messages · Page 1593 of 1

granite stirrup
#

im not 8

quaint mantle
#

Saying “no” repeatedly makes you seem 8

ivory sleet
#

Jfc

granite stirrup
#

im saying no cuz you saying im 8 lmao

#

and im not 8

#

im older than my brother and hes 11 lol

next stratus
#

I don't know why there's an underage discord user allowed in here.

eternal night
#

pinnacle of spigot development channels once more

ivory sleet
#

You have no solid proof of his age tho

next stratus
#

His attitude and spelling can tell enough

ivory sleet
#

That’s still not what I would define as evidence

granite stirrup
tame coral
#

Guys we like don't care about one's age, if they're doing something wrong just tell them

next stratus
ivory sleet
#

Anyways moving, keep useless debates like those away from this channel

#

and idkidk ftr just ignore

granite stirrup
#

conclure what do i do with a domain i have for a year

#

like minehut lool

#

i seen people gotten banned for lying about being underaged

ivory sleet
#

If you’re going to continue, use #general at least

next stratus
#

I wish the rules here were more strict.

ivory sleet
#

It does tho

quaint mantle
granite stirrup
ivory sleet
#

?kick @mental girder trolling

undone axleBOT
#

Done. That felt good.

granite stirrup
#

lol

opal juniper
#

bruhh

next stratus
#

worlds fastest rejoin?

quaint mantle
#

Rude conclure smh

granite stirrup
#

why does your new discord thing have lugi cap

opal juniper
#
vector = new Vector(1,0,0).normalize().multiply(16);
drone.setVelocity(vector);

what am i missing??

ivory sleet
#

I’m not going to argue over this

opal juniper
#

it doesn't do anything though lmao

#

let me check

granite stirrup
#

gravity ?

opal juniper
#
ArmorStand armorStand = (ArmorStand) start.getWorld().spawnEntity(startLocation, EntityType.ARMOR_STAND);
armorStand.setGravity(false);
armorStand.setVisible(false);
armorStand.getEquipment().setHelmet(new ItemStack(Material.JUNGLE_PRESSURE_PLATE));
#

i did cancel gravity

severe marsh
#

Whenever I try using Color.PURPLE + "string" I get following output: https://prnt.sc/1f88suh. How do I actually make it work?

opal juniper
#

how can i make it float then 😩

granite stirrup
#

then how can /tp bypass it?

opal juniper
granite stirrup
#

oh

severe marsh
chrome beacon
#

Yes

opal juniper
#

vector = new Vector(1,0,0).normalize().multiply(16); this moves it a lot more than 16 blocks

severe marsh
#

aight ty

granite stirrup
#

im pretty sure ChatColor is from the bungee api but spigot has it as well

chrome beacon
#

Spigot has both

#

Bungee and Bukkit ChatColor

opal juniper
#

lmao when i said at the start "how can i move something with a vector 16 blocks" i assumed you meant it would move 16 blocks and stop

granite stirrup
#

oh didnt know that

opal juniper
#

yeah could do

#

DRONES

#

hehehehe

#

😳

#

ummm

#

just the desert

hybrid spoke
#

hopefully just in minecraft

eternal oxide
#

Government using minecraft to design drone AI now

#

When he starts asking how to detect a person in an image we get worried

hardy pivot
#

Anyone knows a tool for see our plugin performance?

hybrid spoke
#

shoot if it moves

#

simple

opal juniper
hybrid spoke
#

camera shake causes nuclear bomb

quaint mantle
#

Can I find out if there is a certain block in the distance between locations?

eternal oxide
#

raytrace

quaint mantle
#

Location.getBlock().raytrace, right?

eternal oxide
#

More options under World#raytrace

spark escarp
#

does anyone know how velocity works and how much I sould put in a custom bow

#

oh

opal juniper
#

Bukkit.getScheduler().runTaskTimerAsynchronously(this.plugin, () -> {});

I forget, but how do i cancel a task like this from within the lambda, or can i not?

spark escarp
#

so like how much does a normal bo have

opal juniper
#

hmm

maiden briar
#

I already try for 5 hours to create a simple scoreboard, but showing? No way

opal juniper
#

ok

#
double distance = pivotPoint.distance(drone.getLocation());
drone.setVelocity(new Vector(1,0,0).multiply(distance).normalize());
if (distance == 0) cancel();

this obviously dont work cause it just overshoots and then keeps going. what is the best way to do this

#

i feel like i should be getting the x difference

#

rather than using the method

#

but something like this:
double distance = pivotPoint.getX() - drone.getLocation().getX();
causes it to oscillate

quaint mantle
#

How do I create an inventory instance.

eternal oxide
#

Your inventory IS an instance

quaint mantle
#

I don't need someone frustrated telling me if I'm competent or not to learn and do.

#

This channel was made to help, instead of judging people, it could help and encourage them

quaint mantle
#

Learn the basics first then make a plug-in so you actually know what you’re doing when someone gives you help

hardy swan
#

Maybe he is trying to learn through making plugins, which can work imo

quaint mantle
#

That’s a terrible idea imo, just making things harder then they need to be. That’s like trying to speak a foreign language without knowing any basic concepts

hardy swan
#

i mean you have to start somewhere

quaint mantle
#

Yes with the basics

hardy swan
#

I think plugins can be pretty basic XD

#

how basic is basic

vital ridge
#

For some reason my MySQL plugin crashes other MySQL plugins when enabled on server. I dont exactly know what code to send but I have this error:

[08:28:52 ERROR]: [EssentialsMysqlStorage] Could not connect to mysql database! Error: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
[08:28:55 WARN]: [EssentialsMysqlStorage] Database connection failed. Reconnecting...
[08:28:55 INFO]: [EssentialsMysqlStorage] Connecting to the database...
[08:28:56 ERROR]: [EssentialsMysqlStorage] Could not connect to mysql database! Error: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
[08:28:56 INFO]: UUID of player Nuxoria is 66791ac2-c73d-4d04-a738-7506a4b028f2
[08:28:56 INFO]: Nuxoria lost connection: Disconnected
[08:28:59 ERROR]: [EssentialsMysqlStorage] Could not connect to mysql database! Error: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
quaint mantle
# hardy swan how basic is basic

Basic fucking programming in a language, that’s how basic. If it’s plug-in that teaches you different things the spigot api can do, or that teaches you basic Java concepts, sure that’s a great place to start.

maiden briar
round finch
#

i want to send a fake Item packet to client in Shield Slot without changing the item on the server
is that possible?

eternal night
#

ClientboundSetEquipmentPacket does what you want

round finch
vital ridge
round finch
#

?

eternal night
#

oh you want to change the players own inventory using packets ?

round finch
#

yes

#

only in shield slot

#

i want to place a fake book

eternal night
#

ClientboundContainerSetSlotPacket is your packet then

round finch
#

and still allow players to use shield

eternal night
#

an example of its usage can be found in CraftInventoryPlayer:113

topaz moon
vital ridge
topaz moon
#

for example

#

yes

round finch
eternal night
#

checkout how it is used in the example linked

#

probably easiest for you

#

tho note, this might (idk how the client handles it) reallly screw over the client

round finch
#

is it default spigot? or do i need some external api?

true perch
#

Kind of new to java, I'm trying to get the instance of an object. The Object reference is made when a command is executed, and I'm trying to get that instance within an event. What can I do to get the reference?

eternal night
#

it is just NMS and craftbukkit

round finch
hard socket
topaz moon
#

?paste

undone axleBOT
topaz moon
hard socket
#

ok

#

ty

#

?paste

undone axleBOT
true perch
eternal oxide
#

A Field is a java Class scope variable

topaz moon
hard socket
true perch
#

Yeah but when I store it, how do I get it to the click event?

eternal oxide
#

You said you got it IN a click event and want to access it

hard socket
eternal oxide
#

however no matter, you access the field

true perch
#

I rewrote it, sorry I didn't type it very wellthe first time

eternal oxide
#

google getters and setters

topaz moon
hard socket
#

plz

topaz moon
#

idk, run it and you'll see

quaint mantle
vital ridge
#

Here is MySQL class.

true perch
#

Let's say I store the reference after the command runs. I also put a getter within the command's Class. I'm just confused as to how the click event will be able to use the getter to get the correct instance

topaz moon
true perch
# hybrid spoke what are you trying to do

Making an item GUI which a player can flip from page to page. It works perfectly fine until another player tries to look at each page at the same time. I made all my variables static initially which is the cause of the problem, so I'm just confused as to how I can make instances which don't require static so I don't run into that problem again

hybrid spoke
topaz moon
eternal oxide
hybrid spoke
#

each player should have its own inventory ig

quaint mantle
true perch
round finch
eternal night
#

you are using mojang mappings right ?

topaz moon
#

@vital ridge where are the error messages from?

#

[08:28:52 ERROR]: [EssentialsMysqlStorage] Could not connect to mysql database! Error: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

#

we probably need to see these lines

vital ridge
topaz moon
#

Because "could not connect to mysql database!" is no helpful error message

vital ridge
#

Yeah I see you

heavy mason
eternal night
#

normal gradle shadow plugin o.O

granite stirrup
#

wtf so i can connect to a mc server with my ip on my domain but when i try to ping my domain it shows my ip but it cant make requests to it

#

xd

topaz moon
#

wait what

#

you can ping your domain but not the ip behind the domain?

#

or wdym

spark escarp
#

does anyone know how to put a cooldown on a custom item

#

i have a package called like itemmanager

tepid monolith
#

how to get access to a command argument (a player argument) in another class?

granite stirrup
#

i pinged the domain

#

it gave nothing

spark escarp
#

but it wont accept that it wants a Material.blahblah

granite stirrup
#

but i can join with play.my.domain

eternal night
#

how did you get that IP ?

granite stirrup
topaz moon
round finch
granite stirrup
eternal night
#

you can't ping your public IP ? xD

granite stirrup
#

its .tk though

topaz moon
#

you just posted a screenshot of the ip

quaint mantle
#

imagine Skript

spark escarp
#

everyone ddos this man

#

jk

eternal night
spark escarp
#

dont ban me please

topaz moon
granite stirrup
spark escarp
#

lol

granite stirrup
#

ah shit

topaz moon
#

????

granite stirrup
#

didnt notice it

#

;-;

topaz moon
#

ping statistics for:

#

wow

eternal oxide
#

many routers/modems disable ping

topaz moon
#

pm me the domain

#

I got the ip anyways

#

lol

eternal night
#

Yes then you aren't using mojang mappings ?

topaz moon
#

and am curious about the problem

granite stirrup
#

for some reason i cant ping my public ip

#

weird

round finch
#

excuse my dumpster fire

eternal night
#

how are you defining your spigot maven/gradle dependency

topaz moon
round finch
#

i just added it using external jar

eternal night
#

oh god

spark escarp
#

hey, does anyone know how to set a cooldown for a custom item, I have a package with all my items called ItemManager, but it doesnt accept that it only wants Material.poop or something

eternal night
#

well I have no idea what the names are

spark escarp
#

or is there a plugin

eternal night
#

for runtime

topaz moon
#

so you tell me you can ping the domain which points to the ip you cannot ping?

round finch
#

i should i make a maven project?

topaz moon
#

@granite stirrup

granite stirrup
#

arent the method names when using the obfusticated nms a and shit?

granite stirrup
eternal night
#

Yea

eternal night
#

they are pretty much random characters

quaint mantle
granite stirrup
granite stirrup
round finch
#

confusion

quaint mantle
#

What is the best method to check inventory instances?

#

I'm using if currently.

#

😋

quaint mantle
hardy swan
#

ok i get your frustrations now

granite stirrup
#

how can i join something that i cant ping btw

topaz moon
round finch
#

wait isn't the holder the holder itself?

quaint mantle
round finch
#

like donkeys and etc

granite stirrup
#

pretty sure mine used to idk why it isnt now

quaint mantle
topaz moon
quaint mantle
#

Oh yes, I get it.

#

thanks

granite stirrup
#

its my public...

topaz moon
granite stirrup
quaint mantle
#

^

vital ridge
#

but other MySQL plugins spit out Too many connections

#

and couldnt enable

hardy swan
#

@quaint mantle you should try understanding what == does

topaz moon
#

Your router does not respond to pings then. The last respond I get is probably from your provider @granite stirrup

quaint mantle
eternal oxide
vital ridge
eternal oxide
#

make less?

granite stirrup
#

im pulling a all nighter

#

its too late to sleep now

vital ridge
#

But how?

granite stirrup
#

its 15:22

#

its morning

eternal oxide
#

No clue as you don;t know how many you are making

granite stirrup
#

it was night before

#

oh afternoon

vital ridge
#

Whatsu mean making tho?

granite stirrup
#

sorry havent slept

vital ridge
#

like in code?

serene agate
#

hi, is there a main spigot development server? or is this it

eternal oxide
#

Yes in code. It sounds like you are maxing out your SQL servers connections

quaint mantle
serene agate
#

oh ok

vital ridge
#

I dont understand how I'm creating that many connections

true perch
#

I stored an object reference after a command is run and I'm trying to use the command's getter to retrieve the reference within a click event. How can I go about doing that?

Command:

private ItemGUI gui;
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
    Player player = (Player)commandSender;
    gui = new ItemGUI(player,1);
}
public ItemGUI getGui() {
    return gui;
}```
**Event:**
```java
@EventHandler
public void clickEvent(InventoryClickEvent e){
    Player player = (Player) e.getWhoClicked();
    
    ItemGUI gui = ItemGUI.getGUI();
    
    if (e.getClickedInventory().equals(gui)){
        e.setCancelled(true);
    }
}```
eternal oxide
#

Thats a lot of connections, just for your plugin

#

try 2 to 3

onyx basin
#

Only for me this method does nothing?

eternal oxide
#

chests etc

opal juniper
#

Is there like

#

A limit to the multiple for a vector

eternal oxide
#

not really

opal juniper
#

Hmm

eternal oxide
#

other than max double

opal juniper
#

I keep getting this x must be finite error

#

Wel

#

Yeah I know what it means

eternal oxide
#

perhaps lead with the error, then some code?

opal juniper
#

Sorry yeah, I just went out for a walk

#

So no code

#

But I just wondered if that was the issue

#

Fair enough

eternal oxide
#

teh simplest way to get a non zero vector is a Location.getDirection().normalize()

opal juniper
#

I think I was normalising 0,1,0 and then multiplying

#

Don’t ask why

#

I’m stoopid

#

Yep

#

Will do

#

Also

#

I am doing the thing where I multiply the vector by the distance required in a runnable, so that it decelerates and stuff

#

But what sorta thing should I do when the distance is really far

#

Should I just add an upper bound?

#

Yeah, the normalise I realise now was useless

eternal oxide
#

b y normalizing you are limiting the upper bounds to 1 block per tick

opal juniper
#

Yeah the normalise was before I multiplied so it didn’t do shit 🤦‍♂️

#

But

#

If there is a distance of 2000 blocks, that is gonna go at 2000 blocks / second right?

#

Yeah

#

Mistyped

#

Ok…

#

Right ok

#

I mean I just take the two absolute x values and subtract them atm

#

Nope

#

I have it to do the x axis first and then the z

#

Which is just a proof of concept

eternal oxide
#

why? just use a proper vector

opal juniper
#

Cause it was easier for my monkey brain to understand lmao

#

But yeah

eternal oxide
#

use teh direction vector, normalize, multiply by however many blocks (capped)

opal juniper
#

Myeah, lemme look when I get back

eternal oxide
#

?paste

undone axleBOT
eternal oxide
round finch
#

ClientboundContainerSetSlotPacket isn't showing for me

eternal oxide
#

length not so much

round finch
#

is ClientboundContainerSetSlotPacket changed?

maiden briar
#
private final Map<Integer, Component> lines = new HashMap<>();
private final List<Team> teams = new ArrayList<>();

public interface Team
{
    String getName();

    Component getPrefix();

    List<Player> getPlayers();
}

public void apply(Player player)
    {
        System.out.println("Applying " + lines + " and teams " + teams);

        org.bukkit.scoreboard.Scoreboard scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();
        Objective mainBoard = scoreboard.registerNewObjective("board", "dummy", displayName.toLegacyText());

        for(Map.Entry<Integer, Component> line : this.lines.entrySet())
            mainBoard.getScore(line.getValue().toLegacyText()).setScore(line.getKey());

        for(Team team : this.teams)
        {
            org.bukkit.scoreboard.Team scoreTeam = scoreboard.registerNewTeam(team.getName());
            scoreTeam.setPrefix(team.getPrefix().toLegacyText());

            for(me.tvhee.tvheeapi.api.player.Player teamPlayer : team.getPlayers())
                scoreTeam.addEntry(teamPlayer.getName());
        }

        System.out.println(scoreboard);
        player.setScoreboard(scoreboard);
    }

What am I doing wrong here?

eternal oxide
#

not using paste

maiden briar
maiden briar
# maiden briar https://paste.md-5.net/atezitotuf.cs

This is the print btw: Applying {1=Component{text='&aTest1', center=false, prefixed=false}, 2=Component{text='&bTest2', center=false, prefixed=false}} and teams [runner, hunter, spectator] (toString returns the name)

dense goblet
#

Is there a way to check if a block can support another block (i.e. sign, torch, etc)

quiet ice
#

does facing matter?

dense goblet
#

ig it depends since for the case of a sign it would be more permissive than torch

#

I have the facing

#

it does matter

quiet ice
#

then idk

dense goblet
#

hm

#

guess I can do without it

eternal oxide
#

Not sure about that. There is the isOccluding for light now

#

so it should pass on isSolid

pliant flame
#

is mysql or mongodb better

ivory sleet
#

They’re kind of made for different things

#

But Idk people tend to use them for things they might not have been intended for initially

stray garnet
#

re: Potion Brewing... Is there a way to get the potion just brewed? The BrewEvent looks to return the state of the brewing stand before the brew (so potions e.g. are what was in place before the brewing took place and not the final result)?

pliant flame
#

Well

#

what about for storing classes for an MMORPG like Wynncraft

tepid monolith
#

how to get access to a command argument (a player argument) from another class?

pliant flame
#

like rpg classes

eternal night
#

mongodb (or noSQL) can scale a lot better

#

besides that, well it is a bit more on you to maintain structure in NoSQL

#

^^

eternal oxide
stray garnet
eternal oxide
#

Not to my knowledge

stray garnet
#

huh. odd. Well... I suspose I could just create a map and infer based on the state before the brew started, but admit that seems a bit strange. Thanks for confirming in any case.

eternal oxide
#

Well if the event fires then you know it brewed something. Check those three slots, but still can;t tell which

stray garnet
#

I'm seeing that those three slots return the input to the event vs. the output of the event. e.g.:

given a water in the slot[0] and wart as the ingredent, the BrewEvent returns 'Water' as being in slot[0] whereas I would have expected 'akward-potion' or soemthing like that.

smoky oak
#

0.14 > (1/3)
Why does that return 'true'...

stray garnet
#

Ya - looks like it is storing the state of the brewing stand at the start vs. at the end. The event itself fires once its cmplete from what I can tell.

eternal oxide
#

yep, odd you can;t get the result though

#

best you can do is store the inventory IN the event and trigger a task 1 tick later to compare that to the new inventory

stray garnet
#

Ya - saw a code sample where code was queue'ing an async task to run, which appeared to do sometihng like that. now I know why 🙂

smoky oak
#
Double ed = Math.random();
if(ed > (1/spawners)){
    s.remove();    
    Bukkit.getLogger().log(Level.INFO,ed+" "+spawners);
    return;
}```
and it says 0.14 / 3. I'm not the best at math, but even I know that 0.14 is not bigger than 1/3.
#

why is it still triggered

#

wait is that a bit operator

#

the log message is in the if

#

ergo

quiet ice
#

it has brackets

#

The identation might be trash, but java does not care about identation

smoky oak
#

issue still stands

#

aaaah

#

or just do 1.0 / spawners?

#

k thanks

dense goblet
#

How do I get if a banner is a wall banner or standing banner and how do I get the orientation of it?

#

the api for it is different than for signs

quiet ice
#

((Orientable) block.getBlockData()).getOrientation()
Or somethin like this

stray garnet
dense goblet
#

it doesnt have orientation or facing

#

it is just a TileState with colour stuff

#

no directional

quiet ice
#

Then Orientable

dense goblet
#

nope

#

only TileState

#

no interfaces

#

where do I check what type the block data is

quiet ice
#

Just do ((Orientable) block.getBlockData())

#

Perhaps do an instanceof before that

dense goblet
#

bruh ok lol

quiet ice
#

There is no Banner blockdata

dense goblet
#

is it a BannerMeta?

#

thats just items right

#

man banners are implemented weird

#

also doesn't help that the BlockDropItem event is broken, so you can't easily stop (or detect) supported blocks from breaking

#

ok

#

I'll try Orientable

quiet ice
#

That or Directional

dense goblet
#

Orientable makes more sense cause it's more similar to a lever in that it can be placed on wall/floor and rotated around the up axis

quiet ice
#

What about the Wall variant?

dense goblet
#

weird that they decided to implement it as two classes for signs but as one class for banners in the API

tepid monolith
quiet ice
#

Well, Directional is only in 90° Angles

tepid monolith
#

oops ignore the weird domain/embed

dense goblet
#

yea but not in API

dense goblet
#

yea

tepid monolith
quiet ice
#

for blockdata, anyway
blockdata or blockstate?

dense goblet
#

they should fix banners and block popping off events

tepid monolith
quiet ice
#

hm, complicated

dense goblet
#

bukkit way makes more sense semantically imo

quiet ice
#

that is only because you are aquainted to it

dense goblet
#

but still yeah why do they swap it

#

hm true

round finch
#

i used InventoryOpenEvent

but it doesn't do anything then i press e

#

what is my mistake?

#

it works then i open chest..

paper geyser
#

does player.getInventory().contains include the chest they have open?

quiet ice
#

is there even a packet that is sent in this instance?

round finch
#

if (e.getInventory() == e.getPlayer().getInventory()) {

}
this is what i'm trying

paper geyser
paper geyser
round finch
rotund pond
#

Hello everyone !

Sorry if I'm bothering, I need a little help with the Spigot API.

I created a custom GUI, and to do this I created a "BmGUI" object and implemented the InventoryHolder interface.
In my listener, when I check if the interface is indeed an instance of the custom inventory, it returns false ...

Why ?
Is there something I don't understand ?

smoky finch
#

I'm not sure if this is a bug or not but spawning a simple armorstand with arms, and right-clicking on its head with an item calls PlayerInteractEvent with LEFT_CLICK_AIR action

#

I tested this in 1.16 too, and it was the same, that's why I'm not sure if it's a bug or not

round finch
#

it clicked AIR block

smoky finch
#

I'm not sure what you're trying to say.

round finch
#

PlayerInteractEntityEvent

smoky finch
#

Armorstand is certainly not a block.

quiet ice
#

basically entities are no considered solid

#

which is why it has to opt in for being air

smoky finch
round finch
#

LEFT_CLICK_AIR = IS AIR BLOCK CLICK

spice sage
#

im trying to my plugin checks for updates and i can't do that it works, i have this, so, i don't see anything incorrect or an error

smoky finch
round finch
#

Armor stand is not a soild block but an entity

smoky finch
#

How does that change the fact that the player right-clicked?

round finch
#

ok lemme what is you want to make?

quiet ice
#

yeah, it is likely a protocol limitation

smoky finch
#

I expect PlayerInteractEvent#getAction() to return RIGHT_CLICK_AIR when right-clicking on an armorstand, not LEFT_CLICK_AIR

eternal oxide
#

ArmorStands have their own interact events too

quiet ice
#

if this is done persistently then it is likely a fuckup at the protocol level - someone would have noticed it well earlier

round finch
#

if you want to click Armorstand use PlayerInteractEntityEvent

#

getClicked Entity

#

you add Action to click for right or left

eternal oxide
smoky finch
#

How do I handle left-clicks PlayerInteractEntityEvent?

round finch
#

if(e.getClickedEntity instance of ArmorStand){

ArmorStand Armorstand (ArmorStand)e.getClickedEntity

}

#

one sec

quiet ice
#

Damage event

round finch
#

i gotta write it out in my IDE

smoky finch
#

what if the armorstand is invulnerable? Would it still work?

quiet ice
#

Donno, likely but just in a cancelled state?

#

A good question though

smoky finch
#

I'll try it

eternal oxide
#

or FinalDamage will be zero

round finch
#

invulnerable then it can't take damage

#

but players in creative can still remove it

#

i think...

quiet ice
#

yes, but it'll still somehow emit some kind of event even for normal players

#

invulnerability isn't sent to the client after all (I think)

round finch
#

these 2
you need
Left Click? onEntityDamageByEntity
Right Click? PlayerInteractEntityEvent

smoky finch
#

geol was right, it emits the event in a cancelled state

#

Yeah, I think I can get things working with these two events.

#

I'll still report this to md5 if I saw him around just in case

#

thanks everyone :>

paper geyser
#

so my code is an atrocity

#

i was wondering if someone could lead me in the direction to fix the bugs noted

#

if this is too close to spoon feeding thats alright no worries but i was just curious as i have no clue what to do

quiet ice
#

inventory.setItem(6, new ItemStack(Material.AIR)); /// Can the way this is performed be optimized?
For loop can do it, though this would be less performant I guess

paper geyser
#

ahhh

smoky finch
#

I'm pretty sure setting it null works just fine

quiet ice
paper geyser
#

which part?

#

oh no

#

its a custom crafting system

quiet ice
#

ah

quiet ice
paper geyser
#

bc i dont know another way of doing it haha

quiet ice
#

if (event.getInventory().getItem(10) == new ItemStack(Material.AIR)) { // This check doesn't work
This will never work because == is instance comparision

paper geyser
#

ahhh

#

but it wants me to input a boolean

#

so ig im formatting it wrong

quiet ice
#

better do getItem().getMaterial() == Material.AIR or getMaterial().isAir()

paper geyser
#

oh-

quiet ice
#

make sure to properly null check it though, getItem is nullable

paper geyser
#

ahhh you're right

#

uhh

#

.getMaterial isn't valid

#

"cant resolve GetMaterial() in ItemStack"

#

(event.getInventory().getItem(10).getMaterial() == Material.AIR)

quiet ice
#

Ah, it's getType

paper geyser
#

dude i literally just used getType

#

why didnt i think of that haha

#

ty

round finch
#

@smoky finch i checked it out what you're looking for is PlayerInteractAtEntityEvent

quiet ice
#

did you read the javadoc of that event?

#

It explciitly tells you that it is right clicking only

round finch
#
@EventHandler
    public void EntityArmorClick(PlayerInteractAtEntityEvent e) {
        
    e.getPlayer().sendMessage("You Clicked " + e.getRightClicked().getType());    
    if(e.getRightClicked() instanceof ArmorStand) {    
        
    ArmorStand Armorstand = ((ArmorStand) e.getRightClicked());    
        
    Armorstand.setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
    }
        
        
        
    }
round finch
#

but it would be possible to use EntityDamageEvent maybe

quiet ice
#

Represents an event that is called when a player right clicks an entity that also contains the location where the entity was clicked.
Note that the client may sometimes spuriously send this packet in addition to PlayerInteractEntityEvent. Users are advised to listen to this (parent) class unless specifically required.

#

But bukkit impl has always been really whack, so if it is firing for left clicks I would not be surprised

paper geyser
#

whats the event for when you're placing down an item? InventoryClickEvent only triggers when you pick up the item

#

ive been searching but the only thing that comes up is InventoryClickEvent

#

yup

#

doesn't trigger when placing an item

#

uhh?

quiet ice
#

It should

paper geyser
#

then i've done something wrong

#

its only updating the gui if i put the item in the slot then pick it up

#

here i'll record a video

#

bc idk if im explaining it right

#

1 sec

real spear
#

Why is spigot so difficult when it comes to trying to use other APIs? Trying to make a discord bot linked to my mc server and keep getting this error: https://hastebin.de/viqugozoxo.csharp

quiet ice
#

That's a known classloading issue that I do not know how to solve

quiet ice
#

The classloader in general LOVES to waste your time

real spear
quiet ice
#

are you using the new shiny library feature of spigot or nah?

paper geyser
#

OH

#

thats not the updated code

#

sorrt

serene agate
#
    public static void onCreatureSpawn(CreatureSpawnEvent event) {
        if (event.getEntityType() == EntityType.CREEPER) {
            Creeper creeper = (Creeper) event.getEntity();
            
        }

    }
real spear
quiet ice
#

I already told that

paper geyser
#

yeah sorry my bad

serene agate
paper geyser
#

this is updated code with check for null and no ==

quiet ice
#

if (event.getInventory().getItem(10).getType().equals(null)) {}
reeeee

paper geyser
#

on this episode of "learning about sins by commiting them"

quiet ice
#

1.) Empty if block
2.)Use == to compare null

paper geyser
#

is .equals also ==

quiet ice
#

no

paper geyser
#

OH

real spear
paper geyser
#

I MISREAD

#

I thought I read "dont use =="

#

i was like "wait im not though"

quiet ice
#

.equals will have the effect but looks less clean when doing .equals(null)

paper geyser
#

oh so its fine just like "this is better"

quiet ice
#

plus it can (not saying that it will) produce NPEs if the API is written badly

paper geyser
#

ahhh alright

serene agate
#

can i have my server continue running and update it with changes to the plugin at the same time??

quiet ice
#

not always, but yes, usually it will

#

You can override the equal method to do whacky shit, but in this instance it'll do an instanceof beforehand which will sort this out

paper geyser
#

"if it works then you've got bigger issues" basically

quiet ice
#

event.getInventory().getItem(10).getType() == null
This will produce an NPE if getItem is null. do event.getInventory().getItem(10) == null instead

paper geyser
#

alright!

quiet ice
#

Plus it can never be null, because getType is NotNull

#

(getItem can be however)

paper geyser
#

ahhh

quiet ice
#

yea

#

This is an artifact of minecraft history as I think up until 1.6.x empty items used to be null internally

paper viper
#

IIRC in the Bukkit code, they actually do set to null always (like for example if you set it to air the slot will be null)

spice sage
#

i need help to fix it, i don't know why it doesn't work properly

quiet ice
#

now 11 major versions later we will still have to deal with the pain of it

paper geyser
#

i am the curse that brought this upon you /j

round finch
#

what my problem
i use InventoryOpenEvent
but nothing happens then i press e

quiet ice
#

Bukkit in a nutshell is "after having been written in minecraft beta 1.6, this class was not changed due to backwards compat"

#

that being said, I do support backwards compat. It's such a nice thing to have as a developer.
Until 99% of the code is abruptly changed

quiet ice
#

there is no event afaik

paper geyser
#

^

#

this person uses packets

#
            @Override
            public void onPacketReceiving(PacketEvent event){
                if(event.getPacket().getClientCommands().read(0) == EnumWrappers.ClientCommand.OPEN_INVENTORY_ACHIEVEMENT){
                    Player player = event.getPlayer();
                    //Do something                
                }
            }
        });```
#

super clever usage

#

no clue what it means

#

wait

#

im so used to just saying that i do understand what it means

trail flume
#

When I add bStats to my plugin, I get this: java.lang.IllegalStateException: bStats Metrics class has not been relocated correctly!. Any ideas? Ping me if you can help.

trail flume
quiet ice
#

Good.

trail flume
#

i hate gradle

serene agate
#

how do i spawn a mob on a horse?

#

what method

paper geyser
#

I

quiet ice
#

just don't use the snapshot version but the latest stable one

iron condor
#

how can I setup bossbap par player so I can just access the active boss bar of a particular player and hide it?

quiet ice
#

Really?

trail flume
#

I have the classes.

quiet ice
#

oh, you copy & pasted the classes?

trail flume
#

No, I used maven and I can import the classes fine.

#

No import errors.

paper geyser
#

is there an alternative to InventoryCreativeEvent for survival? it has putting down an item in their inventory unlike InventoryClickEvent

This event is called when a player in creative mode puts down or picks up an item in their inventory / hotbar and when they drop items from their Inventory while in creative mode.
lunar moat
#

Hi guys. I'm trying to cancel the InventoryClickEvent when a player moves an item in the inventory using the numeric keys. I want to cancel this event when a player puts his cursor in an empty slot and presses the item slot button (1-9). I tried this, but it doesn't work. Any suggestions?

quiet ice
#

but did you actually shade relocate them?

trail flume
quiet ice
#

Then what the hell caused the issue?

#

not shaded = no classes = CNFE

trail flume
#

I have no idea.

trail flume
iron condor
lunar moat
#

kek

#

I'm so dumb

#

srry

paper geyser
#

uh

#

guys

iron condor
#

I know, telling for future problems

quiet ice
trail flume
#

confused

paper geyser
quiet ice
#

You either copy & pasted the files or you shaded in the classes

paper geyser
#

it's just (e.g.

quiet ice
#

If you did neither you would get a ClassDefNotFoundError/ClassNotFoundException

trail flume
#

idk

quiet ice
#

Just show me your pom

#

via the library feature?

trail flume
#

no i chose where to import from

#

i use intellij

quiet ice
#

^

#

PASTE. IT.

trail flume
#

WAIT

#

It there a delay in the stats going to the bStats website because the error went away? Again please ping me.

paper geyser
#

dude

#

paste your code

trail flume
#

rude

#

i fixed the error

#

but

#

its not appearing on the bstats website

lusty cipher
#

uhh??? what?

        if (args.length <= 1) {
            List<String> list = Arrays.asList("settings");
            if (sender.isOp()) {
                list.add("update");
            }
            return list;
        }

Arrays.asList is a ArrayList btw

paper geyser
#

so InventoryClickEvent should definetly be applying when I put down an item in my inventory

lusty cipher
#

oh true, lol

paper geyser
lusty cipher
#

yeah that makes sense then

eternal oxide
#

You can;t add to that list when op

#

late to the party

lusty cipher
#

yup

hollow sapphire
#

Someone, knows how to unload chunks with packets on mc 1.8 (R3)?

opal juniper
#

shroomster

#

or ElgarL

#

how do you think i should deal with the elevation changes?

eternal oxide
#

do you mean as its flying to go over terrain?

opal juniper
#

yeah

#

so it doesn't hit a wall

eternal oxide
#

more complicated

opal juniper
#

I saw a video by the guys that made satisfactory yesterday and they did it essentially by chunk they had a height that their drones could fly over

eternal oxide
#

you would need to raytrace from yoru current position, to yoru destination

#

if you hit a block then either go over or around

opal juniper
#

hmm yeah that could work,
raytrace
if block hit ->
fly over it

opal juniper
#

im not too sure on how to get the going up/ down to be smooth

#

maybe just using smaller vectors

trail flume
opal juniper
#

Yeah

#

It will

quiet ice
#

sometimes less, sometimes more, bstats updates every half an hour (more or less) which is why you will see a delay

trail flume
#

ok pog because i thought i had still done something wrong

eternal oxide
quiet ice
#

You can enable debug mode in the bstats config to see more info

trail flume
#

ill wait for now

iron condor
#

How can I stop from the public void run() {} ?

lusty cipher
#

just return based on a condition?

iron condor
#

like so

  public void run() {
        waitTime -= 1;


        if (waitTime == 0){
              stop();

              }
#

return is enough?

lusty cipher
#

yes? just like in every other function

#

it will stop the execution of the rest

iron condor
#

but the function is repeating

quiet ice
#

What are you implementing?

iron condor
#

countdown

#

for teleportation

quiet ice
#

No, what class/interface?

iron condor
#

scheduleSyncRepeatingTask

quiet ice
#

That is not a Class nor an Interface

iron condor
#
 Integer task = Bukkit.getScheduler().scheduleSyncRepeatingTask(warpSystem, new Runnable() {

                            Integer waitTime = tpaWaitTime;
                            Integer progress = tpaWaitTime / waitTime;


                            @Override
                            public void run() {
                                waitTime -= 1;

                                updateTpaBar(playerToTp)

                                if (waitTime == 0){
                                    playerToTp.teleport(player.getLocation());

                                }

                            }
                        },0,20);
#

full thing

quiet ice
#

Well, now we are getting somewhere

#

Implement Consumer<BukkitTask> instead

#

would look something like

                        Bukkit.getScheduler().scheduleSyncRepeatingTask(warpSystem, new Consumer<BukkitTask>() {
                            Integer waitTime = tpaWaitTime;
                            Integer progress = tpaWaitTime / waitTime;
                            @Override
                            public void accept(BukkitTask task) {
                                waitTime -= 1;
                                updateTpaBar(playerToTp)
                                if (waitTime == 0){
                                    task.cancel();
                                    playerToTp.teleport(player.getLocation());
                                }
                            }
                        },0,20);
#

or extend BukkitRunnable

#

Though you wouldn't be able to use the Bukkit scheduler without using deprecated methods, so ...

eternal oxide
#

task.cancel() not stop() is all

quiet ice
#

ah right

eternal oxide
#

and Consumer not supplier 😉

quiet ice
#

right, those do the opposite

#

But hey, at least I got it right before doing the code

eternal oxide
#

yeps

iron condor
#

doesnt let me cancel

#

its an int

eternal oxide
#

?paste your exact code

undone axleBOT
iron condor
#

I did

#

it just inside a command

#

command executer*

eternal oxide
#

You were given new code so yours should have changed

iron condor
#

so I do need to change it?

#

wait

iron condor
#

1 sec

#
 Bukkit.getScheduler().scheduleSyncRepeatingTask(warpSystem, new Consumer<BukkitTask>() {

                            Integer waitTimeLeft = tpaWaitTime;
                            Integer progress = (1 / tpaWaitTime) * waitTimeLeft;


                            @Override
                            public void accept(BukkitTask task) {
                                waitTimeLeft -= 1;

                                updateTpaBar(playerToTp, waitTimeLeft, progress);

                                if (waitTimeLeft == 0){
                                    playerToTp.teleport(player.getLocation());

                                }

                            }
                        },0,20);
#

Cannot resolve method 'scheduleSyncRepeatingTask(me.axilirate.warpsystem.WarpSystem, anonymous org.bukkit.util.Consumer<org.bukkit.scheduler.BukkitTask>, int, int)'

quiet ice
#

why does bukkit have 1000 scheduling methods

eternal oxide
#

change scheduleSyncRepeatingTask to runTaskTimer

iron condor
#

same error

opal juniper
eternal oxide
iron condor
quiet ice
opal juniper
#

And like some return void and some BukkitTask

quiet ice
#

import the java.util.function Consumer instead

eternal oxide
#
        Bukkit.getScheduler().runTaskTimer(this, new Consumer<BukkitTask>() {
            Integer waitTime = tpaWaitTime;
            Integer progress = tpaWaitTime / waitTime;
            @Override
            public void accept(BukkitTask task) {
                waitTime -= 1;
                updateTpaBar(playerToTp)
                if (waitTime == 0){
                    task.cancel();
                    playerToTp.teleport(player.getLocation());
                }
            }
        },0,20);``` Thsi is what I have and no error
quiet ice
#

The org.bukkit.util Consumer is here for idk why

#

it doesn't even extend the Java 8 consumer, so it cannot be for backwards compat reasons

eternal oxide
#

ah I had import java.util.function.Consumer; 🙂

#

which is the correct import

iron condor
#

oh

#

also this here runTaskTimer(this is the main class?

eternal oxide
#

yep, change that to your instance. I only changed it to test

iron condor
#

yep no errors

#

thanks

quaint mantle
#

hey.. any idea whats causing this? it only happens when i use /restart

hasty prawn
#

Try removing/lower the -Xms argument

quaint mantle
#

what is the Xms

hasty prawn
#

It's the initial memory size

#

I'd imagine what's happening is your other server hasn't released all it's memory, so when the new one tries allocating 7GB it can't

quaint mantle
#

ah

kind coral
#

hi guys, i've made a plugin for my server which introduces classes, like warrior and stuff, tho i have some of theese classes having effects and i made a method that applies them to the player. Sadly when the player dies it loses the effects

i've tried using playerrespawnevent with no success, anyone knows how to do?

eternal oxide
#

Delay

#

when the respawn event fires, the player is still dead

kind coral
#

so u think like 3ticks is ok?

hasty prawn
#

That's probably fine

eternal oxide
#

try it and see

#

In your delayed method, get a fresh Player reference from their UID. The current one may be stale

kind coral
#

so using like Bukkit.getPlayer

eternal oxide
#

yep

eternal oxide
#

You need 7smile7 for that. He was playing around with protocol lib and unloading

#

@lost matrix ^

#

if he responds you may be in luck

hollow sapphire
open lily
#

Hi, I'm new to plugin development, and does someone know how can I assign custom variable to player?

eternal oxide
#

Explain your use case as there are multiple ways

open lily
#

I'm making a FreezeCommand, and I would like to mark player as freezed (boolean)

eternal oxide
#

it needs to persist through restarts?

open lily
#

not really

eternal oxide
#

then just put their UUID in a Set

open lily
#

ok

eternal oxide
#

if they are in there, keep them frozen

quaint mantle
#

hey how do i fix this

#

Hello, i'm trying to make a command when i'm clicking into a item in gui
like: item name = Jack
and when i'm clicking on it makes me type
/tp Jack
i have tried to type:
Player target = Bukkit.getPlayerExact(e.getCurrentItem().getItemMeta().getDisplayName());

#

but that does not work

#

can someone help please

hasty prawn
#

@eternal oxide let's say for example he wanted to have a custom player object and attach a frozen Boolean to it. Could you like extend CraftPlayer, or just make your own player object and instantiate with Spigots's Player object or what might be the best way to do that?

hasty prawn
#

I've always kinda wondered what the best way to create a custom Player object would be

#

Oh interesting

#

I really should look into pdc

eternal oxide
#

?pdc

quaint mantle
#

well any one well help me xd?

hasty prawn
#

Thanks

quaint mantle
#

same

#

idk what i did wrong

quaint mantle
#

yes

hasty prawn
quaint mantle
#

ahhhh

hasty prawn
quaint mantle
#

author AND title, okay

#

?paste

undone axleBOT
quaint mantle
hasty prawn
#

CustomLocation#stringToLocation is returning null

vivid temple
#

I used this code

@EventHandler
    public void onDamage(EntityDamageByEntityEvent e){

        if (e.getDamager() instanceof Player){
            if (((Player) e.getDamager()).getItemInUse().equals(ItemManager.spear)){
                e.getDamager().sendMessage(ChatColor.GRAY + "You attacked with a spear! - " + ChatColor.RED + "Admin Tools");
            }
        }

    }

and i used a spear on a mob but nothing got send

hasty prawn
vivid temple
#

but it does double hits...

hasty prawn
#

Wdym it double hits

vivid temple
#

like it sends the messages 2 times

#

with one hit

hasty prawn
#

Maybe try using isSimilar instead of equals? That's good for comparing ItemStacks but idk if it's gonna fix that

open lily
#

What's the name of player attacking event?

hasty prawn
open lily
#

thx

lost matrix
# hollow sapphire ^

I dont think you can force the client to unload chunks in 1.8
Its up to the client to decide when to unload the chunks. But i can take a quick look at the protocol just to be sure.

open lily
lost matrix
hasty prawn
open lily
#

thx

lost matrix
opal juniper
lost matrix
opal juniper
#

i mean, i guess i could just use the method under entity then

#

but yeah cool

lost matrix
#

But i have no idea what you are trying to do XD

opal juniper
#

drones

#

everthing is drones

#

but

#

i need to have some sort of basic object avoidance

#

literally gonna be:
something in way -> go up and try again

eternal oxide
#

the simple formula I showed earlier

opal juniper
#

yep

hasty prawn
opal juniper
#

iirc it takes a range arg

eternal oxide
#

you mean teh getDirection? no

opal juniper
#

nah

#

Entity#rayTraceBlocks()

eternal oxide
#

You should have already ran that, found a blockage, moved up until AIR, then you need to get the vector from source to the new location

opal juniper
#

yeah, i am a little bit behind >< i took a break

eternal oxide
#

basically its...

vague mason
eternal oxide
#
  1. raytrace path to your destination.
  2. If raytrace != null check result for the block you collided with.
  3. check blocks going up until AIR.
  4. get new vector from source to AIR and raytrace.
  5. If result == null fly there.
opal juniper
#

Hmm, the issue is that you may have something like this:

#

cause it doesn't see anything

#

but, it is two blocks tall

vivid temple
#

how do i deal custom damage to a mob from out a different class?

paper geyser
#

anyone know whats up?

quiet ice
#

you still did not do any null checks

#

well, at least not in this instance

paper geyser
#

i have my null check though
if (event.getInventory().getItem(10) == null || event.getInventory().getItem(10).getType().isAir())

quiet ice
#

nyes

#

Depends

#

functionally, it is teh same

#

Just that .isAir is a bit broader so we are going to use that instead

#

Your null check doesn't do anything against checking future null references though

paper geyser
#

oh ok

#

WAIT

#

theres no null checks for if (event.getSlot() == 12 && event.getCurrentItem().isSimilar(new ItemStack(Material.WOODEN_SWORD))) {

#

which is probably the problem-

quiet ice
#

Can you even read stacktraces?

paper geyser
#

barely haha

#

I saw the null error

quiet ice
eternal oxide
opal juniper
#

so

quiet ice
#

Well,
if (event.getInventory().getItem(10).getItemMeta().getDisplayName()
it the error line

opal juniper
quiet ice
#

the line you suggested does not have anything with getItemMeta, so it cannot apply

opal juniper
#

so it don't detect shit to go over

quiet ice
#

(gotta love J15+ NPEs)

paper geyser
#

ahhh

#

I should be reading closer probably haha

#

sorry about that! Im extremely tired and cant sleep cus sleep schedule I promise you wont get these types of questions again

lusty cipher
#

if I player#closeInventory() and then player.openInventory(), how can I make the cursor not reset itself? It's really annoying to always move the mouse back to the GUI after I change the menu.

eternal oxide
hardy pivot
#

Hi anyone knows how to do an countdown but with the characteristic that can be rewrite?
Ej.
/countdown 30
29
28
27
/countdown 30
29
28

paper viper
#

Just use a bukkit runnable and input a variable for the delay?

hardy pivot
#

I mean i want to the variable changes in real time

paper viper
#

If that’s what you want

opal juniper
#

cause say you had an overhang

#

there is no way to get around this unless you pre-emptively go up

eternal oxide
#

in that case you are going ot have to run a tree search

opal juniper
#

this pathfinding shit is complicated

#

i like how i was thinking of doing it

eternal oxide
#

yes

opal juniper
#

ok

#

so i am just feeding off you at this point

#

but can i work out the chunk in front of the drone

#

i forget whether the RayTrace can hit air blocks

eternal oxide
#

no only impassable blocks (including portal blocks)

opal juniper
#

hmm, somehow i need the first block that is in the line of sight that is not the same chunk

#

then i can just work out the max height of the chunk

#

then i can just fly up to avoid everything

#

and hey presto

lost matrix
opal juniper
#

just take a cross section at a certain y i guess

lost matrix
opal juniper
#

This seems hard lmao

#

lemme have a bit of a read

lost matrix
opal juniper
#

coool

lost matrix
# opal juniper coool

Ive just read some stuff and A* might actually look too "blocky" in 3d space.
The fact that we can ray trace makes me think that maybe a Lazy Theta* implementation would be better here.

eternal oxide
#

I'm having a play at teh moment. Just getting a test plugin setup

opal juniper
#

i mean, i kinda understood how A* worked. but this just looks 🤯

opal juniper
#

i mean, if we really didn't care about speed we could just take a cross section at a certain y level and do A* in 2d

lost matrix
#

Im thinking of a simple implementation that can avoid simple obstacles by shooting a cone of rays

opal juniper
quaint mantle
#

Hey, does someone helps with beginning Plugin Developers? Or am i not on the right place for that?

dusk flicker
#

You are free to ask any questions you have here if it refers to plugin development

quaint mantle
#

Alright,

#

I'm a beginner with Java Plugins and i saw a plugin for License Systems! My whole code works. But I have a question! Because I'm a beginning Developer, how can i make a config where the post the license key! And if the license key is wrong, it will disable the plugin?
I have this code atm

package me.mtaddons.Tutorial;

import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

public final class TutorialMain extends JavaPlugin implements Listener {
    FileConfiguration config = getConfig();
    
    @Override
    public void onEnable() {
        if(!new AdvancedLicense("Y7NG-T7OG-84OT-0CZK", "https://mtaddons.000webhostapp.com/verify.php", this).register()) return;

        //config.addDefault("YouAreAwesome", true);
        //config.options().copyDefaults(true);
        //saveConfig();
        
        //getServer().getPluginManager().registerEvents(this, this);
    //}
    
    //@EventHandler
    //public void onPlayerJoin(PlayerJoinEvent event) {
        //Player player = event.getPlayer();
        
        //if (config.getBoolean("YouAreAwesome")) {
            //player.sendMessage("You are awesome!");
        //} else {
            //player.sendMessage("You are not awesome...");
        //}
    //}
    
    @Override
    public void onDisable() {
        
    }

}

So i readed the spigot site and learned making config's so that's done, but how can I implement the license to the config and check if its true or false?

opal juniper
#

Is this not against the TOS

dusk flicker
#

Spigot's Resource Guidelines

#

Not individual resources tho

quaint mantle
dusk flicker
#

On the Spigot site, if you upload a resource they do not allow license systems

opal juniper
#

I thought that it should not rely on external licenses and rack summed it up

lost matrix
hollow sapphire
opal juniper
lost matrix
lost matrix
hollow sapphire
opal juniper
#

ah ok

quaint mantle
#

You understand me?

dusk flicker
#

So for future reference for large blocks of code use a paste site like https://paste.md-5.net/ to stop spam in this chat.

You would have to get a string from the config which would be the license and then execute it against advanced license to check it; and to disable it I believe you can do Bukkit.getPluginManager.disablePlugin(this) I believe

quaint mantle
quaint mantle
quaint mantle
opal juniper
#

you would save the config.yml to the resources and then they can just edit the file

lost matrix
hollow sapphire
opal juniper
quaint mantle
opal juniper
quaint mantle
#

I just want that you can put the license key in a config, and it executes the code if the "license" is true from the code. If its not true, the plugin will get disabled

opal juniper
#

yeah

#

one sec

quaint mantle
#

k

quaint mantle
lost matrix
opal juniper
#
  1. Save a config.yml
  2. Read the config.yml :
    getConfig().getString("path")
  3. Check the key against Advanced Lisence
  4. if it is not valid disable the plugin like rack said
  5. if not just continue
opal juniper
opal juniper
#

the yaml path

quaint mantle
#

uh

#

wait lemme search on google

#

oh

opal juniper
#

true

quaint mantle
#

then i will just stop 😦

opal juniper
#

what they mean is that yaml is a simple concept and this lisencing is normally for advanced plugins. not to dishearten you

lost matrix
quaint mantle
#

ok

manic crater
#

Can anyone help me fix this mild error? Cause what im trying to do is make it so when a user goes in the config to change the item name, it sets it to that name, instead of a preset name by the plugin.

#

Cuz i've been kind of stuck on this

opal juniper
#

You are most likely not in a class that extends JavaPlugin

#

therefore the getConfig() method is not available

manic crater
#

Yeah but i tried it in that class that extends JavaPlugin and it still shows the same issue,

opal juniper
#

umm, it shouldn't

manic crater
#

Erm hold up let me check something..

#

Yeah not getConfig() still has that issue

opal juniper
#

static 👀

manic crater
#

Thank you

opal juniper
#

what does it say the error is

manic crater
#

I just had to remove static xd

opal juniper
#

ah

manic crater
#

Thank you lol, i fr been trying so HARD to figure out what the hell the issue was for the past day now lol

opal juniper
#

😄

#

reminds me

manic crater
#

Xd

ivory sleet
#

also copied ur status ty

quiet ice
#

ah yes, :earth_africa:

ivory sleet
#

ToadEyes you didnt see that

quaint mantle
#

something like this?

#
    private File setupFile = new Fule(getDataFolder(), child: "config.yml");
    private FileConfiguration setupConfig = YamlConfiguration.loadConfiguration(setupFile);
opal juniper
limber mica
#

java.lang.NoClassDefFoundError: net/minecraft/server/v1_8_R3/IChatBaseComponent

quaint mantle
#

wrong version

limber mica
#

Nope

opal juniper
#

Were they even out?

limber mica
#

hm?