#help-development

1 messages · Page 1851 of 1

gentle oriole
#

No. Just a plugin

spiral light
#

and just vanilla mc ?

gentle oriole
#

Paper

spiral light
#

client

gentle oriole
#

Vanilla

spiral light
#

like this msg there ?

gentle oriole
#

It does appear in the death screen

#

Yes

#

Then it disappears after a few secs

#

Like the text. Gone

#

But the You Died, Score, and the buttons still there

spiral light
#

hmm probably because it is not a translateable msg ^^

gentle oriole
#

I have sout it and Im sure it only runs once

spiral light
#

if your client has spanish as language it will show another death msg in death screen then default to everyone else on the server .... because it is a translateable msg (e.g. something like minecraft.player.dead.out.of.world)

gentle oriole
#

I'm running on English...

spiral light
#

yeah but you send a custom msg like "you died with the force of bad coding"

#

and this msg overwrites the vanilla behaviour of a translateable msg which is probably causing this bug

grim ice
#

and why is it getting overwriten

gentle oriole
#

I don't understand

#

How else could I code it so that it will be "translatable"

spiral light
grim ice
#

then why does it change

red sedge
#

how can i get the player's skull

spiral light
#

or mabye not vanilla

#

but its not working even without the playerdeathevent involved

#

@ivory sleet
guess your job to create a issue in the web now :p

#

tested on clean installed server without any plugins and the msg rly disappears after some seconds

gentle oriole
#

:)

#

I can now finally sleep

fierce quail
#

How can i manage to have an individual scoreboard and teams everyone can see? Teams are only visible to ones with the same scoreboard, but indivisual ones require different ones for very player?

ivory sleet
rustic mica
#

If i am using a forge-spigot hybrid, is it possible to get my item texture from there?

spiral light
spiral light
round elbow
#
   public static void storeParkourAttempt(Player p){
        UUID uuid = p.getUniqueId();
        String name = p.getName();
        String parkourAttempt = String.valueOf(ParkourAttempt.getAttempt(p));
        if (parkourAttempt != null) {
            DBObject obj = new BasicDBObject("uuid", uuid);
            obj.put("name", name);
            obj.put("ParkourAttempt", parkourAttempt);
            players.insertOne(obj);
            plugin.getServer().getLogger().warning(Parkour.prefix + "Successfully saved ParkourAttempt for player [" + name + "]! ");
        } else {
            plugin.getServer().getLogger().warning(Parkour.prefix + "Tried to store a ParkourAttempt for player [" + name + "] but player was not attempting? wtf??");
        }
    }

[ERROR] .... Could not pass event PlayerInteractEvent to MGZ-PARKOUR v1.0

java.lang.ClassCastException: class com.mongodb.BasicDBObject cannot be cast to class org.bson.Document (com.mongodb.BasicDBObject and org.bson.Document are in unnamed module of loader 'MGZ-PARKOUR-1.0.jar' @32b846c)

spiral light
gentle oriole
spiral light
#

that was just the first draft of the error ^^
i didnt want to write that plugins cause this

#

in vanilla mc the msg does not disappear - it disappears on spigot servers without any plugin

young knoll
#

Spigot papers

spiral light
#

xD

ivory sleet
#

I know nothing about your issue

young knoll
#

Why not

ivory sleet
#

Oh yes you’re right

young knoll
#

You’re supposed to be a mod smh

spiral light
#

yes exactly i am way to diverted

round elbow
#

I got it off of forums of 2020

#

spigot forums or something

ivory sleet
quaint mantle
#

Hi I am trying to make a plugin that makes passive mobs aggressive this is the code I have rn ```java
Entity Pig;

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

    if(sender instanceof Player) {

        Player player = (Player) sender;

        LivingEntity e = (Pig) Pig;
        e.attack(player);

    }

    return false;
}``` This seems like a really stupid way to do it so any suggestions to make this better? I dont even know if this will work
young knoll
#

Doubt it

#

You would need to mess with their pathfinders

grim ice
#

how can a pig attack

#

lmao

#

u have to change their pathfinder

trim crystal
#

Oink you

#

I'll need to make a custom mob in the future so it seems like a good time to ask lol.

To make custom mobs do I need to make a class that inherits from Entity.** or is there a simpler way to do so?

young knoll
#

That’s probably the easiest way

trim crystal
#

Thanks, just last time I touched spigot was in 1.8 library (around 2 years ago) so a lot changed and I forgot so much about Java XD

coral pilot
#

how to access mojang mappings?

chrome beacon
#

Check the release post for your version

rustic mica
#

In 1.12.2, the field amount in org.bukkit.inventory.ItemStack's constructor refers to the maximum amount of items a player can hold with one stack?

#

Like how snowball is limiting to 16 of each?

worldly ingot
#

No. It refers to the amount in that item stack

#

Its quantity

balmy coyote
#

Is there a way to slow down Baby to Adult growth? Like legit IRL hours?

coral pilot
young knoll
#

Keep reading

balmy coyote
# proven sierra Do it manually@

I was thinking of AgeLock + PersistentData of born Timestamp then a entity runnable and checking if "should" grow after the hours and then manually grow to adult?

gentle oriole
young knoll
#

It can be 1

worldly ingot
#

It can be one, yes. Meaning there would be one item in that stack. If it's zero, the stack disappears because there is none of that item

young knoll
#

And negative 1 causes the universe to implode

worldly ingot
#

Something like that

gentle oriole
#

Wait, what is the required age for a mob to be adult?

young knoll
#

Problem is age is only a short iirc

gentle oriole
#

0 becomes a adult. Youngest baby mob is -24000. I think you were thinking to hard. So you can make it so that it drops a XP Orb when the tick is -24000 ~ -1

spiral light
#

if method above not work you can handle it by yourself with PDC and checking randomly

gentle oriole
#

@balmy coyote

#

Can you setAge to -72000?

spiral light
#

if it is short then its -32767 or am i wrong ?

