#help-development

1 messages · Page 1625 of 1

quaint mantle
#

Hey there!

#

Does anybody have experience with ProtocolLib?

#

I'm looking for a way to do:

#
        packetContainer.getModifier().write(1,
                new PacketDataSerializer(Unpooled.wrappedBuffer(out.toByteArray())));```
#

without using nms PacketDataSerializer

onyx fjord
#

hello, ive set myself setGliding(true); but it doesnt rly let me glide

#

any ideas

#

okay so

#

i am gliding for a milisecond

#

then im not

grim ice
#

to what extent do i need to know java so I can make plugins?

grim ice
#

when ur event occurs or ur command or whatever

#

u give the player a persistent data container

#

and make a check outside if the player has ur pcd

#

and then check if hes not gliding

#

then glide him

dusk flicker
#

or just follow what the javadoc suggests

#

and just cancel the event

grim ice
#

@dusk flicker uh

#

u know java well right

hybrid spoke
#

well

dusk flicker
#

id hope so

hybrid spoke
#

@grim ice you cant fix everything with a PDC

dusk flicker
#

I barely ever use PDCs

hybrid spoke
#

everything you write in here or the plugin development help in the forums is about using a PDC

hybrid spoke
dusk flicker
#

Plus in the case of kacper I doubt persistent storage is even a good option

#

its built in God that it will auto be stopped

grim ice
dusk flicker
#

so you have to cancel the event for it to be kept going

grim ice
#

So uh

dusk flicker
undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

grim ice
#

I don't know at what point should i stop learning java

#

I don't want to master java or anything

grim ice
#

i just want enough to do spigot api

hybrid spoke
#

learning by doing

onyx fjord
grim ice
onyx fjord
#

i need to find a way to stop the event from getting canceled

hybrid spoke
#

and you should never stop learning java

grim ice
#

i know just the basics but some stuff seem to be needed

#

like uh

#

Inheritance

hybrid spoke
#

you cant reach a point where you just can or have to stop

dusk flicker
grim ice
#

i cant figure it out at all

umbral pagoda
#

hi ihave a proplem when player click on any item in his inv all items removed form his inventory

grim ice
#

i know basics of java but i miss some stuff between the lines

hybrid spoke
#

just continue. make things, you know you can't do. go further into it. don't even think while searching for an idea about "how can i learn java with it?". just do it.

quaint mantle
#

Don't worry @grim ice. You'll learn much faster if you actually do things

grim ice
#

o

quaint mantle
#

you don't care if those things are not perfect

grim ice
#

okay i guess

grim ice
umbral pagoda
grim ice
#

this is 100% intentional you cant do that as a mistake can you

hybrid spoke
#

everything can be a mistake

grim ice
#

i mean yeah if u say so

quaint mantle
hybrid spoke
#

anyways. i would just recommend to do a big-as-hell project

#

which you can extend step by step

#

to go further into spigot and java

#

the beginning of a MMORPG, or recoded Essentials could be a good start

proud basin
#

but why remake essentials

grim ice
#

To be honest

dusk flicker
#

thats not the point if you were reading jtx

hybrid spoke
grim ice
#

i never considered remaking stuff

dusk flicker
#

Its to learn

hybrid spoke
#

doesnt have to be something official

grim ice
#

but sure ill try

#

oh btw its not like im doing this for payment, its just a hobby

proud basin
#

why not contribute to a project?

#

improve essentials

grim ice
#

I can't get payment either way because i suck and ill never stop sucking + no cc

grim ice
hybrid spoke
#

gg

grim ice
#

U WANT ME TO IMPROVE IT LMFAO

#

bro

#

i would make it 10000x worse

dusk flicker
#

dont listen to jtx

proud basin
#

listen to me

eternal oxide
#

Don't ever expect to make money writing plugins

grim ice
#

i bet even someone with 10x my knowledge wouldnt be good for it

grim ice
#

exactly

#

thats why i never consider making paid stuff

quaint mantle
#

@eternal oxide my savior

grim ice
#

its really useless especially if ur like me and ur just trying to learn

quaint mantle
#

by any chance, do you know a bit about ProtocolLib?

eternal oxide
quaint mantle
#

oh okay

barren moon
#

just list out what you dont understand , and try to understand them step by step. one step a day or a week.

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

quaint mantle
#

I already asked

hybrid spoke
#

ah damn

grim ice
#

ok it did nvm

hybrid spoke
#

lol

grim ice
#

i looked at the reply it was that smug thing when i looked at ur message it was smiling

#

that got me so scared lmao

proud basin
eternal oxide
#

The resident expert here with ProtocolLib is 7smile7, but it looks like he's not alive at the moment

proud basin
#

it’s 4am for 7smile7

hybrid spoke
#

no its 5:30 pm for him

eternal oxide
#

he's in his IDE, but showing as away

proud basin
#

isn’t he in pst?

hybrid spoke
#

mesz

grim ice
#

i would never sell a plugin

#

except if im just too good

#

like maybe

dusk flicker
#

pst would be like 8;30 am

grim ice
#

4 years of coding

dusk flicker
#

I dont do any public premium plugins as its not worth it for me

grim ice
#

other than that ill just make low quality shit that will never sell

proud basin
#

public premium open source plugin 👀

quaint mantle
grim ice
#

tbh i wanna code but ill play minecraft because my day is ruined

regal moat
#

1.17.1 or 1.16.5 for NMS?

onyx fjord
#

u can use oraxen for free but without built in textures and models

dusk flicker
#

i bought oraxen a while ago

#

lol

proud basin
#

why

onyx fjord
#

why not

quaint mantle
#

Are you satisfied with it? @dusk flicker 🙂

proud basin
#

too much effort to buy it

#

when I can just not use it

dusk flicker
#

ye

proud basin
#

🤯

dusk flicker
#

Havent used it in a little bit

regal moat
dusk flicker
#

be patient

#

and thats useless it depends on your usage

quaint mantle
regal moat
#

Should I use Paper or Spigot?

dusk flicker
#

again depends on your usage

quaint mantle
#

Again, up to you

drifting halo
#

asks in spigot server

dusk flicker
#

to run a server, prob Paper, if you are gonna develop a plugin prob Spigot

quaint mantle
#

Paper has a few extra API features though

regal moat
regal moat
quaint mantle
#

Sponge

dusk flicker
#

keep in mind that you cant use a paper plugin on a spigot server

regal moat
#

but can use a spigot plugin in a paper server

quaint mantle
#

Yes

regal moat
#

i'll do the thing i said

dusk flicker
#

for the most part yes

regal moat
#

😄

quaint mantle
#

how can i make side bars

#

in visual bukkit

#

like hypixel bedwars

regal moat
#

scoreboards

eternal oxide
#

visual bukkit have a discord.

proud basin
#

what’s visual bukkit

eternal oxide
#

its not java

quaint mantle
#

Building a plugin in a gui

#

Like scratch

proud basin
#

so basically skript

quaint mantle
#

Yeah but arguably worse lol

proud basin
#

why not just learn java

#

why waste your time to learn skript

#

when you can learn java

eternal oxide
#

Who do I message to get a bull crap review taken down?

quaint mantle
#

I mean tbf skript can help you learn how plugins work in a way

hybrid spoke
eternal oxide
#

thanks

quaint mantle
#

holy shit

#

elgarl made group manager

#

:P

vagrant stratus
proud basin
#

cap

#

imagine

#

proof

quaint mantle
#

😲

eternal oxide
#

well, how about it claiming GM has backdoors as a review?

quaint mantle
#

elgarl made the original permission plugin

proud basin
#

the original one was discontinued

eternal oxide
#

I am the dev from When it was in Essentials

proud basin
#

ah

#

I need to get better at making managers

regal moat
#

How can I get NMS in 1.17.1 Spigot?

#

I am having problems here.

proud basin
#

buildtool

#

?buildtool

#

?buildtools

quaint mantle
#

?bt

undone axleBOT
proud basin
#

ah that’s what it is

regal moat
#

i have ran buildtools for 1.17 spigot

#

a long time ago

#

when it got released

proud basin
#

you need 1.17.1

regal moat
#

😅

#

so ```java
java -jar BuildTools.jar --rev 1.17.1

