#help-development

1 messages ยท Page 2192 of 1

opal juniper
#

so pull and fix the merge conflicts

jagged quail
#

ok its fixed now

urban kernel
#

hm

opal juniper
#

you probably edited it on github

jagged quail
#

i edited 1 file in github

opal juniper
#

there you go then

humble tulip
#

@jagged quail are u using mfnalex's updatecchecker?

jagged quail
#

yes

brittle lily
#

Hey Guys How Can I Set Material of GUI on config?

urban kernel
#

how

#

do

#

i

#

check

#

if

#

ags

#

are

#

present

paper viper
#

dude

eternal oxide
#

don;t spam

paper viper
#

type in a full message

#

smh

urban kernel
#

sowwy <3

paper viper
#

check if args.length is 0

urban kernel
brittle lily
#

remove "[0]"

eternal oxide
#

and the "" around 0

paper viper
#

You like rlly need to learn some java basics

#

sorry

jagged quail
#

working good now

paper viper
#

Like arrays should be one of the first things you learn

urban kernel
#

are java arrays the same as js arrays

paper viper
#

not really

#

lol

urban kernel
#

ah

urban kernel
#

how many = do i pit

#

put

tardy delta
#

git merge be like

jagged quail
#

this is meant to be an about command

urban kernel
#

its good

subtle folio
humble tulip
#

?learnjava @urban kernel

undone axleBOT
urban kernel
humble tulip
#

lmfao

#

nice

paper viper
urban kernel
#

chat flood

ivory sleet
#

lol pulse

paper viper
#

lol

paper viper
#

that isnt even proper syntax

#

lol

urban kernel
#

js

ivory sleet
#

class blocklist {
static void add(){}
}

#

:3

paper viper
#

smh

#

lmao

urban kernel
#
blocklist.add("347005619825278976")
ivory sleet
#

can we just like, drop js

#

a scummy language

urban kernel
#

shush

#

js > all

ivory sleet
#

you did not just ...

#

say t hat

urban kernel
#

if (args.length === "0") {

    }
paper viper
#

dude thats not even right

urban kernel
#

2 and 3 "=" throw err

paper viper
#

for java

#

please

#

actually learn some basic syntax

#

js is not java

brittle lily
urban kernel
#

i cant

#

idot

humble tulip
#

=====

brittle lily
paper viper
#

=== syntax isnt in java

urban kernel
brittle lily
eternal oxide
ivory sleet
#

well === is js is equivalent to == in java
and == in js is equivalent to Objects.equals() in java

jagged quail
#

i have my gross first fly command on github

eternal oxide
jagged quail
#

it used an arraylist

#

instead of hashlist

opal juniper
acoustic pendant
#

ik this is a basic java question, but I didn't have anywhere to ask...

how can I loop into an array and stop when an array is null?

eternal oxide
urban kernel
#

yeah i did

#

ty

jagged quail
#

@opal juniper want to see my horrible first fly command

opal juniper
#

sure

jagged quail
opal juniper
#

this Msg class is gross

#

and magic colour values ๐Ÿคฎ

ivory sleet
opal juniper
#

Just use a Set instead of an ArrayList

jagged quail
#

want to see the latest version

opal juniper
#

at least you are using the uuids not player refs

ivory sleet
#

when an element in any given array is null?

acoustic pendant
#

I mean

jagged quail
#

i'll actually go test it @opal juniper

acoustic pendant
#

I want to check if an array has a value

#

and if not do some thing

opal juniper
#

the logic seems like it shouldnt work

jagged quail
#

its alpha for a reason ๐Ÿคท

acoustic pendant
#

but if it has a value check the next

ivory sleet
#

oh

#

well linear search Ig

opal juniper
#

yeah

#

๐Ÿ˜ณ

#

what was that

subtle folio
#

what is a bStats **

paper viper
#

lol

subtle folio
#

my bad autocorrect

urban kernel
#

a stats websit

ivory sleet
#

||```java
T[] arr;

for (T element : arr) {
if(element == null) {
continue;
}

//TODO
}```||

urban kernel
#

websit

acoustic pendant
#

okay ty

urban kernel
#

it sits on the web

jagged quail
subtle folio
#

whatโ€™s it used for

opal juniper
#

collecting stats

#

lol

subtle folio
opal juniper
#

about your plugin

urban kernel
#

logging plug stats

subtle folio
#

oh lol

#

cool ig

opal juniper
#

like the users, where they are, what java ver, os info etc

subtle folio
#

i see i see

jagged quail
subtle folio
#

then i can sell the data to advertisers?

urban kernel
#

even my shit one doesnt

brittle lily
#

Can you guys suggest me plugins to make on middle level. I keep doing the same things.

opal juniper
subtle folio
#

cringe

jagged quail
subtle folio
#

make smt fancy

#

i got it

acoustic pendant
brittle lily
urban kernel
#

ChatColor is awful, why cant we use & colours

#

like &2,&c

subtle folio
#

ew

tardy delta
#

skips the code that comes after the continue

opal juniper
subtle folio
#

ru dumb

tardy delta
#

and goes to the next iteration ^

jagged quail
ivory sleet
#

oh yeah adri

subtle folio
#

lmfao

ivory sleet
#

im a dummy, you probably wanna break

tardy delta
acoustic pendant
#

k ty

#

๐Ÿ˜„

jagged quail
urban kernel
#
    Bukkit.broadcastMessage(ChatColor.GOLD + "[" + ChatColor.RED + ChatColor.GOLD + "]" + ChatColor.WHITE + args[0]);
crisp steeple
#

"&aSuccess".clr()

jagged quail
#
package me.oliver193.mecha;

import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;

public class Msg {
    public static void send(CommandSender sender, String message) {
        send(sender, message, "&a");
    }