gentle oriole
#

Probably, Just multiply -72000 by the hours and you should be good.

gentle oriole
spiral light
#

out of my brain

gentle oriole
#

Prolly not

#

setAge accepts int values. So you should be fine

spiral light
mighty sparrow
#

A short is not an int

#

You would need to cast it

quaint mantle
#

Hello ! I would like to know if there is a guide on single-thread Minecraft, with informations on what is actually single-threaded, what can be multi-threaded, etc.
I was looking around the forum but I don't find any complete post about it.
If you have one, I would love to see it.
Thanks

gentle oriole
#

If for some reason it doesn't work, set the age to like -24000 and make a loop every 5 minutes to reset it, then maybe after a few hours, stop the loop and set the age to 0

balmy coyote
#

I need about 10-15 real hours

gentle oriole
#

Try to set a mob's age to -108000 and wait for 15 hours to see if itll work

mighty sparrow
#

Im not saying there isnt one

#

I just dont know

gentle oriole
#

Multithreaded rendering is possible...

chrome beacon
quaint mantle
#

Alright, I understand.

#

Thanks !

trim crystal
#

I think at least that random tick speed has the same effect in servers (not sure tho)

chrome beacon
#

Random tick speed is for crops and such not mobs

lyric grove
#

How would i have a foreach inside a filter?

vale ember
#

instead of forEach, convert actiontypes to stream, filter, and check if there is any item in it

split panther
lyric grove
#

Im trying to filter every action in a faction and check if that action's type equals a set list of actiontypes

split panther
#

yea

lavish hemlock
#

Streams are still quite slow tho

lyric grove
#

how else would i do it?

split panther
#

I believe stream is not slow by itself?

#

that code above would be O(N^2 ) though

waxen plinth
#

They're ~20% slower than a regular loop

#

Not "quite slow"

#

Enough that maybe you won't use it for something really performance critical

#

But generally not a big deal at all

ivory sleet
#

Hmm thought they could be almost as fast as a normal loop

#

also does that measure take parallel streams into account?

turbid crest
#

Hey 🙂 I have some troubles creating a plugin...
Im creating my Eclipse Java Project (I tried JRE 17 + JRE 1.8), and importing spigot server, but the JavaPlugin won't import

ivory sleet
#

Oo interesting

waxen plinth
#

Actually I will have to ask what score is

hardy valley
ivory sleet
#

Yea

spiral light
turbid crest
waxen plinth
#

I think you're reading the graph wrong my guy

ivory sleet
#

Red btw

#

Java sequences

#

What does that refer to

#

Just normal method composition?

waxen plinth
#

Kotlin sequences

#

They're a different library from streams

#

Ohh the Java sequences

#

Matt, who ran this benchmark, translated kotlin sequences to java

lyric grove
#

For the stream im using should i run it async?

#

or would it not impact performance much?

waxen plinth
#

Don't worry about it

#

That's my answer

lyric grove
#

ok thanks

hardy valley
# turbid crest I always used Eclipse, but if it's similar I can look it up

IntelliJ is the best IDE you can use for programming Minecraft Plugins or Java in general (this is not a stereotip or something). For Minecraft plugins you just install a plugin in IntelliJ's marketplace called Minecraft Development and then you create your project using "Minecraft" option. It's easy to use and efficient for team programming

waxen plinth
#

Unless it starts actually causing issues then you have no reason to worry

hardy valley
ivory sleet
vale ember
ivory sleet
#

So if your stream mutates some object which does not support concurrency updates and other stuff like volatility then it’s yeah
. meh

vale ember
#

just write code on paper, it's simple

eternal oxide
split panther
ivory sleet
spiral light
hardy valley
split panther
#

yall using computer?
I code in sand smh

eternal oxide
hybrid spoke
vale ember
hardy valley
ivory sleet
hardy valley
split panther
#

been using IntelliJ for 8 years, have not seem anything corrupted yet
some autocomplete cache mismatch? rarely, it's easily fix anyway

eternal oxide
ivory sleet
#

Once

#

But that’s due to maven and IntelliJ

#

Not solely IntelliJ

#