quaint mantle
#

Yeah it's with each version you have to rerun it

regal moat
#

then what do i do?

quaint mantle
#

Yes

proud basin
#

if that’s what it says yes

eternal night
#

run it with --remapped to get the mojang mappings

proud basin
#

read the docs

regal moat
#

alright

proud basin
#

it literally tells you how to do it

quaint mantle
#

Then after you run it you can import it with maven/gradle

#

Although for gradle, idk if there's a plugin yet for building a remapped jar

proud basin
#

what is the one of maven

quaint mantle
#

the specialsource maven plugin

quaint mantle
#

how do i get the name of a field in javax.annotation.processor

smoky finch
#

bump

tardy delta
#

if i made a custom inventory in my class can i check in onInventoryClose of the event.getinv is instaceof that class?

tardy delta
#

it doesnt seems to work

#

thats why i asked

quaint mantle
#

Why is it that I have this code

public class ListLocations implements CommandExecutor {
    @SuppressWarnings("unused")
    private Main plugin;
    public ListLocations(Main plugin) {
        this.plugin = plugin;
        plugin.getCommand("listlocations").setExecutor(this);
    }
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if(!(sender instanceof Player)) {
            sender.sendMessage("Only players can use commands for this plugin");
            return true;
        }
        Gson gson = new Gson();
        Reader reader = null;
        try {
            reader = Files.newBufferedReader(Paths.get("C:\\Users\\gaela\\OneDrive\\Documents\\advanedChorusFruitPlugin\\src\\me\\JiovannyAlejos\\advancedChorusFruit\\tpData.json"));
        } catch (IOException e) {System.out.println("failed reading json file");}
        CoordinateData data = gson.fromJson(reader, CoordinateData.class);
        String coordList = "List of warp locations\n";
        if(data.coordinates.size() == 0) {
            coordList = "No warp locations set";
            System.out.println("1");
        } else {
            ArrayList<String> names = data.locNames;
            for(int i = 0; i < data.coordinates.size(); i++) {
                String[] coordinates = data.coordinates.get(i).split(Pattern.quote("|"));
                coordList += "\n" + names.get(i) + ", " + coordinates[0] + ", " + coordinates[1] + ", " + coordinates[2];
            }
            System.out.println("Thing");
        }
        
        Player p = (Player) sender;
        p.sendMessage(coordList);
        System.out.println("nyeh");
        return false;
    }
}

but all it ouputs is this and nothing else

[09:42:19] [Server thread/INFO]: Radiant_Bee issued server command: /listlocations
[09:42:19] [Server thread/INFO]: []
quaint mantle
undone axleBOT
quaint mantle
#

uhhhh h-how do i use hastebin? i'm saving but im not sure where it's saving

crude charm
#

What are reasons you would ban someone? Need it for my plugin lol

quaint mantle
#

ohp wait i got it now

eternal oxide
#

I never ban, I imprison. Its harder for a person to choose to not log in anymore than to be banned.

crude charm
quaint mantle
crude charm
#

got that one

#

I have Hacking, Bug abuse and security breach

eternal oxide
#

griefing build (not so easy these days). Harassment. Inappropriate behaviour

crude charm
#

Griefing doesn't apply to my server and I'd consider Harrassment a perm mute

eternal oxide
#

The only other would be underage access. If your server has a legal age requirement

crude charm
#

Aight

#

I'll just do my secret idea

vagrant stratus
#

If you can, just have a separate server just for rule breakers

#

Why ban or imprison when you can just keep them coming back lol

quaint mantle
#

i think im filling my lib with so much bloat, i either have to make my plugin JARs uber jars or make the lib a plugin

vagrant stratus
#

or just go through the lib and remove bloat 😂

quaint mantle
#