    public static void send(CommandSender sender, String message, String prefix) {
        sender.sendMessage(ChatColor.translateAlternateColorCodes('&', prefix + message));
    }
}```
tardy delta
#

thats literally my util class from a year ago

jagged quail
#

all of my commands call to that Msg class

#

๐Ÿ—ฟ

urban kernel
#

nice

#

(?)

tardy delta
#

i've come to the point that im not storing a single string that will be outputted in the game

#

except for error messages

jagged quail
#

9 versions behind

#

๐Ÿ—ฟ

urban kernel
#

imagine sender.send

crisp steeple
#

fun String.clr(): String = this.replace("&", "\u00a7")

thorny dawn
#

uh

#

since when do custom mob names break their behavior?

#

i see skeletons fighting each other when changing their names

urban kernel
#

when console runs the command, what would sender.getName() return

jagged quail
ivory sleet
#

CONSOLE @urban kernel

jagged quail
#

lemme spin up a test server

ivory sleet
#

and if its remote, then Rcon

urban kernel
tardy delta
#

how would i go about getting data from multiple database tables in one method?

#

creating multiple statement and combing the data?

#

or is there something better

#

cant believe i still havent implemented this

urban kernel
jagged quail
#

ok test server is up

urban kernel
#

can u test my shit

#

i mean plugin

jagged quail
#

@opal juniper yes, the fly command works.

thorny dawn
#

how to check if cause of entitydamageevent is player?

humble tulip
#

if the damaged enetity is a player @thorny dawn ?

thorny dawn
#

im basically trying to disable pvp between players (allow for mobs)

#

im aware of how to get the entity type but event.cause doesnt have a type property

humble tulip
#

oh

#

well listen to entitydamagebyentityevent

#

check if the entity and damager are both players

thorny dawn
#

๐Ÿ‘

humble tulip
#

if they are then cancel

thorny dawn
#

ty

compact haven
woeful moon
#

Is there any way to get a player's IP from just the Player object, not the preloginevent?

tender shard
#

unless you're going for NMS

woeful moon
#

Okay

crisp steeple
minor otter
#

why does negative mining fatigue no longer work?

chrome beacon
#

Someone fixed it I guess

quaint mantle
#

someone know how to set a custom speed with the command? i do this but i know that this code doesnt working

minor otter
crisp steeple
crisp steeple
quaint mantle
#

i dont now i ty do something but I have no idea how to do it

native nexus
#

Itโ€™s between -1 and 1

crisp steeple
#

can you just make the player walk backwards then lol?

native nexus
#

Yes pretty sure

crisp steeple
#

thats funny

native nexus
#

Never tried it cause I am not a goober

#

But yes yes

modest shard
#

is there any way where you can get the enchants of an item in a crafting recipe

#

nobody knows ig

shadow gazelle
#

Would making a resourcepack that includes the translation for my custom enchantment? I registered it like a Minecraft enchantment.

odd adder
#

someone know how to get nbt from a CraftEntity?

shadow gazelle
#

Like an ExactChoice?

modest shard
#

like if i wanted to make a plugin to upgrade sharpness level

#

from 5 to 6, but i want to keep the enchants from the old sword, and just upgrade to sharp 6 if the sword being upgraded already has sharp 5

chrome beacon
shadow gazelle
odd adder
shadow gazelle
#

Would probably make more sense to do with an anvil

modest shard
shadow gazelle
#

yeah

modest shard
#

not ench books

shadow gazelle
#

:what:

tall dragon
#

can any1 suggest me the best way to store block data?, so i mean the block type and for example if its a directional the direction. and have this be serializable, deserializable?

will i need to write custom serialization for each block state?, so bassically every TileEntity?

shadow gazelle
modest shard
#

sure

#

upgrade stone

#

also i never figured out how to make crafting recipes require stacked items

shadow gazelle
#

you can't

modest shard
#

๐Ÿ’€

#

hypixel can

#

but their crafting table is different

shadow gazelle
#

Hypixel doesn't use vanilla crafting, they have their own system

midnight shore
#

Does setresult in craft inventory uses some sort of queue? Because when I set it it seems that it actually adds to a queue because if the slot is already filled with some items I need to remove them and then I see the new item

shadow gazelle
#

Well, okay, you can't in the recipe

#

but you could make sure the slot with that item has the amount you want and set the output as nothing until it has the amount you want

acoustic pendant
#

@ivory sleet sorry, i don't really know about arrays could you assist me a little bit?

chrome beacon
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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

shadow gazelle
#

For the things I don't think that are expensive enough, I just make compressed items/blocks

acoustic pendant
#

ehm sure

#

okay, so here i want to check if the array is null and if it is add the name of a player

#

but i don't know how to continue...

humble tulip
#

use a fori loop

#

not a for loop

acoustic pendant
#

fori?

#

for each u mean

modest shard
#

how would u get certain slots

humble tulip
#

for (int i = 0; i < members.size; i++)

acoustic pendant
#

oh

modest shard
#

just that u can do smth like

humble tulip
shadow gazelle
#

Why not?

#

Still works with primitives because it's still in an array

modest shard
#

what is he adding the name to anyways

humble tulip
#

cuz how would you know the index of the player u wanna add?

modest shard
#

why would u need the index

acoustic pendant
modest shard
#

all you need is the streing

#

string

#

u can just addd the names directly

acoustic pendant
#

maybe I can add them on a hashmap and then save the names in the file?

shadow gazelle
#

@acoustic pendant what are you trying to do?

acoustic pendant
#

uhm

#

a team system

modest shard
#

save the names to smth

humble tulip
#

how would u do members[index] = name?

acoustic pendant
#

but that when the server closes it doesn't get removed

shadow gazelle
#

@acoustic pendant how are they stored in the first place?

humble tulip
#
storage-slots:
  - '2:2'
  - '2:3'
  - '2:4'
  - '2:5'
  - '2:6'
  - '2:7'
  - '2:8'
  - '3:2'
  - '3:3'
  - '3:4'
  - '3:5'
  - '3:6'
  - '3:7'
  - '3:8'
  - '4:2'
  - '4:3'
  - '4:4'
  - '4:5'
  - '4:6'
  - '4:7'
  - '4:8'
  - '5:2'
  - '5:3'
  - '5:4'
  - '5:5'
  - '5:6'
  - '5:7'
  - '5:8'
#

does this look friendly to modify?

#

first num is row, second is slot

acoustic pendant
#

basically

shadow gazelle
#

Okay, can you backup and explain what it's doing and how?

#

It's teams for skyblock islands, I assume

acoustic pendant
#

yea

shadow gazelle
#

Whatever minion sent is confusing me

mystic vale
#

How can I define the main class with maven?

modest shard
shadow gazelle
#

you don't need to?

modest shard
#

like copy the name onto a string

#

and save it onto the config file

shadow gazelle
modest shard
#

cuz there aint no way ur saving the indices onto the config file

humble tulip
modest shard
#

i think adri wanted to store names right?

acoustic pendant
#

Yea, but i think i found other way

shadow gazelle
#

Maven doesn't care what your main class is, it just compiles the jar and manages dependencies

modest shard
#

add it to what

#

he never told us what he is adding the name to

mystic vale
shadow gazelle
#

what

humble tulip
#

@mystic vale i gotchu

#

one sec

modest shard
#

i never used maven ๐Ÿง“

humble tulip
#

you mean a class with public static void main?

shadow gazelle
#

why tf are you asking about that here, if that's your question

shadow gazelle
#

With Spigot plugins

#

not general java

humble tulip
shadow gazelle
#

yes?

#

And Bungeecord

humble tulip
#
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>your.package.here.Main</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
#

@mystic vale

shadow gazelle
#

@mystic vale are you trying to make a plugin or what?

humble tulip
modest shard
#

imagine using maven ๐Ÿคข

shadow gazelle
#

Imagine using Gr*dle

modest shard
#

even tho maven is techcnially better

humble tulip
#

lmao maven is good what are you on about

modest shard
shadow gazelle
#

Gradle is ass, or at least ForgeGradle is

modest shard
#

i dont use gradle

shadow gazelle
#

good

#

you're saving yourself from pain

modest shard
acoustic pendant
#

i think like this would work?

#

i'll try

modest shard
acoustic pendant
shadow gazelle
modest shard
#

ยฏ_(ใƒ„)_/ยฏ

shadow gazelle
#

Gradle is a pain in the ass

acoustic pendant
modest shard
#

or just in the add command check if the list is already 3

#

or wtv limit u want

shadow gazelle
#

@acoustic pendant can you please explain what your plugin is actually doing for loading and saving these values?

modest shard
#

some skyblock plugin

shadow gazelle
#

that doesn't help

modest shard
#

where he wants to have a group limit or smth

#

team limit

#

co-op limit

#

wtv

#

but idk what else he is trying to do

shadow gazelle
#

so don't do that when you save it?

modest shard
#

idk what he is trying to do either exactly

acoustic pendant
#

here

modest shard
#

hypixel skyblock ah and bz both down ๐Ÿ˜ญ

shadow gazelle
#

you already said that

#

that doesn't tell anyone anything new

acoustic pendant
#

but "name: FragsVoid"

#

just stores 1

modest shard
#

what r u trying to do exactly

acoustic pendant
#

cant really work with that

#

make a team system

shadow gazelle
#

exactly

#

Just explain what your code is doing up to this point

acoustic pendant
#

okay

#

so

#

the relevant thing, is creating the island

#

I have done that

#

and now instead of name: ... just storing 1 string

shadow gazelle
#

so get the player's name and store that when you save it?

acoustic pendant
#

i would like it to store for example 5 and be able to get that

acoustic pendant
shadow gazelle
#

Whatever you're doing makes no sense somewhere

acoustic pendant
#

hmm

#

why?

shadow gazelle
#

why are you saving invited players under the sender's UUID?

acoustic pendant
#

the sender's UUID in the "name" of each island

shadow gazelle
#

what

#

"is" or "in?"

acoustic pendant
#

is

shadow gazelle
#

why

#

would you store it like that

acoustic pendant
shadow gazelle
#

Make a UUID for new islands and save everything under that

acoustic pendant
#

different island

#

well

#

i could do that as well

#

but nothing changes

shadow gazelle
#

Your code makes no sense

acoustic pendant
#

it works

shadow gazelle
#

"it works" doesn't mean it's good

#

what is setHasIsland doing?

acoustic pendant
#

public void setHasIsland(Player player, boolean create) {
getCustomFile().set("hasIsland." + player.getName(), create);
save();
}

shadow gazelle
#

Storing values like that by a player's name is a terrible idea

acoustic pendant
#

uhm, why? I think is great

eternal night
#

I'll change my minecraft name real quick

#

๐Ÿ™

acoustic pendant
#

oh

#

that makes sense

#

uuid better?

shadow gazelle
#

yes

acoustic pendant
#

okay, i'll change that

#

done ๐Ÿ˜„

shadow gazelle
#

Are you saving island members in the island or in a separate entry?

acoustic pendant
#

I will create a section inside the island section wich stores the team except the leader

#

is that a great idea?

brittle lily
#

Hey Guys How can I add some property on Custom Food. For Example I'm making custom golden apple and How can run codes when player eat it.

shadow gazelle
#

You could do something like

islandUUID:
   bank: integer
   name: ""
   owner:
      uuid: uuid
      lastName: "" #if you want to pull it for some reason
   members:
     - memberUUID
     - memberUUID1

players:
   playerUUID:
      information:
   playerUUID1:
      informations:
acoustic pendant
#

yea

#

I know how to do all except the members thing

#

how are lists in configs done?

shadow gazelle
#

you should be able to just input a list

#

getList("path") is a thing

acoustic pendant
#

oh

#

so store it on a list and for example when the player leaves store it in the file?

shadow gazelle
#

You could do that, or update the stored list when a new member is added or a member is removed

acoustic pendant
#

but the server could be stopped before a new member is added

shadow gazelle
#

just update it every time someone makes island modifications?

fierce salmon
#

?paste

undone axleBOT
acoustic pendant
#

hmm

#

yea

#

okay so

fierce salmon
eternal oxide
#

never ignore errors

#

Cannot invoke "org.bukkit.inventory.Inventory.getTitle()" because the return value of "org.bukkit.event.inventory.InventoryClickEvent.getClickedInventory()" is null

acoustic pendant
eternal oxide
shadow gazelle
acoustic pendant
#

k ty

shadow gazelle
#

you should probably try to use shorter names

#

yaml already isn't the fastest and that's going to get slow if it gets big

acoustic pendant
#

oh

#

that makes sense

#

thanks!

shadow gazelle
#

you should also probably use different yaml files for storing different things

#

one for the actual config, one for players, and one for islands

#

just make a method to return the config section for them

acoustic pendant
#

this is the IslandManager file so i was doing all related to island there

shadow gazelle
#

Okay

acoustic pendant
#

Btw, what's the method to create a list in a file?

frail sluice
#

can I listen to block tick, eg. call a method for each hopper when it ticks?
(without saving a list of blocks or iterating over all the blocks)

ornate patio
#

i can give a horse admin permissions ๐Ÿค”

shadow gazelle
acoustic pendant
#

okay, thanks!

shadow gazelle
#
config().set("path", yourList);
crude cobalt
#

Does anyone have a json file to create a custom GUI for a double chest?

tranquil viper
tranquil viper
#

So what do I do within the method to make it do no damage?

iron glade
#

Which "method"?

tranquil viper
#

createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks)

iron glade
#

well

#

guess what you have to do

fossil lily
#

Is there a way that my program can log whenever a class is used? Im trying to find a problem in like 100 files.

clever musk
#

does Bukkit.getPlayer(args[1]) return valid if arg[1] is a uuid in string form?

clever musk
#

RIP

tranquil viper
#

getPlayer(UUID.fromString(args[1])

clever musk
#

Is there a method to return true if a string can be a valid UUID?

eternal oxide
#

Just test the length. If the string is 36 use a UUID. if less use the string

clever musk
#

Ok

tranquil viper
#

Or surround with a try catch (not my first choice)

tranquil viper
eternal oxide
#

or describe the issue so we can better advise

tranquil viper
#

^

#

Anyone got any hex color parsing methods

#

So I can just do &#fe28sjL

#

or something like that

limber owl
#

hello, does anyone know how to add more caves into 1.8 in worldcreator?

brittle lily
#

Hey Guys! How Can I remove death/join/achievement message from chat

limber owl
humble tulip
#

dont cancel

#

just set the message to ""

#

or null

brittle lily
#

Okay! thanks

humble tulip
#

i'm not sure if u can set it to null

tardy delta
#

set it to null or it will send an empty message

grim ice
#

since a string can be 36 letters and still not a uuid

tranquil viper
#

For example if you cancel the death event the player simply won't die

eternal oxide
tranquil viper
#

Or if you cancel the join event, the player cannot join

grim ice
#

i think you can use this regex:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

limber owl
#

oh no

#

regex

ornate heart
#

Is there any way with the spigot api to create a custom recipe that involves using a certain amount of ingredients to craft a certain item. I heard that the API only checks for material and not quantity. Is this true?

eternal oxide
tranquil viper
#

Custom crafting gui :p

ornate heart
#

time to make an API

tranquil viper
#

have fun

ornate heart
#

preciate it. I did in a previous plugin I just gotta abstract it to something people can actually use

round elbow
#

how can i effectively use permissions in 1.8.8 spigot plugin?

permissions:
  reports.*:
    description: grants every permission
    children:
      reports.mod:
        description: allows acceptance/deniable of reports
      reports.report:
        description: allows reports

im trying to do something like this in plugin.yml
but idk how to use it properly with commands
note: im using luckperms

frail sluice
#

is there a block tick event, that gets called for each tile entity, like a hopper, each tick?

quaint mantle
#
@EventHandler
    public static void onAttack(EntityDamageByEntityEvent edmg){
        Player sender = (Player) edmg.getDamager();
        sender.sendMessage(String.valueOf(edmg.getEntity()));```