And one reason I stopped using maven (:

eternal oxide
#

If its 1-2 devs I prefer Eclipse. Larger teams InteliJ

hardy valley
#

To be honest it's because Eclipse is more known than IJ

#

plus it's overrated

eternal oxide
#

The only thing I dislike about Eclipse is it handling of nested modules.

vale ember
#

rly? eclipse is more known than IntelliJ?

#

never thought

hardy valley
#

Look I am not joking xddd

eternal oxide
#

I'd say IJ is more widely used. Eclipse is old school.

hardy valley
#

Yeah

ivory sleet
#

Personally I believe IntelliJ is better but yeah who cares what ide you use as long as doesn’t hinder you

mighty sparrow
#

Visual Studio 2019 is better with IKVM

#

Kappa

spiral light
#

just switched to intellij some weeks ago because of the "extract Method" function .... and some autocomplete stuff

hybrid spoke
#

still notepad

mighty sparrow
#

Notepad

hybrid spoke
#

u a bad dev if you need completion

mighty sparrow
#

You a psycopath

mighty sparrow
#

Thats not true

vale ember
#

anyone really remember the packages from where you import stuff?

hybrid spoke
spiral light
#

well there was a book that teaches how to code plugins using notepadd ^^

mighty sparrow
#

Laziness leads you towards easier solutions

#

Wtv

#

My teachers told me that being lazy helps a lot

hybrid spoke
#

or leads you to use the one that works but is very inperformant

split panther
#

yeah, instead of using autocomplete for 3 seconds, why not look up javadoc for a minute
efficiency am i right?

hybrid spoke
#

what are javadocs

mighty sparrow
#

You still gotta think trough your laziness

hybrid spoke
#

too much extra work

#

just dont be lazy

hollow delta
#

Is it possible to save a material to a HashMap? If so, how?

mighty sparrow
#

When I say lazy its like, preparing methods in advance (algos class) to not have to rewrite code each time. Look for already made methods in the libraries before making your own

hybrid spoke
paper viper
#

eclipse sufficed for my beginner needs but i grown out of it

ivory sleet
#

Pulse java tutorials :gimme:

paper viper
#

im actually teaching a java introduction course at my school

#

And i'm forcing them to use Intellij

#

🙂

#

gotta influence my students

ivory sleet
#

Noo way

#

Can you record

#

And

#

Push to yt

#

I mean publish

sharp bough
#

could i have a copy?

hollow delta
hardy valley
ivory sleet
#

Just copy paste lucas

copper scaffold
#

hoe can i load a custom created world?
does it work when it has at the begin world_build?

ivory sleet
#

it’s open source

sharp bough
#

oh its that easy?

#

just text?

ivory sleet
#

basically

hasty prawn
#

Isn't there a view raw for readmes

paper viper
#

I accidently made my java intro repo thing private

copper scaffold
#

load

paper viper
#

just realized

#

XD

hollow delta
sharp bough
spiral light
ivory sleet
#

Bulse!!

#

upload on yt when teach ppl or at least send to me

paper viper
#

Lol ill try

ivory sleet
#

I want to learn :3

paper viper
#

its 1 hr lesson for each one tho

#

gonna be large video file

#

XD

ivory sleet
#

Oo

#

You should make a spigot one also

hasty prawn
#

Pulse knows what he's doing he's not allowed to make Spigot tutorials

paper viper
#

So one of my students saw one of my spigot plugins

#

and hes like

#

"You code mc plugins? 👍 "

hybrid spoke
#

but its true

young knoll
#

Ooh that means I’m qualified

#

I don’t even know what’s a spigot

hybrid spoke
#

there rarely is a good tutorial for anything in minecraft dev

paper viper
#

Its a thing

#

u turn on

#

for water

mighty sparrow
#

You a tech teacher ?

#

Or outside of tech world

ivory sleet
ancient plank
#

roflmao

paper viper
#

Yep lol

ancient plank
#

roflcopter

young knoll
#

Then he called him a nerd and dabbed on em

ivory sleet
#

đŸ„Č

paper viper
#

I was like đŸ˜”â€đŸ’«

mighty sparrow
#

How do teacher code looks like

ivory sleet
mighty sparrow
#

Because spigot plugin people code are always messy

young knoll
#

The trick is to use all static

paper viper
#

don't look at my code

#

please

#

lmfao

ancient plank
#

looking rn

paper viper
#

its not what i want it to be

ivory sleet
#

it looks kinda good

paper viper
#

the plugin? not really

#

LMFAO

ivory sleet
#

Hmm

#

Well

ancient plank
#

amogus

ivory sleet
#

You should use guice (:

paper viper
#

i wanna rewrite it, but if i rewrite it, i get more bugs

ivory sleet
#

Hmm

paper viper
#

its like endless cycle

#

XD

ivory sleet
#

Test your code meme_moyai

mighty sparrow
#

You code plugins in Kotlin?

ivory sleet
#

kotlin kinda sloe hehe

paper viper
#

not plugins, i feel like kotlin is just smthing i do for fun once in a while

#

dont actually use it for any practical use even tho i should

#

learning golang right now

ancient plank
#

Coppers-Odds-Shoe-Raffle-Service

mighty sparrow
#

I do minecraft plugins for fun

#

I do kotlin for fun too

paper viper
#

that was like my first project

ivory sleet
#

Brb

mighty sparrow
#

I abandoned kotlin because of the nullables, it pissed me off

paper viper
#

i tried to fix it, then i wa slike

ivory sleet
#

what

paper viper
#

ugh

#

i give up

#

XD

ivory sleet
#

Kotlin null safety is the best thing the language offers

paper viper
#

I had both json simple

#

and gson

#

:kek:

ivory sleet
#

Most other features of kotlin are quite meaningless imo

ancient plank
#

sounds like smth I'd do

mighty sparrow
#

Cant I just do if(banana == null) return;

alpine urchin
#

as an official JSON developer i can kindly disagree with @ivory sleet

ivory sleet
#

Pulse that is enterprisy /s

paper viper
#

Opposite end of spectrum

paper viper
#

Lol

mighty sparrow
#

As an official potato dev, I can agree your disagree

ancient plank
#

wanna know what annoys me

alpine urchin
#

engrish

mighty sparrow
hasty prawn
ancient plank
#

gap in thing

#

you can see the hyperlink at the top because gap

paper viper
#

Lol

#

I dont wanna update it

#

cause if i do

#

people are gonna think its some big project

ivory sleet
#

Interesting things you hide inside of it

paper viper
#

i maintain

paper viper
ancient plank
#

lemme go find my first plugin

mighty sparrow
#

My first plugin is a playerloginevent

paper viper
#

😂

mighty sparrow
#

And says hello to the player

ivory sleet
#

Oh god

#

Lmao pulse

hasty prawn
#

Pulse LOL

mighty sparrow
#

Wtf is that

paper viper
#

XD

visual tide
ivory sleet
#

Pulse

mighty sparrow
#

Pulse

ivory sleet
#

You better fix that oopsie

#

Sorry for

#

Yes

paper viper
#

i think its the api token in the example

#

but idk

#

lol

ivory sleet
#

Oh lol

#

Good to go then

ancient plank
#

wanna see my first plugin I uploaded on github, very high quality tbh

paper viper
#

you will love this

ancient plank
hasty prawn
#

Player - sender NotLikeThis

young knoll
#

My first plugin kicked players for repeated naughty words

alpine urchin
#

i was following a tutorial

#

i didnt know why it wasnt working

young knoll
#

Except I’m pretty sure it was broken and just started kicking everyone

alpine urchin
#

i was raging

#

Why not work!! I copied perfectly

paper viper
#

i still do that but for other languages

ancient plank
#

"Doesn't work, fix later" common comment of all my code to this day

alpine urchin
#

thats why you learn atleast a but of java

visual tide
alpine urchin
#

forst

paper viper
#

dont you love all the try/catches

ivory sleet
hasty prawn
paper viper
#

quite surprisingly, it actually looks very well designed if u were a user

ancient plank
#

probably

paper viper
#

had a super nice login menu and starting menu

young knoll
paper viper
#

but it was shitty code

#

Lol

mighty sparrow
#

New year snack

ancient plank
#

halfway through trying to fix stuff I get annoyed so I make a large TODO block and never touch the code again

paper viper
#

sus 😳

young knoll
#

Can someone ban him

ivory sleet
mighty sparrow
#

Yo

paper viper
alpine urchin
hasty prawn
mighty sparrow
#

Learning a library before the language, only minecraft players do that

ivory sleet
ancient plank
alpine urchin
#

Someone using my library just tried printing a class

#

like

#

System.out.println(PacketEvents);

#

and asked me what was wrong

ivory sleet
alpine urchin
#

or did this

hasty prawn
paper viper
#

Lol

#

pro

alpine urchin
#

String player = (String) player;

#

ah yes

paper viper
#

you copied from the right place

ancient plank
#

mfw idk what that means

#

brain off moment

#

ur using large words ok

alpine urchin
#

then they got kinda hurt when me and my team directed him to learn java

#

we linked very specific links

buoyant viper
#

cyberbullies u for ur package name starting with an uppercase letter

alpine urchin
#

:c

paper viper
#

just means that it creates a new copy everytime you modify it (like after you define what it is, it can't change)

young knoll
#

?learnjava @everyone

undone axleBOT
alpine urchin
#

heartbroken

#

no i am good

#

u have bad library

paper viper
#

raging rn cause i cant find a way to crosscompile golang (with c-shared lib)

ivory sleet
alpine urchin
#

i could cross compile for mac and windows when i used linux

alpine urchin
#

with some helpful pckages

#

someone made an open source project

#

making it easier

paper viper
#

Golang can actually crosscompile to any os if you use pure golang

alpine urchin
#

but its for c/c++

paper viper
#

but if im compiling to a c-shared library

#

i cant do that

alpine urchin
#

ok

#

config issue

#

:) pov: ur a library dev

hasty prawn
alpine urchin
#

course not

ivory sleet
#

đŸ„Č

young knoll
#

I mean

#

The amount of plugins submitted that don’t work is surprisingly high

alpine urchin
#

Does 1.18.1 work

young knoll
#

No

alpine urchin
#

Ok

young knoll
#

I can’t judge, I updated my plugin to readd java 16 support

#

It didn’t work

alpine urchin
#

Sticking on 1.16.5 cause i heard 1.17 doesnt work

young knoll
#

1.16.5 doesn’t work either

tough field
#

Hello, could anyone tell me a way how to hide players on certain server? like auth...

alpine urchin
#

1.8 server for life

#

Has minecraft even worked

#

If no, I want refund

young knoll
#

No

alpine urchin
#

Since md_5 is owner of Minecraft

#

give refund

oblique geyser
#

Can i get info of a permission name? like Color.Red and get string Red?

alpine urchin
#

?

grand flint
#

How could I make a plugin that teleports players randomly into a base each, like for example in build battle they all get teleported to their own base

ivory sleet
#

You need an algorithm which determines the locations

oblique geyser
ivory sleet
#

then just pair each player with a location and teleport them

grand flint
#

Alright thank you

short wren
#

Does anyone know a way to make this code look cleaner? Basically multiple very simple events doing just slightly different things in a row

@EventHandler
public void onDeath(PlayerDeathEvent event) {
//some code
}

@EventHandler
public void onJoin(PlayerJoinEvent event) {
//some different code but still very simple one liner
}
// and like 3 more doing just that
quaint mantle
#

I wish someone would do this

ivory sleet
#

Exactly how?

#

Nms is fairly optimized

quaint mantle
#

its hard

alpine urchin
#

Basically rewrite the implementation of minecraft

quaint mantle
#

no proper docs

ivory sleet
#

oh yeah

alpine urchin
#

nms isnt an api

alpine urchin
#

use sponge

#

or sth

oblique geyser
ivory sleet
#

sponge uses nms too iirc

#

or well one impl of it does

quaint mantle
#

hmm interesting

alpine urchin
#

NMS is just mojangs code mainly

#

it defined how the server works

#

like entities

#

and everything

#

and on spigot implements bukkit’s interfaces for example

#

(api)

#

sponge afaik rewrote the server

#

NMS is just what we call spigot’s implementation

#

sponge has no mojang code

#

and minestom doesnt either

#

NMS isn’t an api, and actually shouldn’t be interacted with

#

thats why an API exists

#

I’m not saying Bukkit is the greatest, but NMS isn’t supposed to be one

ivory sleet
#

Well sponge has its api

buoyant viper
#

mixins my beloved

ivory sleet
#

Then SpongeVanilla just proxies and bridges it with nms

#

Then there’s also sponge forge if it’s for a modded server I believe

#

And just sponge

young knoll
ivory sleet
#

Yeah olivo forge veteran

ancient plank
#

spigotmc plugin jam when

alpine urchin
#

im actually working on my own server rewrite, no api yet but its a fun project

#

you guys should try it if you like tinkering around with packets

young knoll
#

Is it in python

alpine urchin
#

whoever mentioned nms being hard, could help you understand the protocol at a deeper level

ancient plank
#

i remember when I wanted to rewrite an alpha server jar

ivory sleet
alpine urchin
#

theres decent docs on rewriting a server

#

not the best but it gets you started for sure

#

encryption, authentication, packet processing and the packet sequence nicely documented

#

and on your journey you end up contributing to them

#

so its rlly great

paper viper
#

?pdc

buoyant viper
#

a godsend

oblique geyser
#

o thanks

ancient plank
ivory sleet
#

🌝

#

🌚

#

Btw @ancient plank

stone sinew
#

So this is probs more math then development but it still has to do with dev so lets see lol.

I need to craft a certain amount of bread, lets say 5. So bread takes 3 wheat to craft, so I would do 3*5=15 to give me the amount of wheat I need. How ever, I also want to be able to calculate the amount of bread I can make based on the number of wheat I have... I can get the number of wheat I have but the equation IDK.

Would it just be 15(number I need to craft) divided by amount (amount of wheat I have)? Ex; 15/8

ancient plank
#

I also want to be able to calculate the amount of bread I can make based on the number of wheat I have
just get the amount of wheat you have and divide by 3? kek? round down ofc?

ivory sleet
#

8/3 and then truncate the decimal value and that’d be 2 bread

#

Or if that was what you needed

stone sinew
torn vale
#

I want to display a text line under the players name, how can I do that?

#

Like the [DRAGON] here

ivory sleet
#

Technically an objective which is set to be displayed below name could work

#

if that’s a thing

torn vale
#

So, how can I do that? I didnt used spigot for like 6 months, so im sorry if I ask some stupid questions

ivory sleet
#

Actually nvm objectives only allow integers

#

You might need to use packets

young knoll
#

Packets are generally the go to

#

But you could do it with real entities and setPassenger

torn vale
#

Could I maybe do it with a armor stand? Idk how to use packets lol

ivory sleet
#

Yeah but it might be a bit laggy

spiral light
#

it is possible with the normal scoreboard for sure ....

young knoll
#

No, but some happen to work well

#

I think area effect cloud is the common one

torn vale
#

So, how can I do it without packets?

young knoll
#

Spawn an area effect cloud an stick it on their head

hybrid spoke
#

the title on that server should be clientside

young knoll
#

Don’t use 1.8

#

Problem solved

hybrid spoke
torn vale
#

noo

#

I need 1.8 lol

hybrid spoke
#

armorstand with marker

#

but that will stick into the head

#

i would suggest place them on the head of others via packets

#

but then the entities on their head will block them so you cant reach them. you will have to redirect any interactions

torn vale
#

Is there smth like a setup guide for packets? I never used it

hybrid spoke
#

probably many

torn vale
#

could you send one to me

karmic bear
#

https://www.youtube.com/watch?v=42kCLeYjfjE
I wanna attempt something like this as a plugin, and i know protocollib is used for floating blocks because furniture plugins use it as a dependency
but where can I find more info on how to create floating blocks and rotating/positioning them using protocollib?
not sure if its laggy though considering its probably a ton of armour stands

mellow edge
#

why when I break a block and try to drop terracota this message getts spammed: ```java.lang.IllegalArgumentException: Cannot drop air
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:git-Paper-103]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at net.minecraft.server.level.ServerPlayerGameMode.destroyBlock(ServerPlayerGameMode.java:400) ~[?:?]
at net.minecraft.server.level.ServerPlayerGameMode.destroyAndAck(ServerPlayerGameMode.java:354) ~[?:?]
at net.minecraft.server.level.ServerPlayerGameMode.handleBlockBreakAction(ServerPlayerGameMode.java:238) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handlePlayerAction(ServerGamePacketListenerImpl.java:1745) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.handle(ServerboundPlayerActionPacket.java:34) ~[?:?]...............

#

code:

spiral light
mellow edge
#
        for(int i = 0;  i < allValuesArray.length; i++) {
            if(block.getType() == allValuesArray[i]) {
                System.out.println(random.get(i));
                block.getWorld().dropItemNaturally(block.getLocation(), new ItemStack(random.get(i)));
            }
        }```
#

in block placed

torn vale
hybrid spoke
spiral light
spiral light
spiral light
mellow edge
hybrid spoke
mellow edge
#
            if(Material.values()[i] != Material.AIR) {
                int asd = rad.nextInt(Material.values().length-1);
                while(takenValues.contains(asd)) {
                    asd = rad.nextInt(Material.values().length-1);
                }
                    random.put(asd, Material.values()[i]);
                    takenValues.add(asd);
            }else {
                System.out.println("hi!");
            }
        }```
spiral light
mellow edge
#

oo

#

yeah

#

thanks

dusty kindle
#

Any java developers which would be ready to help me with learning java?

spiral light
#

?api

#

hmm

#

?learn

young knoll
#

?learnjava

undone axleBOT
hybrid spoke
#

close

dusty kindle
#

:o

#

Thanks

torn vale
#

help lol

tender shard
#

just add "" between the int and the chatcolor

mellow edge
#

so:

#
            if(!material.isAir()) {
                allValuesArray[i] = Material.values()[i];
            }```
torn vale
young knoll
torn vale
#

thank you

young knoll
#

No need to add random empty strings

torn vale
#

Okay, could someone explain me how I can register the scoreboard for everyone? I didnt used spigot for a while lol

hybrid spoke
#

in that case just register a new objective with health criteria

hybrid spoke
#

yep

young knoll
#

Items, entities, and block entities

#

Oh, and chunks

hybrid spoke
#

block entities?

young knoll
#

Mhm

oblique geyser
#

then its not useful in my case, i want to save color chat config

hybrid spoke
#

not offical

young knoll
#

What’s not official

hybrid spoke
#

the PDC for blocks

young knoll
#

No no

#

Block entities

#

Well yeah

tender shard
#

tile entities ^

hybrid spoke
#

ah

young knoll
#

Mojang calls them block entities

oblique geyser
#

i know i can use json or db, but

young knoll
#

Aren’t you saving to a player

oblique geyser
#

i think might be an easier way

young knoll
#

Pdc is very easy

#

But sure you can use json or a database or whatever

oblique geyser
#

but pdc is for items but can it be used in players?

young knoll
#

Items, entities, tile entities, and chunks

visual tide
#

is chunks pdc new

#

or why have i never heard of that

young knoll
#

1.16

#

So kinda

visual tide
#

hm ok

mellow edge
#

huh I must say that I made a random item drop plugin, and I must say that the code can confuse you very quickly

spiral light
#

wasnt there smth that let you implement the persistentdata - methods in your class and deserialize it with it and so on ?

young knoll
#

What?

oblique geyser
#

i love u now

#

xD

spiral light
# young knoll What?

something that allows you to directly convert your class into persident-data and back (serializer and deserialize)

young knoll
#

Yes

#

Make your own persistent data type

patent wadi
#

what is the proper thing to cast a sweet berry bush to so i can access its growth stage methods?

patent wadi
#

awesome, ty

shy forge
#

Does anyone know if permission groups are a part of Bukkit or just the permission plugins?

patent wadi
#

permissions plugins normally do all that

chrome beacon
#

Spigot does have the permissions.yml

shy forge
#

Ugh that's annoying. I wanna link in permission groups in my plugin. Is there any handy way of doing that or just write code for any potential perms plugin they may use?

chrome beacon
#

I do recommend a permissions plugin like LuckPerms though

shy forge
#

You know how in the essentials chat plugin, you can do a chat format based on a perm group name? Kinda trying to do that

chrome beacon
#

^

shy forge
#

Oooohh thanks

digital rain
#

heyy, how would i add custom player heads, like using uuids to get any possibly any head out there

young knoll
#

I think choco was working on an API for that, don’t think it’s merged yet

digital rain
#

hmm okay thanks :)