at some point

#

but some plugins dont need some parts

vagrant stratus
#

so use some parts only in the plugins that need them 😐

quaint mantle
#

huh

#

nvm i remember the minimize jar option

vagrant stratus
#

inb4 compile errors

quaint mantle
#

we'll see

grim ice
#

What are plugin 'addons'?

ivory sleet
#

usually jar files loaded by a plugin

grim ice
#

Oh, like soft dependencies?

ivory sleet
#

they most likely contain a concrete implementation from some base type of the plugin api or plugin sdk

#

uh well not really

grim ice
#

That like add up to the plugin to make it better?

ivory sleet
#

take papi expansions for instacne

vagrant stratus
quaint mantle
#

sometimes free

ivory sleet
#

independent redeployment 😌

vagrant stratus
raven rampart
#

Does anyone know of how to get non-consumed items in a crafting recipe? For example: the honey block ShapedRecipe takes in four honey bottles, with getResult of 1 honey block, but where do I find the 4 glass bottles that are left behind?

raven rampart
#

Thanks, but I don't see where I would get non-consumed items from this event.

raven rampart
#

from the CraftingInventory, there is the matrix, which is what is needed in the recipe, getRecipe doesn't have non-consumed items that I can see, and getResult is still a single ItemStack

quaint mantle
raven rampart
#

Wouldn't it only have the honey bottles? Not the glass bottles?

quaint mantle
#

¯_(ツ)_/¯

#

make it yourself

raven rampart
#

This seems like it should be in the Recipe API

quaint mantle
#

if getResult() is HONEY_BLOCK then
# glass bottles

raven rampart
#

That seems ripe with the ability to be out of date every release.

quaint mantle
#

it isnt

#

🤔

raven rampart
#

If a new recipe is added which includes non-consumed items, and the plugin wasn't updated? Isn't that why we should try to avoid magic numbers and hard coding those types of things?

quaint mantle
#

PES_CoolBiker Don't know

grim ice
#

@raven rampart

#

what dyou want to

raven rampart
#

Yeah

grim ice
#

do

#

i might be able to help since i play with recipes on every plugin i have

raven rampart
#

I am looking to find what items are left behind from a recipe

grim ice
#

Yes

#

use the event

#

that imaginedev told you

#

get the inventory of the crafting table then the matrix

#

check for each one

#

if one has a glass bottle or whatever u want

#

do ur code

raven rampart
#

I can look at that, but this should be part of the recipe. What if there were no event. Say... an auto crafting plugin?

grim ice
#

hm

#

maybe

#

Inventory open event or what was it

#

then check if the event is a crafting inventory

#

if it is then make a loop to check the matrix

#

..etc as i mentioned before.

raven rampart
#

This isn't a player initiated action

grim ice
#

What?

raven rampart
#

Say you have a crafting table with a hopper pointing into it. There are special criteria on what crafting tables are included, but that's irrelevant to the point. You look for hoppers pointing into that block and have a designated item's recipe. You can look at the recipe and see the ingredients & choices. If the hoppers have the right items, take them and pop out the item.

digital plinth
#

hoppers cant interact with crafting tables?

raven rampart
#

Unless you write a plugin that lets them

digital plinth
#

oh so you are trying to make a plugin that lets the hopper put stuff in a craft table

raven rampart
#

Yeah, in a manor of speaking

digital plinth
#

it would be hard to do tbh. Like which slot are you gonna put the item from the hopper in

#

top left corner?

#

bottom left corner?

raven rampart
#

Doesn't matter

digital plinth
#

so ur recipes are not shaped?

raven rampart
#

Basically it unshapes them

grim ice
#

youre gonna fuck up shaped recipes.

raven rampart
#

No, I just iterate through the recipe ingredients

digital plinth
grim ice
#

what if there was 2 items u can craft with the items in the hopper?

digital plinth
#

eg diamond pickaxe

#

diamond woodenStick diamond diamond woodenstick

raven rampart
#

This is only for Shaped and Unshaped recipies

grim ice
#

I cant help you with that honestly

digital plinth
#

ya cant do it with shaped

#

5 iron cna make a minecart

#

or a

raven rampart
#

You tell the table what it should be crafting

digital plinth
#

helmet

digital plinth
grim ice
raven rampart
#

It works great, except for recipes that have non-consumed items

#

No

grim ice
#

what about custom recipes?

digital plinth
#

well then check the item in the hopper and set the crafting table with the items and delete the items from the hopper

grim ice
#

Hm

raven rampart
#

honey block

#

input four honey bottles

grim ice
#

Just get the item in the hopper that went through

digital plinth
#

if you have a plugin that arranges the honey bottles

#

and then craft it

raven rampart
#

output should be 1 honey block and 4 glass bottels

digital plinth
#

it works like normal

grim ice
#

you should be able to do that if your code structure is good]

digital plinth
#

it should return 4 bottles

digital plinth
raven rampart
#

But I can find nothing in the recipe which tells me what other items should be in the output

digital plinth
#

back into hopper?

raven rampart
#

They can go to the output hopper

raven rampart
#

Why would 4 glass bottles be in the input? It is 4 honey bottles in the input

digital plinth
#

spigot should go throu with the default crafting

#

and return 4 bottles

#

is that not the case in your tests?

raven rampart
#

Where? Where would the 4 bottles be?

digital plinth
#

it feels right logically

#

not really sure how crafting works in the code

digital plinth
#

and u craft

#

the bottles should be in your inv

#

if your inv is full

#

ahh i give up

#

never messed with auto matic crafting

#

what i said are all theories XD

raven rampart
#

Okay okay. The CraftItemEvent.getInventory() may have it in the matrix

digital plinth
#

so what happens when you craft a honeyblock

#

where did the glass bottle go

#

did they disappear

raven rampart
#

Yes

digital plinth
#

and you got the honeyblock?

raven rampart
#

But, that is because I am manually subtracting from the hopper's inventories

digital plinth
#

wdym

raven rampart
#