How can i apply an effect (like poison) on the entity i damaged?
eternal oxide
ornate patio
#

will getTicksLived still count up if the entity is agelocked?

round elbow
#

thats it?

#

just add the check as first line of the command

frail sluice
# eternal oxide no

is there any alternative, that doesn't require saving a list of the blocks or iterating over all the loaded blocks?

round elbow
#

and luckperms does the rest?

eternal oxide
#

You add them into the plugin.yml under each command

limber owl
#

hello, does anyone know how to add more caves into 1.8 in worldcreator?

round elbow
#

well im registering commands

#

a little

#

differently

eternal oxide
#

if they are assigned to a command that command executor will not fire if the player doesn't have the permission

limber owl
quaint mantle
#
@EventHandler
    public static void onAttack(EntityDamageByEntityEvent edmg){
        Player sender = (Player) edmg.getDamager();
        sender.sendMessage(String.valueOf(edmg.getEntity()));```
How can i apply an effect (like poison) on the entity i damaged?
eternal oxide
#

The command map also has permissions

round elbow
#
public abstract class AbstractCommand extends Command implements PluginIdentifiableCommand {

    private final CommandParams params;
    private final CommandPermissions permissions;


    protected AbstractCommand() {
        super("");
        this.params = getClass().getAnnotation(CommandParams.class);
        this.permissions = getClass().getAnnotation(CommandPermissions.class);

        setName(params.name());
        setDescription(params.description());
        setPermission(permissions.permission());
        setUsage(params.usage().replace("<command>", this.params.name()));
        if (params.aliases().split(",").length > 0) {
            setAliases(Arrays.asList(params.aliases().split(",")));
        }
    }
@CommandParams(name = "report", description = "Allows player reports")
@CommandPermissions(source = CommandSource.IN_GAME, permission = "reports.report")
public class ReportCommand extends AbstractCommand {

heres an example
@eternal oxide

round elbow
#

checking which classes implement AbstractCommand

eternal oxide
#

it looks fine

quaint mantle
thorny dawn
quaint mantle
#

nope thats what ive been looking thru

#

addPassenger
addScoreboard mainly

quaint mantle
#

no potion effect, which is odd since the docs do say it can be applied on that entity so

thorny dawn
#

ignore the weird syntax im using kotlin

quaint mantle
#

am i stupid?

round elbow
quaint mantle
#

its not there for me

quaint mantle
#
 @EventHandler
    public static void onAttack(EntityDamageByEntityEvent edmg){
        Player sender = (Player) edmg.getDamager();
        sender.sendMessage(String.valueOf(edmg.getEntityType()));```
thorny dawn
#

edmg.getEntity() doesnt do anything?

quaint mantle
#

wdym?

thorny dawn
#

edmg.getEntity().addPotionEffect()

quaint mantle
#

gaddam i cant send screenshots

#

nope that wont work for me

thorny dawn
#

have u imported the spigot library correctly

round elbow
thorny dawn
#

what spigot version are u at?

quaint mantle
worldly ingot
#

That's part of LivingEntity

quaint mantle
#
LivingEntity damaged = (LivingEntity) edmg.getEntity();
        damaged.addPotionEffect()```
this works fine for me
thorny dawn
#

alright

#

maybe kotlin has some auto casting shit and it showed up for me

quaint mantle
#

thatd make sense

thorny dawn
#

yea

quaint mantle
#

is kotlin worth learning over java?

thorny dawn
#

it has some neat features that come out of the box and it looks a bit cleaner

#

ill show you

limber owl
#

?paste

undone axleBOT
limber owl
thorny dawn
#

you manage to get around from a lot of boilerplate java may create and its cool

thorny dawn
quaint mantle
#

ooh that does look nice

limber owl
quaint mantle
#
@EventHandler
    public static void onAttack(EntityDamageByEntityEvent edmg){
        Player sender = (Player) edmg.getDamager();
        sender.sendMessage(String.valueOf(edmg.getEntityType()));
        LivingEntity damaged = (LivingEntity) edmg.getEntity();
        damaged.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 10, 2));
    }```
this is my entire event, it doesnt add the potion effect on the ZOMBIE i just hit which is weird since it should
thorny dawn
quaint mantle
#

or not

#

im stupid, zombies cant get poisoned

thorny dawn
#

is the event registered?

tardy delta
#

people like unchecked casts

quaint mantle
#

yep, it is, it sends the entitytype in chat

limber owl
quaint mantle
tranquil viper
#

java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_18_R2.block.CraftBlock cannot be cast to class org.bukkit.block.Chest

player.getWorld().getBlockAt(airdropLoc).setType(Material.CHEST);
airdropLoc.getBlock().setMetadata("airdrop", new FixedMetadataValue(plugin, airdropLoc.getBlock()));
fillChest((Chest) airdropLoc.getBlock());
particilizeAirdrop(airdropLoc);

Why can't I cast the airdropLoc.getBlock() to a Chest, even though I set it to a chest one line earlier

thorny dawn
tranquil viper
#

It changes though

#

and I am changing the block

minor otter
#

is it possible to change parts of a lang file through plugin? like names of certain blocks and whatnot

tranquil viper
#

Actually I had to check if it was a chest even though I knew it was a chest

calm pilot
limber owl
tranquil viper
#

Sick

minor otter
tranquil viper
calm pilot
river oracle
tardy delta
limber owl
river oracle
# minor otter 1.18

I'd suggest checking out Iridium Chat Color API they have a pretty good thing going there. That way you don't have to spend any time setting it up yourself

tranquil viper
quaint mantle
river oracle
#

I use this personally I think its a good option

limber owl
thorny dawn
calm pilot
#

Is there a way to get the NBT data of an item in like a HashMap format? I'm making custom models for my plugin and i need the CustomModelData nbt tag of a Firework Star from an item.

limber owl
tranquil viper
#

Make a method to determine what blocks should go where

limber owl
kindred valley
#

how can i clear the console in java

calm pilot
quaint mantle
#
@EventHandler
    public static void onAttack(EntityDamageByEntityEvent edmg){
        Player sender = (Player) edmg.getDamager();
        sender.sendMessage(String.valueOf(edmg.getEntityType()));
        LivingEntity damaged = (LivingEntity) edmg.getEntity();
        damaged.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 10, 2));
    }```
anyone got a reason as to why this wont apply poison on a mob i hit?
calm pilot
#

Is there a way to get the NBT data of an item in like a HashMap format? I'm making custom models for my plugin and i need the CustomModelData nbt tag of a Firework Star from an item.

tardy delta
kindred valley
echo basalt
#

and it concerns me as to why you'd think to make a static void, specially for an event

#

also 10 ticks of poison is like 0.5s which won't be notable

tranquil viper
#

How do I spawn a firework particle?

sacred basin
#

Hello, can anyone suggest healing sound?

tranquil viper
sacred basin
#

Thank you

tardy delta
jade grove
#

hey im making a pickaxe plugin where if you mine a certain block, it gets added to a map. and im trying to show the amount of blocks broken on the lore, however the lore doesnt get displayed nor do you get a message saying you mined a block on event

#
@EventHandler
    public void onMine(BlockBreakEvent event) {
        Player player = event.getPlayer();
        Pickaxe pickaxe = Pickaxes.UUID_PICKAXE_MAP.get(player.getUniqueId());
        if (player.getInventory().getItemInHand().getItemMeta().getDisplayName().equals(("&6&lPickaxe"))) {
            final Material type = event.getBlock().getType();
            if(pickaxe.getOreMap().containsKey(type)) {
                pickaxe.getOreMap().put(type, pickaxe.getOreMap().get(type) + 1);
                player.sendMessage("You mined " + pickaxe.getOreMap().get(type) + " " + type.name());
            }
        }
    }```