#

also since SKULL_ITEM is deprecated i use PLAYER_HEAD instead?

young knoll
#

Yes

paper viper
#

just use skullcreator

#

and for legacy

digital rain
#

hmm cool stuff

young knoll
#

fix 'aaaaaa'

golden turret
#

how could i check if a sound is similar to other sound?

#

not spigot btw

mortal hare
#

ah yes

spiral light
#

sound1.equals(sound2)

mortal hare
#
Caused by: java.lang.StackOverflowError
        at java.lang.invoke.BoundMethodHandle$Species_LL.<init>(java/lang/invoke/BoundMethodHandle$Species_LL) ~[?:?]
        at java.lang.invoke.BoundMethodHandle$Species_LL.make(java/lang/invoke/BoundMethodHandle$Species_LL) ~[?:?]
        at java.lang.invoke.BoundMethodHandle$Species_L.copyWithExtendL(BoundMethodHandle.java:253) ~[?:?]
        at java.lang.invoke.LambdaFormEditor.bindArgumentL(LambdaFormEditor.java:475) ~[?:?]
        at java.lang.invoke.BoundMethodHandle.bindArgumentL(BoundMethodHandle.java:97) ~[?:?]
        at java.lang.invoke.MethodHandles.insertArguments(MethodHandles.java:5161) ~[?:?]
        at java.lang.invoke.StringConcatFactory.prepender(StringConcatFactory.java:634) ~[?:?]
        at java.lang.invoke.StringConcatFactory.generateMHInlineCopy(StringConcatFactory.java:543) ~[?:?]
        at java.lang.invoke.StringConcatFactory.makeConcatWithConstants(StringConcatFactory.java:358) ~[?:?]
        at java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:99) ~[?:?]
        at java.lang.invoke.CallSite.makeSite(CallSite.java:315) ~[?:?]
        at java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:281) ~[?:?]
        at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:271) ~[?:?]