Okay.

  1. Find all the glowItem frames attached to crafting tables with an item in the frame and a hopper under it
    This is the output item expected, what should be used for the list of recipes
  2. Combine all the hopper inventories for hoppers pointing into this crafting table
  3. Iterate through the recipes and find one where the combined inventories have the necessary items
  4. Iterate through the hopper inventories and deduct the items as needed
  5. Put the new ItemStack in the output hopper
#

Obviously there are checks for full inventories, disabled hoppers and the like

digital plinth
#

well if that is now your plugin works

#

when you find a crafting recipe with 4 honey bottles

#

make the output contain 4 bottles AND a honeyblock

raven rampart
#

I'd rather not hard-code that as it would lead to the plugin being out of date for any release which adds a recipe having non-consumed items

#

So I am trying to find a way that I can get the CraftItemEvent to fire without player interaction and see if the CraftingInventory.getMatrix() has the four glass bottles.

#

But the CraftItemEvent is very much tied to a Player

#

This seems like a limitation in the Recipe API, because this type of information should be available in absence of an event.

digital plinth
#

well GL

raven rampart
#

Thanks. I'm trying to see if I can find where the event gets it's information.

digital plinth
#

this might help

raven rampart
#

Lol ive read that thing so many times

whole stag
#

Alright, I'm having issues. How do I make a command executable by anyone?

digital plinth
#

the 3) Creating your own Event section

digital plinth
#

permission

#

in yml

#

if u did

#

remove it

#

or get LP and set it to avaliable for everyone

whole stag
#
  ctf.player:
    description: Allows the player to use player commands
    default: true
  class:
    description: Sets the class of the player
    usage: class <class>
    permission: all

These are what I have

eternal oxide
#

try not to make permissions case sensitive. it may or may not be applied in plugins, and it makes life a nightmare

whole stag
#

What do you mean case sensitive?

digital plinth
#

all lower case

#

prolly what he meant

eternal oxide
#

yes, if you specify case it makes life difficult, and may be ignored anyway

digital plinth
rose aspen
#

Is someone here a ProtocolLib expert ?

digital plinth
#

maybe

#

not me

digital plinth
digital plinth
#

i never seen those

#

lol

whole stag
#

my bad, I copied the wrong one

#
  class:
    description: Sets the class of the player
    usage: class <class>
    permission: ctf.player

Should be this

digital plinth
#

whew i thought what i had learnt were all wrong a moment there

digital plinth
#

if you dont have a permission plugin like LP on

#

only OPs can use it

grim ice
#

does anyone here know Oraxen API

warm galleon
#

Im using Intelij with maven and wen i build and check the jar, there is no package with my project, so its basically an empty plugin

#

i also dont have the target folder with test classes and stuff but idk why

digital plinth
#

oh no no no maven...

whole stag
warm galleon
#

im asking for help not for java build tools

digital plinth
#

never used maven cuz its kinda hard to use so sry cant help

digital plinth
#

that will allow everyone to be able to use the command

#

globally

#

another way is to remove the permission node

proud basin
#

Element#getEnclosingElement

digital plinth
#

wat?

whole stag
proud basin
#

sorry that a was note for me

digital plinth
#

or disable your command in a certain world

rose aspen
#

ProtocolLib stuff:
Could someone explain to me why this is happening if I try to send a SPAWN_ENTITY packet that should be an Item ?

Code:
https://pastebin.com/ksryu2Av

whole stag
#

It's a command that should always be accessible, so that's fine

fluid cypress
#

how do i spawn items on the ground? i want to mimic breaking a chest, but breaking another block

digital plinth
#

player.getWorld.dropItem

hexed hatch
#

Does anyone know if Spigot has an api for adding entity spawns (like how the datapacks do it) to the world?

grim ice
#

yo

#

anyone wannts to help me better my code structure

dusk flicker
#

Clean up your pom, at least format stuff, space stuff out, in your main class group things, you register a event at the top of on enable and one at the bottom, group common types

#

I don't see you needing the maven shade plugin so you could also remove that

reef wind
#

yes, your pom.

grim ice
#

I never checked that thing in my whole life except when i add dependencies

#

what shit is it for

dusk flicker
#

In your command and listener your DI objects should not be static

reef wind
dusk flicker
#

And maybe learn about maven before using it

grim ice
#

do I really need to

#

Sure ill consider

dusk flicker
#

Yes and do me a favor and stop mentioning me

grim ice
#

but it wont take as long as java right

dusk flicker
#

Maven is simple

dusk flicker
#

It's not a full on language

grim ice
digital plinth
#

spigot is omnipotent

digital plinth
hexed hatch
digital plinth
#

yea

reef wind
grim ice
#

the spaces r are as i like them

dusk flicker
#

🏓

digital plinth
grim ice
#

wait did i ping

digital plinth
#

spigot spawn entites

reef wind
digital plinth
#

what?

hexed hatch
digital plinth
#

Zombie armoredZombie = (Zombie) loc.getWorld().spawnEntity(loc, EntityType.ZOMBIE);

grim ice
digital plinth
#

how i do it

hexed hatch
#

I'm not talking about using events, I'm talking about registering spawns on the world

dusk flicker
#

Your pom is fine formatting wise you just don't need the shade plugin or the sonnatype repo

digital plinth
#

pom

digital plinth
#

hhhh

digital plinth
#

this default font

dusk flicker
#

🏓

grim ice
#

Well I don't like messing with that stuff

#

Anything else? Like breaking java principles which I always do

reef wind
dusk flicker
#

You should learn how to use maven because that will help you a lot

grim ice
#

Yeah ill do that

digital plinth
digital plinth
#

cool

dusk flicker
#

Fix the static DI vars in the events and commands class and it looks decent to me

digital plinth
#

ayanokoji > that dude

grim ice
#

his name is akabane Karma

digital plinth
#

haha XD

digital plinth
dusk flicker
#

🏓

grim ice
dusk flicker
#

The variable

grim ice
#

Oh right

dusk flicker
#