calm pilot
#

did you register the event?

jade grove
#
private final Map<Material, Integer> oreMap = new HashMap<Material, Integer>() {{
        put(Material.DIAMOND_ORE, 0);
        put(Material.GOLD_ORE, 0);
        put(Material.IRON_ORE, 0);
    }};

    private final ItemStack pickaxe = new ItemBuilder(Material.DIAMOND_PICKAXE)
            .displayname("&6&lPickaxe")
            .build();

    public void giveItem(Player player) {
        this.update(player, 1);
    }

    public void update(Player player, int slot) {
        ItemMeta itemMeta = pickaxe.getItemMeta();

        itemMeta.setLore(Arrays.asList(
                Colorizer.colorize("&bDiamonds: " + oreMap.get(Material.DIAMOND_ORE)),
                Colorizer.colorize("&eGold Ingots: " + oreMap.get(Material.GOLD_INGOT)),
                Colorizer.colorize("&7Iron Ingots: " + oreMap.get(Material.IRON_INGOT))
        ));

        pickaxe.setItemMeta(itemMeta);

        player.getInventory().setItem(slot, pickaxe);
    }```
tranquil viper
#

I'm doing chest.getInventory().setContents(rewardContents); but it just ends up putting the items on the ground, any thoughts?

tranquil viper
jade grove
tranquil viper
#

PersistentDataContainer

calm pilot
#

Get the NBT of an ItemStack.

jade grove
tranquil viper
#

You can test it but the safest way to go would be to use pdcs.

#

I use it so often now that I know how to use it

#

It's very helpful

jade grove
#

ive never heard of this but ill see if this would change anything

tender shard
#

the pickaxe can be damaged

#

then it doesnt equals amymore

jade grove
#

would isSimilar work?

tender shard
#

no

jade grove
#

ig ill use pdcs then

tender shard
#

yes thar's the way to go ๐Ÿ™‚

jade grove
#

hold up

#

its a feature for newer versions right?

eternal night
#

pdc ?

tender shard
#

no

eternal night
#

pdc is 1.14

jade grove
#

oh

#

makes sense

#

im using 1.8

#

lol

tender shard
#

it exists since 1.14 so its quite old

eternal night
#

not really a newer version yea

jade grove
#

newer than 1.8

tender shard
#

no idea why you're using this almot 10 years old version

jade grove
tender shard
#

lol bullshit

jade grove
#

no

#

lol

#

want proof?

tender shard
#

everyone who's not totally stupid keeps up to date

tender shard
eternal oxide
#

Depends what you think "big" is

jade grove
tender shard
#

although no idea if I can load the link you*re going to send, I'm still using Windows XP

#

sorry but there's still big communities using WIndwos XP

jade grove
jade grove
tender shard
#

or you search "how to update minecraft" on youtube

#

yeah anyway, have fun in using 1.8

jade grove
#

some people just dont like the new style of pvp

tender shard
jade grove
tender shard
#

well both are based off people who cannot simply stay up to date

jade grove
#

and you being semi hostile doesnt help the point you're making

tender shard
#

yeah my bad sorry

#

I'm actually being a bit hostile

eternal oxide
#

I hate teh new combat, but I still use 1.18.2

tender shard
#

because I cannot stand persons using 8 year old MC versions

#

and still expect help here

#

it's weird

#

update to the latest version and you'll get proper information here

subtle folio
#

gamers, how do I also change the player's name color and not just its prefix with scoreboard teams?

tender shard
#

you can only use NBT tags if you keep staying on 1.8

jade grove
#

you couldve just said that then

#

instead of rambling on

tender shard
#

NBT isnt part of the API though and its version dependant

tender shard
#

if ask questions for a 10 year old version, of course people will tell you to update

limber owl
vocal cloud
#

Yes you should.

limber owl
#

๐Ÿคก

vocal cloud
#

You can use words instead of emojis if you're mentally capable of such

limber owl
#

you say that every server that makes 1.8 pvp should update to newest version so that they can make the pvp again, but on the newest versions that isn't possible

eternal oxide
#

In this channel we give support on the current (recent) version. It's up to each individual if they choose to give advice on older versions. Pretty much no one gives support on 1.8 anymore.

vocal cloud
limber owl
humble tulip
#

That's what i thought

limber owl
#

they probably have their own viaversions but the point stands

vocal cloud
humble tulip
#

Also allows newer vesions to join

limber owl
#

you may not see the cooldown in 1.8 but your hits are lower

vocal cloud
#

Except you can still do 1.8 pvp on 1.18. People just try to justify their use of an archaic version

limber owl
#

you're not making sense

limber owl
vocal cloud
#

So if a 1.18 client can use 1.8 mechanics you realize that means you can do 1.8 mechanics in 1.18 right?

#

Like you understand how programming works right?

limber owl
#

you can go backwards with functions but not forward, like you understand how programming works, right?

crisp steeple
vocal cloud
limber owl
vocal cloud
limber owl
chrome beacon
#

Who cares if they aren't there. You just don't send that to the client

vocal cloud
#

Yes but to make 1.18 work with 1.8 1.18 must be able to do the things you want from 1.8

limber owl
vocal cloud
#

What?

limber owl
#

the client have the cooldown, not the server

river oracle
#

:L

vocal cloud
#

Yet viaversion works?

limber owl
#

so you can't have 1.18 pvp server with 1.8 mechanics as the player have cooldown for attacking

chrome beacon
#

You can disable the cooldown

river oracle
#

I swear this channel is so entertaining sometimes

tender shard
#

I would have also left

tardy delta
#

grow up and stop pvping on 1.8 lol ๐Ÿ˜‚

crisp steeple
#

you can have 1.8 pvp on 1.18, and 1.18 pvp on 1.8. not really sure why this is being even argued since its just a fact

ivory sleet
#

you can set atk cooldown on items

#

which makes it seemingly 1.8

tender shard
#

some people just love to live in the past

river oracle
#

I don't think he is ever coming back

tender shard
#

brb gotta update my windows vista

#

oh NVM I CAN'T BECAUSE VISTA IS 10 YEARS OLD

limber owl
#

yes, because from 1.8 you don't have the cooldown, but in 1.18 you have, if server is 1.8 and client is 1.18 (using viaversions) have the cooldown and player requests the packet with it and recieves null it doesn't instantiate the variable, but if you have 1.18 and 1.18 it recieves the default from server, then asks plugin and see that it's 0 but because of latency it takes time, if you have 1.18 and 1.8 it never requests for that packet

limber owl
crisp steeple
river oracle
#

buzzwords are fun to use

#

can you blame em

chrome beacon
crisp steeple
#

hate it when i request a packet but its null and doesnt instantiate the variables

limber owl
vocal cloud
#

I just think it's a fundamental misunderstanding of a client-server relationship

tender shard
#

no support here for 10 year old MC versinos ยฏ_(ใƒ„)_/ยฏ

limber owl
crisp steeple
#

i have no clue what packets or variable instantiation or null values has to do with this

limber owl
vocal cloud
#

Yes because the internet cut out

tender shard
limber owl
limber owl
crisp steeple
#

player swings sword at player -> adds cooldown -> remove cooldown

#

so complicated

limber owl
tender shard
tender shard
limber owl
river oracle
#

those people are wack ๐Ÿ˜†

tender shard
limber owl
tall dragon
#

yea about 6.9 % of all servers are 1.8...

crisp steeple
#

how to simulate 1.8 pvp in 1.18:
remove cooldown when player hits someone

how to simulate 1.18 pvp in 1.8
add cooldown when player hits someone

vocal cloud
river oracle
limber owl
tall dragon
#

so a very, very small share

river oracle
#

yet its still 6.9% we can all do math here right?

limber owl
vocal cloud
#

No really?

crisp steeple
limber owl
minor otter
tender shard
vocal cloud
#

Your entire argument is 1.8 pvp cannot be replicated when it already has and the plugin(s) that have done it have 10s of thousands of downloads

eternal oxide
limber owl
river oracle
tall dragon
#

where are you getting 54689 from??

crisp steeple
#

but 6.9% = 6.9%

tender shard
#

just block this person already

vocal cloud
#

They're a redditor it makes sense

tall dragon
#

bruh

tender shard
tall dragon
tender shard
#

I'm a redditor too

crisp steeple
#

well a random reddit meme said it, so it must be true

limber owl
#

so there are even more

tender shard
#

Ihave more than 10k subscribers on reddit :< don't hate on redditors pls

tall dragon
#

bstats is much more accurate

#

not 100% but still

crisp steeple
#

as time goes by less servers use 1.8

humble tulip
#

There are 1.7.10 servers wtf

limber owl
crisp steeple
#

and where is that number coming from

tall dragon
#

i got 6.9% from bstats

#

its actually 7% now

river oracle
#

7% share using 1.8.8

tender shard
#

that's about 7% too much

river oracle
#

11,437 in the small minority vastly

vocal cloud
#

And the best part is 90% of them or more allow 1.18 users to play

limber owl
#

and now count avarage of 60 players per one of those servers

quaint mantle
#

How to create a NPC via ProtocolLib?

tender shard
#

also probably 90% of those servers have exactly 0 players online right now

vocal cloud
#

The average players on a server is close to 1.

limber owl
crisp steeple
#

prime example of sample bias

vocal cloud
#

I said average you average redditor lol

tender shard
eternal oxide
tall dragon
#

if you devide the current playing players by the amount of servers you get 0.8

#

hence there are a ton of servers with none online

limber owl
crisp steeple
#

also the reason hypixel is such a buggy spaghetti coded mess is probably because its in 1.8

eternal oxide
tender shard
#

people here don't like living in the past too long

crisp steeple
#

50% of players on a 1.8 server use 1.8. how shocking

ornate patio
#

I'm trying to "copy" information from one horse to another like so:

horse.setJumpStrength(normalHorse.getJumpStrength());
horse.setAge(normalHorse.getAge());
horse.setEatingHaystack(normalHorse.isEatingHaystack());
horse.setStyle(normalHorse.getStyle());
horse.setColor(normalHorse.getColor());
...

what is "memory" of an entity, and how would I copy it over to horse from normalHorse?

limber owl
eternal oxide
#

Arguing over. questions are asked

limber owl
crisp steeple
#

yes??

river oracle
#

thats ah

crisp steeple
#

what is your point here

quaint mantle
#
inv.addItem(item);

is there a way for me to choose which slot this item goes into?

river oracle
limber owl
#

from 10 versions 50% of players still use 1.8

quaint mantle
#

oh lovely i forgot about that

crisp steeple
#

because its a 1.8 based server...

river oracle
#

I usually play on the core version as its the least buggy always

#

no exceptions

tender shard
tender shard
#

can you pls stop sending weird hypixel png files

tender shard
#

canyou pls stop sending ANY links

#

this channel is to ask questions about developing plugins

tall dragon
#

still is also not official.

tender shard
#

you are just spamming this channel

limber owl
#

can you just accept the fact that you're wrong?

limber owl
river oracle
tender shard
vocal cloud
#

You probably have to add your server to that list so it's probably not even complete

tender shard
#

noone uses 1.8, confirmed

crisp steeple
#

๐Ÿ’€

ornate patio
#

why is politics hapenning in here lmfao

limber owl
ornate patio
#

im tryna get some spigot help

tender shard
river oracle
#

bstats has more servers

#

and reflects about the same distrobution

crisp steeple
eternal oxide
tender shard
#

just block this person already

ornate patio
#

only reason i use 1.8 is for pvp

tender shard
#

saves much time

ornate patio
#

but like i dont see the argument

river oracle
#

Only use 1.8 on hypixel because thats the core version

vocal cloud
#

1.18 has similar pvp if you want it to. Also 1.8 pvp sucks cause low skill. Kek

tender shard
#

1.8 pvp is just "who clicks the fastest"

#

1.8 is pvp for noobs

ornate patio
#

i like 1.8 pvp but thats personal preference

river oracle
humble tulip
#

I use 1.8 to test plugins that don't need new api stuff cuz the serber loads so quick

ornate patio
vocal cloud
ornate patio
#

also about extending your reach by w-tapping or keeping ur sprint by strafing

river oracle
ornate patio
#

most servers ban drag clickers

#

it is unfair

humble tulip
#

What is drag clicking?

river oracle
#

abusing a shitty mouse

ornate patio
#

yeah

humble tulip
#

I dont understand

ornate patio
#

you drag your finger downward across your mouse and it like "bumps" up and down 100 times per second

humble tulip
#

Lmfao

ornate patio
#

and you hit 100cps by just moving your finger down your mouse

grim ice
ornate patio
#

it only works on specific mice

tender shard
#

michael scott is the best macgyver ever, change my mind

grim ice
#

i code mods with forge 1.8.8 if that counts

river oracle
#

O.O

humble tulip
#

I never made a mod

river oracle
#

I haven't either

#

mod APIs are too complex for me atm still I rather learn something easier like spigot till I get a lot better at java

ornate patio
#

i would like to get into modding but i dont have any projects

quaint mantle
#

this is awfully specific but how can i create a random amount of items with each item being random as well, these items will go into a chest too, i have a method in mind but itd take a while

chrome beacon
#

Modding in modern versions really isn't that hard

humble tulip
#

I'm probably experienced enf to make a mod, i just don't care to

ornate patio
#

same

humble tulip
proper notch
#

You can filter by Material#isItem for that list.

quaint mantle
chrome beacon
ornate patio
#

what's the difference between Entity#setPersistent and LivingEntity#setRemoveWhenFarAway

grim ice
crisp steeple
#

oh god

ornate patio
#

pls go talk in general lmao

crisp steeple
#

not again

quaint mantle
#

i know a guy who never moved on past 1.8

ornate patio
#

#general or something idk

quaint mantle
#

he still doesnt know what elytras are

grim ice
#

lol

tardy delta
grim ice
ornate patio
#

oh okay

#

thanks

#

also how do i get and set a horses speed

#

i figured out jump strength but speed is weird

tall dragon
#

Attributes

tardy delta
ornate patio
#

thanks

tender shard
#

mcmmo's discord sucks so hard

#

and not in the good way

humble tulip
#

is it bad that i made a class with a constructor that accepts 12 things?

#

we'd have to see your code to tell u that

humble tulip
#

just so it's easier to read, still need to pass all 12 things in

eternal oxide
#

a builder model may be cleaner

#

do all 12 really have to be declared?

humble tulip
#

yep i need all 12

eternal oxide
#

none can be a default and only set if different?

humble tulip
#

yessish?

#

i get it from a config

tardy delta
#

i hate constructors with a large amount of params

humble tulip
#

hence why i'm asking this

#

i made a class that holds all the menu items and pass those in

eternal oxide
#

if it comes from a config you could instead pass a config path/instance reference in the constructor instead

humble tulip
#

it's for a configurable menu

humble tulip
#

i think ur builder idea is actually genius

#

ill throw an exception if everything isnt set

eternal oxide
#

sounds better than a 12 arg constructor ๐Ÿ™‚

humble tulip
#

yeah lol

#

well now its down to 7

somber hull
somber hull
odd adder
#

this is my code , i want to get nbt from player , but it print {} , is there any thing i understand wrong?

@Override
    public void onEnable() {
        getLogger().info("onEnable is called!");
        Bukkit.getScheduler().scheduleSyncRepeatingTask(this,()->{
            List <Entity> entities = new ArrayList<>();
            List <World> world_list = Bukkit.getServer().getWorlds();
            for (World world : world_list) {
                entities.addAll(world.getEntities());
            }
            for (Entity entity : entities){
                if (entity.getType() == EntityType.PLAYER){
                    System.out.println("test");
                    getNBTFromEntity(entity);
                }
            }

        },0,2);

    }
    @Override
    public void onDisable() {
        getLogger().info("onDisable is called!");
    }

    public void getNBTFromEntity(Entity target){
        CraftEntity entity = (CraftEntity) target;
        CompoundTag nbt = new CompoundTag();
        entity.getHandle().save(nbt);
        System.out.println(nbt);
    }```
#

i think at line 28 , it should save entity's nbt to CompoundTag nbt
at line 29 , it should print entity's nbt out
but it gives me {} ,a empty CompoundTag

somber hull
#

Idk what your doing

#

Y not use persisdentdata

#

I canโ€™t spell

hybrid spoke
#

presidentdata

eternal oxide
#

There will be no online Players when onEnable runs, unless its a reload

somber hull
#

@odd adder use persistent data also use like Bukkit.getOnlinePlayers() or whatever it is on a command