#

single alias in commands.yml

#

caused a memory leak

spiral light
#

cant see memory leak... just stackoverflowerror ^^

opal juniper
#

thats not a mem leak

mortal hare
#

stack is a memory storage type

#

so its technically a memory leak

opal juniper
#

no

#

absolutely not

mortal hare
#

Stack and Heap are the structures of how the OS handles memory

#

how it is not

opal juniper
#

memory leak is where memory is "leaked" and is kept locked away in wasted objects

#

nothing to do with an error

mortal hare
#

well leakage occured in stack memory

opal juniper
#

duh

mortal hare
#

im not mentioning Java Stack object here

opal juniper
mortal hare
#

Stack: The role of stack memory includes storage of temporary data when handling function calls

opal juniper
#

ik what the heap and stack are

#

@ivory sleet please help me here

mortal hare
#

How stack collision with heap is not an memory leak

ivory sleet
#

Hmm

mortal hare
#

ofc it could collide naturally but in this case its a memory leak

ivory sleet
#

Just catch the error
 solved

spiral light
#

i think your problem is not the "memory leak" its more the stack overflow that causes a memory leak - but thats still not the exception you get ...

mortal hare
#

lets just end this bs topic, i feel like Dwight from office trying to debate stupid stuff, which no one cares

#

i found my problem anyways. Solved