You are using DI to set a static var that shouldent be static

grim ice
#

where

digital plinth
#

DI is dependency injection

#

u use a interface and blah blah blah

dusk flicker
#

What?

#

You don't use an interface for DI

digital plinth
dusk flicker
dusk flicker
digital plinth
#

King Kong

grim ice
#

@dusk flicker

#

sorry for ping

#

but you mean

#

private static JavaPlugin plugin;

#

(which is a field, no?)

#

and if you mean it, It has to be static?

digital plinth
#

oh no no no no no

#

u pinged rack

#

prepare yourself

grim ice
#

fuck

digital plinth
#

XD

digital plinth
grim ice
#

Yep

digital plinth
#

XD

dusk flicker
#

Yeah that's a field or a variable

grim ice
#

Sorry for my dumb questions

dusk flicker
#

Just shouldent be static

grim ice
#

when i make it something else

#

i get an error

#

when i do this.plugin i get Non-static field 'plugin' cannot be referenced from a static context

desert sedge
dusk flicker
#

Ye, you need to change the references in the methods of that class to just use the variable name rather then Class.var

grim ice
#

uh oh

#

OH

#

LMAO RIGHT

#

IM SO DUMB

#

final is fine right

dusk flicker
#

Ye

grim ice
#

ok

#

poggers

rose aspen
plain scroll
#

is there a material that i can use like all of a certon item?

#

so like all wool and all carpet

eternal oxide
#

do you mean like test if a block is carpet or wool?

grim ice
#

Yes

#

learn the raw basics of java tho

eternal oxide
#

if (Tag.CARPETS.isTagged(block.getType());

grim ice
#

he can do startsWith

eternal oxide
#

This is what Tags are for

grim ice
#

Mhm, thats a way of doing i t

#

it

mortal hare
#

java: Compilation failed: internal java compiler error

#

cmon...

tame coral
#

It doesn't say anything more ?

mortal hare
#

no

eternal oxide
#

no java for you

mortal hare
#

its plain basic plugin

#

with adopt open jdk 11

#

i tried 16 too

tame coral
#

Eh, maybe try to reinstall java

#

Might help

mortal hare
#

that's the thing

grim ice
#

weird thing

mortal hare
#

i tried both adoptopenjdk 11 and adoptopenjdk 16

#

for 1.16.5

#

both of them vomits this error

grim ice
#

do you use eclipse

mortal hare
#

no

tame coral
#

You using Intellij ?

mortal hare
#

intellij

tame coral
#

found this

#

might help

grim ice
#

To be honest

#

this might help you

mortal hare
#

that's not the issue

grim ice
#

just redo the first stuff

mortal hare
#

i've been developing plugins

#

before

grim ice
#

oh

#

you said its a plain plugin

#

just read the startdude

#

the IDE setup ..etc

mortal hare
#

public class Plugin extends JavaPlugin {
    @Override
    public void onEnable() {
        this.getLogger().log(Level.INFO, "Hello from the plugin!");
    }
}
#

that's is literally it

grim ice
mortal hare
#

i think its due to the openjdk

tame coral
#

isn't onDisable necessary

grim ice
tame coral
#

ok

mortal hare
#

since its eclipse based

tacit drift
grim ice
#

100% No

tacit drift
#

Oh wait

grim ice
#

Having onDisable is unnecessary except if you have recipes / unordinary stuff

tacit drift
#

forgot about that thumbnail

#

:))

mortal hare
#

these methods are overrides. Bukkit API handles them in case its not overriden

grim ice
#

i gave u a solution

#

redo ur setup

mortal hare
#

this is useful

#

since i use the same compiler

#

fuck it

#

im gonna use amazon coretto

#

at least its not buggy with the ide

hybrid spoke
hybrid spoke
mortal hare
hybrid spoke
#

if overriden or not

#

doesnt matter

mortal hare
#

its not an abstract class

#

JavaPlugin is a class

#

which contains the methods

hybrid spoke
mortal hare
#

yes

hybrid spoke
#

public abstract class JavaPlugin
extends PluginBase

grim ice
#

if u dont use custom enchants and stuff

hybrid spoke
grim ice
#

yeah stuff like that

mortal hare
#

well yeah

grim ice
#

other than those stuff no need

mortal hare
#

youre right

#

but these methods are optional to implement

#

inside main class

#

override*

hybrid spoke
#

and even if JavaPlugin would not be abstract, bukkit would call those methods

#

optional to implement, called anyways.

mortal hare
#

right

#

i like how intellij idea ironically doesnt work properly with eclipse's jdk

#

it feels like.. Hm... Strange..

#

it feels like its done for purpose but its probs a coincidence

#

now wtf is that

#

java: java.util.ServiceConfigurationError: javax.annotation.processing.Processor: Provider org.bukkit.craftbukkit.v1_16_R3.libs.org.eclipse.sisu.space.SisuIndexAPT6 not found

#

cmon

#

i just want to develop

#

it doesnt even use eclipse jdk anymore

#

im running on corretto rn

#

i feel like my maven repo of purpur is broken

#

and yet i can't fix it normally

#

because

#

nope

#

repo is fine

#

i checked the sha 256 checksum of repo

#

with paperclip cache's file checksum

#

and the checksums matches

#

WTF

crude sleet
torn oyster
#

?paste

undone axleBOT
dusk flicker
#

Whatever ur doing can't be done async

torn oyster
dusk flicker
#

That's why the async catcher is catching it

torn oyster
#

whenever it is run

#

its in a command

paper viper
#

Probably something ran on the main thread not supposed to be ran

undone axleBOT
crude sleet
dusk flicker
#

you just can't run it async anymore ¯\_(ツ)_/¯

paper viper
#

Look what I said (clach)

proud basin
#

how do yall do your managers?

torn shuttle
# torn oyster anyone

go to your local tech store and buy a mouse with a scroll wheel so you don't ping the bot every 3 lines

crude sleet
#

But thx

torn oyster
#

no errors

#

it lags me only