quaint mantle
#

how do I force the player to click?

young knoll
#

You can call swingMainHand

quaint mantle
#

how

red sedge
#

how can i make a player run a command

patent wadi
#

How do i get an object for a sweet berry bush? Someone said to cast it to ageable but its just saying its not castable to that. Does anyone know the class I should be using please?

young knoll
young knoll
patent wadi
quaint mantle
patent wadi
patent horizon
#

where can i find the jar that gets built from my gradle project?

fleet imp
#

I have Plugin.getConfig().getString(“ur mom”) saved as a var, but when I try to use it in a method, it says Cannot use non-static field in static contex. What does it meeeean

eternal oxide
#

Plugin is not a reference to your main plugin class

fleet imp
eternal oxide
#

then its impossible for you to have that error with that code, unless you put it in a static method

fleet imp
#

But thats what i dont get

#

No matter waht i do, the err is there

#

Nothing is static either

eternal oxide
#

?paste the method

undone axleBOT
fleet imp
#

?

eternal oxide
#

Your var is static or the method is

#

and no one can advise you further unless you show some actual code.

ivory sleet
#

He clearly knows better than us, so he’ll eventually manage just fine for himself

hollow bluff
spiral light
hollow bluff
#

It's not in my code

spiral light
#

and how do you write it ?

hollow bluff
#