#

well it lags only the person who sent the command

dusk flicker
#

Runnables will prob flag the catcher aswell

#

What you could prob do is store the list result of the method in a local var and then access it in another thread

slate pendant
#

Can I just immediately stop the server process without saving anything? Like the exit button on windows console? (Bukkit.shutdown() saves everything and takes time to stop)

quaint mantle
#

You can use /stop to save stuff

slate pendant
#

but what if I don't need saving?

grim ice
#

can u make the console do

#

kill

quaint mantle
#

Then just exit out

grim ice
#

its called force stopping

#

(Killing)

slate pendant
#

right from the plugin?

grim ice
#

No

#

make the console send "kill"

#

it might work idk

slate pendant
#

does System.exit(0) work there btw

slate pendant
quaint mantle
#

That’s how you lose data 🙂

slate pendant
#

I need to reset default world

#

I don't need saving data

paper viper
#

Clear world folder

#

Lol

unreal quartz
#

i mean you can terminate the JVM but generally not a good idea

quaint mantle
paper viper
#

Just shut the PC off

plush gulch
#

I want to disable player regeneration, so I just figured i could cancel the EntityRegainHealthEvent. This works fine, however the Saturation still gets removed from the player like regenerating health. How do I disable this?

paper viper
#

System.exit

quaint mantle
#

Homie really thinks /stop is too slow 😂😂

unreal quartz
slate pendant
#

ok

#

thanks)))

quaint mantle
#

Inpatient

reef wind
grim ice
#

a

#

health

#

or check the food of the entity then check the event food leve

#

level

#

and compare them

#

if that can work, idk it worked for me with a different event

plush gulch
#

ok, how did you do it?

grim ice
#

uh

#

1s

quaint mantle
#

FoodLevelChangeEvent or whatever

#

Do the same thing cancel it if they have regen right??

grim ice
#