I get a message through a string list from the config and send it in chat

spiral light
#

well the problem could be the config

red sedge
#

How do I set a block to a crop

#

with a location

spiral light
#

location.getBlock().setType(crop)

red sedge
#

setType uses a material

spiral light
#

yes... and a crop like carrot or potatoe is a material too

red sedge
#

doesnt store the data tho

spiral light
#

if you set the type you can modify the data after that with block.getBlockData

red sedge
#

and how do i do that

spiral light
#

location.getBlock().getBlockData() ?

red sedge
#

ya but how do i get the block data

spiral light
#

your question is bad

#

you want to modify the age of the crop with the blockdata right ?

red sedge
#

yeah

spiral light
#

Ageable age = (Ageable)block.getBlockData()
age.setAge(1..2..3....)
block.setBlockData(age)

red sedge
#

o

#

okay thanks

red sedge
spiral light
#

if the block is broken you will get no ageable data

red sedge
#

which will be?

spiral light
#

no age

#

do you want to break the block after setting ?

red sedge
#

Ageable age = (Ageable) b.getBlockData();
if (age.getAge() == 0)

#

if the block is broken

#

before this gets ran

opal juniper
#

it will probs either return null or throw an error

red sedge
#

so i should check if the age is null

spiral light
#

if the block isnt a crop you cant even get Ageable-Data

neat trellis
#

How to send actionbar?

spiral light
#

if the block is broken the block-type is already AIR

spiral light
neat trellis
#

1.18

red sedge
spiral light
#

player#spigot() has some stuff for that

spiral light
neat trellis
red sedge
#

got it

#

if (b == null)
return;
Ageable age = (Ageable) b.getBlockData();

spiral light
red sedge
#

yeah realized that

#

ill just check for air?

neat trellis
spiral light
#

bungee is default provided by the api ... there should be no error with this

opal juniper
spiral light
spiral light
#

i would say CAVE_AIR and VOID_AIR is also empty ^^

worldly ingot
#

It is, yes

#

Docs are slightly dated

spiral light
opal juniper
#

yes, but if you use isEmpty you dont have to deal with that stuff

neat trellis
spiral light
#

if its just outdated ok

sullen marlin
#

probably not using maven/gradle and imported the wrong jar

#

read the damn release post

#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar (download), or the contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

neat trellis
#

alright

spiral light
worldly ingot
#

That PR is just a lot is all

spiral light
#

and its cool ^^

#

was just wondering after 1 month of pure emptiness

north trench
#

Can u make custom item Id using plugins

neat trellis
worldly ingot
north trench
worldly ingot
#

If you register a new item on the server, how do you expect the client to understand what that item is or how to render it/let it behave?

#

;p

#

In comes client sided mods. Forge, Fabric, etc.

cinder bone
#

Well it is possible with Enchantments I think

worldly ingot
#

Barely

#

but enchantments != items

#

Enchantments are almost entirely server sided

west quartz
#

Hello, I want to create a plugin for 1.18, but imports don't work for the 1.18 jar file. When I import another version (1.17), the imports work, but they don't with the 1.18 jar. Any suggestions on what to do?

spiral light
spiral light
#

not simple enough

young knoll
#

K

#

Then handle the text yourself

spiral light
#

yeah yeah^^ i dont have a problem with this just pointed out whats the problem with custom enchantments is

late sonnet
#

but i can add more levels

young knoll
#

Weird

#

I guess the client just yeets the lore because it’s not a registered enchant, whether you localize it or not

late sonnet
#

yeah i think is like this.. many time since check NMS for try make support for this

sharp heart
#

anyone know if it is possible to enchant an head ? (to see the glow effect on)

late sonnet
#

its like set a item "glow" (its hardcoded in client side for item)

late sonnet
hollow bluff
#

Yo, I got this board.getTeam("lastdeath").setPrefix(ChatColor.translateAlternateColorCodes('&', "&f" + PlayerUtil.getLastDeath())); that updates the scoreboard, but when I update it with a player name, it says its above the char limit of 16 when thats not even possible. It's 1.8.8

sharp heart
#

the glow effect didn't appear

late sonnet
sharp heart
young knoll
#

Yeah some items just don’t render it

#

Blame Mojang

sharp heart
#