public void onConsume(FoodLevelChangeEvent e) {
if (e.getEntity().getFoodLevel() < e.getFoodLevel()) {
int increase = e.getFoodLevel() - e.getEntity().getFoodLevel();

#

thats how i did it

plush gulch
#

ok, thanks

grim ice
#

if u wanan cancel

#

just

#

e.setCancelled(true);

plain scroll
#

if i make my own java class with itemstacks in it, do i use Override ?

#

@Override

#

like that

paper viper
#

Don’t

#

Don’t extend ItemStack

#

It will break clients

#

Clients can’t understand how to read the custom itemstack

plain scroll
#

ahhh ok ok

waxen plinth
#

Huh

plain scroll
#

oh also is there any doc on how to use itemstand textures?

#

i can't find anything anywhere

waxen plinth
#

My item builder extends ItemStack and it's worked fine

plain scroll
#

i wanna mask a bed as a model lol

waxen plinth
#

Only issue is storing it in config

paper viper
fluid cypress
#

the player object will be the same even if the player reconnects, right?

paper viper
#

No

fluid cypress
#

mmm

#

thats bad

paper viper
#

Use UUID

dusty herald
#

lol

eternal oxide
#

Player object will change if the player relogs, and may change when they die.

ivory sleet
#

Unless you delegate

proud basin
paper viper
#

Never knew that

quaint mantle
#

can someone help? I'm trying to download the build tools but i can't see the package that says org.bukkit in it in my ide, the ones i see where it shouldve been are org.apache and org.eclipse

ivory sleet
#

Don’t think they do

#

Why would it invalidate then

#

Makes no sense

#

When they die that is

eternal oxide
#

when they die they are removed from the player map.

torn oyster
#

guys i just switched from java 8 to java 16 for intellij but now it gives me this maven error
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project MaxicraftSurvival: Fatal error compiling

ivory sleet
#

Oh yeah but the same object is probably added back once the player respawns

eternal oxide
#

probably, but I'd not rely on it

prisma needle
#

Hey guys! I’m trying to clone an area of blocks (like /clone), but cannot find an effective solution, anyway to do it?

ivory sleet
#

It would make no sense to switch object

quaint mantle
#

The player object does not change when they die

paper viper
#

This is why WeakHashSet OP

#

For when they relog lol

chrome beacon
paper viper
#

So the old one gets removed

ivory sleet
chrome beacon
torn oyster
#

nothing else

#

just that

chrome beacon
prisma needle
torn oyster
paper viper
#

Show us not just logs

#

Build scripts

chrome beacon
quaint mantle
#

Using a Player with an identity holder is your quickest option. Only store uuid if you need to do something with them offline

torn oyster
#

?paste

undone axleBOT
paper viper
#

WeakReference<Player> 😁

prisma needle
ivory sleet
#

WeakIdentityHashMap<Player,V> (;

#

Pulse so how’s mml going

#

Or emc

quaint mantle
paper viper
#

Fixed entity and map players

ivory sleet
#

Oo hmm Ima check that out

paper viper
#

Also finished rewrite

#

Of library

#

So library super clean

ivory sleet
#

😌

chrome beacon
torn oyster
#

olivo

chrome beacon
#

What

torn oyster
#

i got the logs

chrome beacon
#

oh

torn oyster
chrome beacon
fluid cypress
#

how do i create an offline player object using just the player name? btw its not a real player that ever joined the server, but SkullMeta#setOwner(String) is deprecated and now i have to use SkullMeta#setOwningPlayer(OfflinePlayer), but it doesnt accept a string, only an offline player

ivory sleet
#

Server::getOfflinePlayer

torn oyster
torn shuttle
#

I just spent 45 minutes debugging a ringing noise on my left speaker

#

I was like "what's this metallic interference noise I keep hearing on semi-low sounds?"

fluid cypress
torn shuttle
#

turns out I'd stacked some keys on top of the speaker

#

10/10

ivory sleet
#

And do it async

fluid cypress
#

async? how, and why

#

and getOfflinePlayer(String) is deprecated too, does it work anyway?

ivory sleet
#

its not deprecated for removal

#

read the javadoc deprecation justification

fluid cypress
#

ok

#

so like this

temStack skull = new ItemStack(Material.PLAYER_HEAD);
SkullMeta meta = (SkullMeta) skull.getItemMeta();
meta.setOwningPlayer(instance.getServer().getOfflinePlayer(skinName));
skull.setItemMeta(meta);
proper shore
#

Hi, I have a problem. my code is sending 2x commands/messages
What should I do?

#

Code:
package com.civciv.avalon;

import org.bukkit.ChatColor;
import org.bukkit.Particle;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.potion.PotionEffectType;

import javax.xml.stream.Location;
import java.io.Console;

public class SaklambacTool implements Listener {

GrapplingHook plugin;

public SaklambacTool(GrapplingHook plugin) {
    this.plugin = plugin;
}

@EventHandler
public void onInteract(PlayerInteractEntityEvent event) {
    String prefix = plugin.getConfig().getString("saklambactool.prefix");
    String ebeledin = plugin.getConfig().getString("saklambactool.ebeledin");
    String ebelendin = plugin.getConfig().getString("saklambactool.ebelendin");
    String ebeyiebeleyemezsin = plugin.getConfig().getString("saklambactool.ebeyiebeleyemezsin");
    Player player = event.getPlayer();
    Entity entity = event.getRightClicked();
    if (event.getRightClicked() instanceof Player) {
        if (player.getInventory().getItemInMainHand().getItemMeta() != null && player.getInventory().getItemInMainHand().getItemMeta().getLore() != null
                && player.getInventory().getItemInMainHand().getItemMeta().getLore().contains("§4§lETKINLIK ESYASI")) {
            if (((Player) entity).hasPotionEffect(PotionEffectType.GLOWING)) {
                player.sendMessage(prefix + ebeyiebeleyemezsin);
            } else {
                player.sendMessage(prefix + ebeledin);
                entity.sendMessage(prefix + ebelendin);
                ((Player) entity).performCommand("spawn");
            }
        }
    }
}

}

undone axleBOT
chrome beacon
#

Anyway the issue is caused because that event can fire twice, once for each hand

#

Check the hand before using your code

plush gulch
#

how do I set a Players max health? player.setMaxHealth() is deprecated?

proper shore
quaint mantle
#

can someone help me download the plugins and then a mod or whatever its called

young knoll
#

What

quaint mantle
#

I need help

#

downloading spigot

#

and getting the mod i want

young knoll
#

?bt

undone axleBOT
young knoll
#

Also spigot only runs plugins, not mods

hazy igloo
quaint mantle
quaint mantle
quaint mantle
#

uhhhhh how do i do that

hazy igloo
quaint mantle
#

i'm not sure where my local maven repository is-

hazy igloo
young knoll
#

Usually with a /bat file to set min and max ram

quaint mantle
#

erm- a-also i'm on a mac

#

Ok hold on

wet aspen
quaint mantle
#

i- i think i need to check if spigot is in my local maven repository since the org.bukkit doesn't seem to be in the buildtools.jar for me

quaint mantle
wet aspen
#

ok have you ever build a spigot jar file before on your mac?

quaint mantle
#

not on my mac but i have on my windows laptop before

wet aspen
#

oh ok , then your gonna have to start a .jar build so that you can have the Mac install what you need to be able to compile the .jar file.

quaint mantle
#

what do you mean by .jar build?

quaint mantle
wet aspen
#

buildtools

quaint mantle
#

oh, i installed them from the spigot website if that's what you mean?

wet aspen
#

do you have knowledge on using the terminal on your mac?

quaint mantle
#

yes

#

the BuildTools.jar

#

so downloaded, you have to run that to build spigot jar

wet aspen
#

ok are you able to complie a spigot.jar file already?

#

from your mac

quaint mantle
#

ohp, i didn't compile it before, that maaay have been my issue

#

?bt

undone axleBOT
quaint mantle
#

guide for building it ^

wet aspen
#

look at your main harddrive, look under users, select youe username and see if it show anyfiles that say apache-maven or modules.

wet aspen
proper shore
quaint mantle
#

so while i have buildtools.jar in my downloads, i then ran java -jar BuildTools.jar --rev 1.17.1 in the terminal, and now i have the apache-maven folder

#

do i then use the same BuildTools.jar as the external archive?

wet aspen
#

ok good , youshould also see a spigot - 1.17.1 .jar file in the same folder

quaint mantle
#

ohp wait

#

it just finished and it popped up now

hazy igloo
#

Did you call the PortalClass constructor in the onEnable method?

quaint mantle
#

wooo it's working now :D thank you kind people

wet aspen
#

your welcome. congrats on the build!

stone sinew
stone sinew
#

I'm just using EntityPortalEnterEvent and will add a cooldown for the check.

prisma needle
#

?paste

undone axleBOT
quaint mantle
#
[17:20:43 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'announce' in plugin AbsenceBasics v1.0
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched.jar:git-PaperSpigot-"4c7641d"]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:146) ~[patched.jar:git-PaperSpigot-"4c7641d"]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:666) ~[patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1189) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1001) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [patched.jar:git-PaperSpigot-"4c7641d"]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_292]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_292]
        at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:774) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [patched.jar:git-PaperSpigot-"4c7641d"]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [patched.jar:git-PaperSpigot-"4c7641d"]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292]
#

why doesnt this error say anthnjg

eternal oxide
#

not spigot, but in AbsenceBasics it seems to have managed to register a null command class

#

announce command

quaint mantle
#

yea but every single command is like that

#

i was just adding extra config files

#

i think it not readign config right bcuz liek every command reads from ocnfig

#

Hey I need some help