:(

hollow bluff
late sonnet
#

you ccheck the length of ChatColor.translateAlternateColorCodes('&', "&f" + PlayerUtil.getLastDeath())? or only for PlayerUtil.getLastDeath()

rough basin
#

I have no idea why is it not working

#

wait

#

ill send full screenshot

#

This is Config.yml -

hollow bluff
late sonnet
rough basin
late sonnet
rough basin
#

I will try it

#

Thanks

hollow bluff
young knoll
#

The color adds 2

#

I assume you have a space or something for the 3rd

hollow bluff
#

fixed it, its white either way without chat color

gleaming grove
#

Guys, is there any good API for spigot Unit testing? For now i'm doing tests by overriting spigot components but it's not very efficient approach

ivory sleet
#

MockBukkit

young knoll
#

Isn’t there another one too

gleaming grove
#

thanks for quick response

ivory sleet
young knoll
#

Something by mini

ivory sleet
#

That’s for integration tests

young knoll
#

Ah

ivory sleet
#

Ya bit different

gleaming grove
#

for integrations?? what's the name of that api?

ivory sleet
#

Just check minidiggers repos

#

Should be there

rough basin
#

It's Still not working now

#

config is nothing wrong i think

late sonnet
#

and you check data is not empty?

rough basin
late sonnet
#

the for in data its not necesary.. and you debug what print in entitytype and the data values?

ornate frost
#

So I have two plugins in one
Ones a bungee and ones a spigot
How could I access the plugins BUNGEE config.yml through the spigot side of the plugin?
Any help would be appreciated, thanks.

young knoll
#

You can just read it like a file

#

Plugin#getResource iirc

ivory sleet
#

Yeah in bungee its smtng similar

rough basin
young dome
#

Hey, would you be if we can assign multiple metadata to an entity?

young knoll
#

Yes

young dome
#

How? I did not find. By assigning it several like what if?

young knoll
#

You need a different string for each

young dome
#

So, if I do that it's good ?

young knoll
#

Should be

young dome
#

It's good thanks

quaint mantle
#

dose anyone want develop a network Minecraft server together dm if you want do something like that just please know how to speak English a little 🙂

young knoll
#

?services

undone axleBOT
lusty cipher
#

is there some event when an anvil lands on the ground?

gentle oriole
#

is there an event that fires and returns something like "PLAYER STARTED BREAKING" "PLAYER FINISHED BREAKING" "PLAYER CANCELLED BREAKING"

hollow bluff
#

Only for finished breaking, BlockBreakEvent

hybrid spoke
pliant tundra
#

anyone know how i can make a custom head?

worldly ingot
#

Please what? What did I do?

unreal quartz
#

choco plz

quaint mantle
#

đŸ« plz

young knoll
#

I think it was you anyway

#

The basic game profile API for skulls

hybrid spoke
#

who pinged me PingReee

unreal quartz
#

@hybrid spoke

hybrid spoke
#

@unreal quartz

unreal quartz
young knoll
#

That event is for interacting

#

If you want breaking, use the block break event

dusty sphinx
#

Does anybody know how to build TacoSpigot? I know it's a depreciated mess but I need it to build a plugin.

#

It says it's missing a module

young knoll
#

We aren’t tacospigot

gentle oriole
sullen marlin
#

Blockdamageevent

gentle oriole
quaint mantle
#

anyone know the quick way to hide things like

#

"+2 defense"

#

or whatever from an item

#

i forgot how to do it

#

last time i remember though there were like a few ways that were outdated and its plagued with old fixes

sullen marlin
#

Hideflags

rough basin
#

How can I modify arrows created with LaunchProjectile?

quaint mantle
#

also does anyone know how to check if an item's durability is at max

#

feel like this is also something thats changed sicne like 10 updates ago

#

nvm Material.getMaxDurability() exists got it

gentle oriole
#

how to I like wait for 5 seconds, but keeping the server running?

sullen marlin
#

scheduler

gentle oriole
#

anything other than a scheduler?

sullen marlin
#

why

young knoll
gentle oriole
young knoll
#

I mean

#

You can use java runnables I assume

#

But that’s basically the same thing

rough basin
#

Thanks

lavish hemlock
gentle oriole
#

java.lang.ClassCastException: class me.cwickks.firstplugin.Listeners cannot be cast to class org.bukkit.plugin.Plugin idk if im being dumb. but, how do I fix this?

#

I placed a bukkit scheduler inside a listener class

young knoll
#

You need an instance of your main class

#

?di

undone axleBOT
gentle oriole
#

I somehow managed to fix it by myself by getPluginManager().getPlugin("firstplugin")

young knoll
#

I suppose that works

gentle oriole
#

is it optimal tho?

young knoll
#

No

jagged monolith
gentle oriole
jagged monolith
#

Did you read that link the bot sent?

#

As it also gives examples of how to use it.

gentle oriole
jagged monolith
#

About what bit?

#

The Setting up dependency Injection section on that link explains it and gives a few examples of how to use it.

gentle oriole
young knoll
#

A class in your main class?

gentle oriole
#

a custom class that I can access in another class?

young knoll
#

No?

#

Does the guide say that

jagged monolith
young knoll
#

What

#

You just pass the plugin instance to the constructor of other classes

lavish hemlock
#

^

#

it's not that complicated

jagged monolith
#
public class FancyLogger {
    private final JavaPlugin plugin;

    public FancyLogger(JavaPlugin plugin) {
        this.plugin = plugin;
    }

    public void logRed(String s) {
        // accessing JavaPlugin's logger
        plugin.getLogger().info(ChatColor.RED + s);
    }
}
``` That literally shows what to do @gentle oriole (example from the guide)
#

Just read over the 3 code snippets it shows in the guide and add it for your plugin

wet breach
#

and this is why we don't skip the basics when learning 🙂

young knoll
#

To be fair “dependency injection” does make it sound complicated m

wet breach
young knoll
#

Yes

wet breach
#

there is indeed far more advanced DI

lavish hemlock
wet breach
#

to be fair I am pretty sure it is pronounced like juice XD

young knoll
#

Now I have the urge to make a super basic injector just for plugin instances

#

Just annotate a field with something and then pass an instance of that class to the injector

pliant tundra
#

how do i restrict a command to only operaters

young knoll
#

Give it a permission and only give the perm to ops

pliant tundra
#

where do i do that

young knoll
#

Or you could check isOp if you want to be messy

#

You can add permissions in the plugin.yml

#

And assign them to commands there as well

pliant tundra
young knoll
#

Set the default for the permission to OP

pliant tundra
#

what do i refer to op as

jagged monolith
#
permissions:
  essentials.*:
    default: op
    description: Give players with op everything by default

That's an example

unreal quartz
jagged monolith
#

but it's a lot more reading 😛

dark arrow
#

is there is any module related to armour stand?

young knoll
#

Module?

dark arrow
#

yah

#

whenever i write a code related to something my IDE Imports its modules for me

#

idk why its not happening for armour stands

young knoll
#

Modules?

nimble tiger
#

PLS GIVE ME RESOURCE PACK LINK

young knoll
#

You mean classes?

dark arrow
#

yah

#

something like that

young knoll
#

Just type ArmorStand and your ide should find it

dark arrow
#

yah i did

#

nothing is happing

pliant tundra
#

delete the d

dark arrow
#

suppose i type creeper it import its class

young knoll
#

I believe it’s org.bukkit.entity.ArmorStand

dark arrow
#

but its not happening for armour tands

young knoll
#

Note, armor not armour

#

Because merica

dark arrow
#

ok

#

my ide is dectectiong it as "armour stand" and not "armor stand"