#
[22:33:26 INFO]: java.lang.UnsupportedOperationException: Use BukkitRunnable#runTaskTimerAsynchronously(Plugin, long, long)
[22:33:26 INFO]:        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.runTaskTimerAsynchronously(CraftScheduler.java:656)
[22:33:26 INFO]:        at xray-1.0.0-all.jar//io.th0rgal.xray.XrayCommand.lambda$new$1(XrayCommand.java:21)
[22:33:26 INFO]:        at xray-1.0.0-all.jar//io.th0rgal.xray.shaded.commandapi.executors.IExecutorNormal.executeWith(IExecutorNormal.java:43)
[22:33:26 INFO]:        at xray-1.0.0-all.jar//io.th0rgal.xray.shaded.commandapi.CustomCommandExecutor.execute(CustomCommandExecutor.java:114)
[22:33:26 INFO]:        at xray-1.0.0-all.jar//io.th0rgal.xray.shaded.commandapi.CustomCommandExecutor.execute(CustomCommandExecutor.java:102)```
#

Java 16, 1.17:

#
                        Bukkit.getScheduler().runTaskTimerAsynchronously(plugin,
                                new Renderer(player,
                                        50,
                                        (Block block) -> block.getType() == Material.DIAMOND_ORE),
                                0,
                                10L);```
#

only hello debug is displayed, the run method is never called

#

instead I get this error

#

note: 'runTaskTimerAsynchronously(org.bukkit.plugin.Plugin, org.bukkit.scheduler.BukkitRunnable, long, long)' is deprecated

#

I didn't understand how to use a Consumer<BukkitRunnable>

#

deprecated

#
[22:33:26 INFO]: java.lang.UnsupportedOperationException: Use BukkitRunnable#runTaskTimerAsynchronously(Plugin, long, long)
chrome beacon
#

;/ replied to wrong message but yeah

stray garnet
#

Newb Question here - - developing 1st plugin and am looking tag custom items such that I can react appropriately later on (e.g. if a player drinks a custom potion, then want to replace the fully potion with an empty water bottle [which doesn't happen automatically]).

Anywho... what is Lore used for? is it a property bag where I can drop some custom attribs & read/test-for those attribs later on to deduce if this itemstack is something that is part of my plugin?

young knoll
#

Lore is shown to the player

#

Use PDC for data

chrome beacon
chrome beacon
stray garnet
#

ah -k thnks for pointers. "PDC" is... ah nm 🙂 thanks again.

quaint mantle
fervent gale
#

I'm trying to setup a bungee server and im getting a error

chrome beacon
digital plinth
#

pp

graceful turret
digital plinth
#

a question does the onCommand always need to return a boolean

young knoll
#

Yes

digital plinth
#

okie

patent horizon
#

how do i get all the files in my server's main directory

digital plinth
#

.getDataFolder?

#

thats the plugin directory

patent horizon
#

uh no

#

im trying to make a method which will look through all the folders and see if one contains a level.dat files

#

i know how to do it if i'm given a folder, but idk how to loop through all files

quaint mantle
#

mmm in my entity drop item event listener, how do i tell if the itemdrop was created by a player? so far i have
if(event.getEntity() != ???) but idk what the ??? is supposed to be

vale cradle
#

I think ItemDropEvent lets u get the player

digital plinth
#

do mob loot call the event also?

young knoll
#

The EntityDeathEvent has loot iirc

quaint mantle
digital plinth
#

does minecraft worlds have uuid

wide coyote
#

yes (World#getUID())

#

but the world's name is also unique, you dont need to use uuid

digital plinth
#

oh okie

echo basalt
#

Just use the seed

#

You can guarantee similarity without storing multiple longs or serializing the uuid

#

And ensuring the world is unique

ivory sleet
#

if two worlds have the same seed?

digital plinth
#

so theres this plugin called voidGenerator

#

it generates void worlds

#

is there a better method of making void worlds other than removing every block when a chunk is created?

quaint mantle
#

how 2 make tab compeletye

tame elbow
#

Using Creature Spawn Event is there an attribute that can be added to a creature such as setAfraid or setScared? To make the mob run away from you, kinda like when you hit a passive mob.

proud basin
tame elbow
#

says in the docs it sets what the entity will target

proud basin
#

What if you set the target to null?

tame elbow
#

That seems like it would just stop the entity from targeting anything

#

not sure though

proud basin
#

isn’t that what you want

tame elbow
#

Im trying to get the mob to run away from the player, Kinda Like when you hit a passive mob

proud basin
#

ah

quaint mantle
#
public class EntityDropItem implements Listener {
    @EventHandler
    public void onEntityItemDrop(EntityDropItemEvent event) {
        System.out.println(event.getEntityType() == EntityType.PLAYER);
        if(event.getEntityType() == EntityType.PLAYER) {
            event.setCancelled(true);
        }
    }

}
public class Main extends JavaPlugin {
    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(new EntityDropItem(), this);
        getServer().getConsoleSender().sendMessage("plugin ready");
    }

}

can someone tell me why true or false doesn't print whenever i drop an item or when a mob dies and drops an item?

torn oyster
#
                            Player closestRunner = null;
                            double lowestDist = 0;
                            for (MinigamePlayer speedrunner : speedrun) {
                                double dist = pp.getPlayer().getLocation().distance(speedrunner.getPlayer().getLocation());
                                if (dist < lowestDist) {
                                    lowestDist = dist;
                                    closestRunner = speedrunner.getPlayer();
                                }
                            }
                            if (closestRunner != null) {
                                pp.getPlayer().setCompassTarget(closestRunner.getLocation());
                                pp.getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(ChatColor.GREEN + "Pointing to " + closestRunner.getName() + " (" + Math.round(lowestDist) + "m)."));
                            }```
#

help lol

torn oyster
#

it only points to 1 person

#

there is probably a 10x more efficient way to do that

#

but oh well

quaint mantle
#

no, there weren't any errors

quaint mantle
#

b-but it isn't-

proud basin
#

How can a EntityType equal a player?

quaint mantle
#

the only thing it warns about is the permissions yml being empty

proud basin
#

since when was a player an entity

quaint mantle
#

I believe for a long while

quaint mantle
proud basin
#

Why was I never told this

torn oyster
quaint mantle
#

you can only track one player at once

torn oyster
#

yea

#

but i got super close

#

to the other player