#help-development

1 messages · Page 1635 of 1

main dew
#

a you bad understand

ivory sleet
#

?

main dew
#

wants gravel as a block

silver shuttle
#

WorldGuard has a method to stop it i think

#

Might look into that

main dew
#

didn't change into Falling block

main dew
silver shuttle
#

lemme test rq

ivory sleet
#

Do you want to prevent falling blocks from naturally falling?

silver shuttle
#

yes he does

main dew
#

but no as entity (as block)

ivory sleet
#

Yeah okay

#

Well you could set the blocktype without applying block physics

main dew
#

wants the block placed by the player to have no physics

ivory sleet
#

cancel BlockPlaceEvent and set the type to the placed block’s one

#

Maybe?

silver shuttle
#

should still update it

main dew
silver shuttle
#

also worldguard doesnt have a flag for physics i just saw

#

and water flow disabling doesnt work with worldguard

stone sinew
main dew
main dew
ivory sleet
#

oo yeah yapperyaps suggestion is probably the goto

stone sinew
main dew
main dew
#

blocks fall when you place them (but they don't fall when you destroy the block next to them)

paper geyser
#

you could add {NoGravity:1} to the nbt of the falling block

stone sinew
paper geyser
quaint mantle
#

What path is this meant to be?

#

For

#

Maven > Executable file

#

it says value of 'maven.executable.preferMavenWrapper'.

stone sinew
# main dew blocks fall when you place them (but they don't fall when you destroy the block ...
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockPhysics(BlockPhysicsEvent e) {
    if(e.getSourceBlock().getType() == Material.SAND)
        e.setCancelled(true);
} // This event isn't needed
    
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onEntityChangeBlock(EntityChangeBlockEvent e) {
    if(e.getEntityType() == EntityType.FALLING_BLOCK) {
        if(e.getTo() == Material.AIR && e.getBlock().getType() == Material.SAND) {
            e.setCancelled(true);
            e.getBlock().getState().update(false, false);
        }
    }
}
```https://www.spigotmc.org/threads/prevent-sand-from-falling-upon-placing-sand.133386/
stone sinew
main dew
stone sinew
main dew
main dew
#

give me moment

main dew
stone sinew
reef wind
#

@main dew speak human please

main dew
#
[22:11:22 INFO]: PACKET WRITE: net.minecraft.server.v1_12_R1.PacketPlayOutBlockChange@197d5e18
[22:11:22 INFO]: PACKET WRITE: net.minecraft.server.v1_12_R1.PacketPlayOutBlockChange@3de102b9
[22:11:22 INFO]: PACKET WRITE: net.minecraft.server.v1_12_R1.PacketPlayOutBlockChange@436780d
[22:11:22 INFO]: PACKET WRITE: net.minecraft.server.v1_12_R1.PacketPlayOutSpawnEntity@49b6defd
[22:11:22 INFO]: PACKET WRITE: net.minecraft.server.v1_12_R1.PacketPlayOutEntityMetadata@3a48c44d
[22:11:22 INFO]: PACKET WRITE: net.minecraft.server.v1_12_R1.PacketPlayOutEntityVelocity@f89fd77
[22:11:22 INFO]: PACKET WRITE: net.minecraft.server.v1_12_R1.PacketPlayOutBlockChange@38c81a9b
[22:11:22 INFO]: PACKET WRITE: net.minecraft.server.v1_12_R1.PacketPlayOutEntityDestroy@47767a49```
main dew
quaint mantle
#

a

stone sinew
main dew
#

but see one event send packet how I place only one block

stone sinew
#

So I still really don't see what you want to do...

main dew
#

on start send to player
packet to set block,
packet to set block,
packet to idk xD
packet to spawn entity
packet to set Metadata entity
packet to set Velocity entity
packet to set block
and packet to destroy entity

stone sinew
#

Well if you are using packets just send a setblock packet with sand.... That wouldn't make the block fall unless you sent a falling block packet

main dew
#

but see how many packets send to player when he set only one block gravel

main dew
#

and this block for the server does not exist for some time, which in my case is also very harmful

unreal quartz
#

when is a plugin actually marked as enabled?

eternal oxide
#

after onEnable completes without error

main dew
stone sinew
stone sinew
unreal quartz
#

I have a plugin softdepending on papi, my assumption is that papi would have fully been enabled by the time my onenable is called, however some users have been reporting that the papi specific features havent been enabled whereas others have

#

I think there may be some sort of inconsistencies or changes from spigot to paper

main dew
stone sinew
eternal oxide
#

only depend will force your plugin to load/enable after a depend

stone sinew
#

So whats the issue?

main dew
main dew
unreal quartz
quaint mantle
#

Hey, I'm pretty sure I've correctly assigned variables for my maven install but mvn -version still doesn't work.

eternal oxide
#

softdepend doesn;t affect load order, it only check if the dependency is there

stone sinew
main dew
#

he wants this block not to be created and not just to prevent it from happening

#

I don't want the server to create a falling block

unreal quartz
#

depend prevents the plugin from loading if a dependency doesn't exist, i'm using softdepend as the dependency is optional

#

I'll just check if the plugin exists a different way

eternal oxide
stone sinew
unreal quartz
#

should probably update the wiki then

main dew
eternal oxide
stone sinew
unreal quartz
stone sinew
eternal oxide
unreal quartz
eternal oxide
#

load = class is instanced and onLoad has run. Enabled = all of teh obove and onEnable has run

main dew
stone sinew
unreal quartz
#

realise that moving the logic to onLoad is likely a bad idea as many plugins only set themselves up within onEnable

eternal oxide
main dew
unreal quartz
#

yep

stone sinew
unreal quartz
#

and i cant check if it is enabled as that is not a guarantee

main dew
#

it is a pity that the problem could not be solved

eternal oxide
unreal quartz
#

only thing i can do is check if it exists but that also means if there was a problem starting up then my plugin will throw a fit as it cannot use the dependency

torn shuttle
#

yep I knew it, this was a mistake

#

I've created a monster

stone sinew
eternal oxide
unreal quartz
#

yes however I need to use the classes within the plugin

#

there is no guarantee that the plugin has even set itself up yet or if it did so successfully

main dew
unreal quartz
#

i;ll try it on the first server tick instead

eternal oxide
#

if it exists in your onEnable its main class is instanced. Just store a reference to teh plugin, then do all your enablign for that plugin 1 tick later

stone sinew
stone sinew
eternal oxide
#

thats not going to be much use at startup

unreal quartz
#

i've moved it to the first server tick instead, only problem is that i could never replicate the bug in the first place so i now just have to pray that nobody opens another issue

stone sinew
#

Why does Inventory.setItem() cause so much lag?

chrome beacon
#

How many times are you calling it 👀

stone sinew
#

54

covert valve
#

calls updateInventory iirc

#

which is slow

quaint mantle
#

does eco have FastInventory

opal juniper
#

xD

stone sinew
#

Its actually the skulls that cause the issue... I have 4 skulls in the inventory why would they cause that much lag?

quaint mantle
#

dont they call the API

stone sinew
#

Yeah they do but the item is already created. I don't see why it would need to call it...

worldly ingot
#

afaik it has to fetch it at least once when you actually have it as an item

unreal quartz
#

how do you set the profile data? in a lot of cases it will make a request if it does not exist before

worldly ingot
#

You can create the ItemStack all you want, but the item when it's set in the inventory still has to be cloned as an NMS stack

stone sinew
stone sinew
#
@SuppressWarnings("deprecation")
public ItemStack createSkullItem(String username) {
    ItemStack head = new ItemStack(Material.PLAYER_HEAD);
    SkullMeta headMeta = (SkullMeta) head.getItemMeta();
    
    if(username.startsWith("MHF")) {
        headMeta.setOwner(username);
        head.setItemMeta(headMeta);
        return head;
    }
    
    GameProfile profile = new GameProfile(UUID.randomUUID(), null);
    byte[] encodedData = username.toLowerCase().startsWith("base64:") ? username.split(":")[1].getBytes() : getPlayerSkullTexture(getUUIDFromUsername(username)).getBytes();
    if(encodedData != null) {
        profile.getProperties().put("textures", new Property("textures", new String(encodedData)));
        Field profileField = null;
        try{
            profileField = headMeta.getClass().getDeclaredField("profile");
            profileField.setAccessible(true);
            profileField.set(headMeta, profile);
        }catch(NoSuchFieldException | IllegalArgumentException | IllegalAccessException e){
            e.printStackTrace();
        }
        head.setItemMeta(headMeta);
        return head;
    }
    return head;
}
fluid cypress
#

if i have a loop in which i load chunks, i do stuff, and the loop never stops (not for a long time), the garbage collection will never run? is there any way i can force the garbage collector to run?

fluid cypress
#

that will delete all unused objects instantly?

#

i mean, stop everything and delete those objects, and then continue

quaint mantle
#

Hey there! I would like to insert a word in white color inside a text without changing the rest of the color; How could I do so?

opal juniper
#

everything it is safe to

quaint mantle
#

for example

fluid cypress
#

or is it threaded or something like that

quaint mantle
#

I add a §f behind the heart

#

but then the rest of the messages is white too

#

how could I know the previous text color and add it after the code?

opal juniper
chrome beacon
#

You should never call the gc directly. Just remove any references to your objects and it will take care of things for you

opal juniper
#

^

#

this

tacit storm
stone sinew
tacit storm
#

Thank you

stone sinew
stone sinew
chrome beacon
#

Creating GameProfiles is slow. Cache them if possible

stone sinew
#

Ill cache them though for future use thanks

fluid cypress
#

or at least thats what i understand

#

how can i get the free memory?

chrome beacon
fluid cypress
#

then why isnt it running

#

and its giving me the out of memory error?

chrome beacon
#

Are you keeping the refrences somewhere

fluid cypress
#

im not storing those CompletableFuture objects anywhere

chrome beacon
#

Show your code

fluid cypress
#

all the PaperLib.async stuff is not really async

#

unless youre running paper ofc, in paper i have no problem, the out of memory error only happens in spigot

chrome beacon
#

Pretty sure Minecraft is going to keep the chunks loaded until the next tick or smth

#

I'd force them to unload if you forced them to load

fluid cypress
#

yea i thought about that

#

but, is there any way to force them to unload?

#

didnt know that

chrome beacon
#

Yeah just call unload on them

fluid cypress
#

let me try now

#

is the time it takes to allocate CompletibleFuture objects negligible or considerable? should i not use CompletableFutures if im in spigot, and only use them in paper?

#

with two different methods

unreal quartz
#

why would it be faster on paper

#

unless you're doing 100,000,000 allocations a second then you can consider it negligible

fluid cypress
#

i dont need to use completableFutures on spigot, thats what i mean

unreal quartz
#

why not?

fluid cypress
#

so, using them anyways, will be a problem?

hybrid spoke
#

ofc. not

unreal quartz
#

you don't need to use completablefutures on paper

hybrid spoke
#

just if you use too many

fluid cypress
#

because nothing is done async in spigot

unreal quartz
#

oh you mean using the paper api then

fluid cypress
#

yes

#

PaperLib uses the paper api, unless youre in spigot, then it does everything sync

#

or something like that, idk

unreal quartz
#

the overhead from paperlib would be incredible minuscule and negligible

fluid cypress
#

and from the completablefutures

#

ok then, good

unreal quartz
#

if there was a significant problem with CompletableFuture then i am sure nobody would be using them

fluid cypress
#

maybe use them when its really necessary, and in this case its not, bc nothing is async when running spigot

hybrid spoke
#

wrong

fluid cypress
#

only when running in paper

glossy barn
#

if there was a significant problem with CompletableFutures then it would be removed or updated :/

hybrid spoke
#

there are a few things being async

fluid cypress
#

well, i mean nothing in that code

hybrid spoke
#

if you mean spigot itself, just run System.out.println("Spigot"); async

fluid cypress
#

yesterday, after getting just 10 locations, i got the out of memory error, now it got 18 and it still works

fluid cypress
white obsidian
#

I want to make a command called /find but it wont register because bungeecord already has a /find command, and when i add it to the disabled-commands section of the bungeecord config neither command registers. Do i have to make it a module instead or is there another way i can do this?

#

nevermind i think i found the solution in modules.yml

ivory sleet
#

You can use those regardless of platform. It’s in the JDK to be of general help.

#

Anyways if you encounter the memory errors it either because of a memory leak or because you didn’t set the max alloc ram high enough for your expected memory consumption. GC enqueues objects which are considered lost in reference and then it runs a collection and free some space every once in a while, can be adjusted with jvm args.

chrome beacon
#

In this case Minecraft was keeping a reference internally preventing it from being GC'ed

ivory sleet
#

Oh ofc you could invoke System.gc() but that’s like saying please gc for the sake of my love do some work.

#

Oo yeah

dusk flicker
#

I have a command for that lol

ivory sleet
unique halo
#

http://prntscr.com/1n28o6y
i have this yml file is there a way to get all the keys of Map1?
like .getChildren("Map1") which will return ["loc1", "loc2"]

unreal quartz
#

call System.gc every tick for optimal memory use smart

ebon magnet
#

Is there a way to make the information packets for the text content of a sign not be sent to a player unless they've already loaded the chunk it's located in? (At least since the last time it was changed, the last time the player connected, and/or the last time the server has restarted)

I'm trying to figure out a way to prevent people from using search tools to compromise locations through locating specific signage. (Very helpful against things like casual griefing and stream sniping.)

Ideally, I'd also be able implement a simple form of encryption on those data packets (using the chunk data and block coordinates as the decryption key) so that it's even harder to find the location of a sign through brute force.

However, that could be very resource intensive.

Ping me when you respond, because I get the feeling it could be a while.

unborn lintel
#

how do i teleport a player to a certain position for example to 200 70 52?

opal juniper
#

Player#teleport(Location)

fluid cypress
#

why i cant do this null == 1?

#

i mean, it should be false

#

that null is delay, and its an Integer
Unboxing of 'delay' may produce 'NullPointerException'

unreal quartz
#

a primitive can't be null

stone sinew
fluid cypress
#

yea, so they are different

#

that should be false

unkempt peak
#

You can't compare objects and integers

unreal quartz
#

well primitives are special in that they can't be assigned to null either, so it doesn't make sense to permit comparing them either

unreal quartz
ebon magnet
#

It would probably require a datapack installed on the client

eternal oxide
#

You would need to use Protocol Lib and monitor all packets which require chunk/block info

#

check the distance from the requesting player and allow or block them.

dense goblet
#

@fluid cypress when you do <Integer> == x, it tries to cast the integer to an int and then compares the ints

#

The casting fails if your integer is null

#

It doesn't happen with other objects because both a null object variable and a non-null object variable are essentially pointers

#

So no cast is needed

#

It only compares the address not the contents

fluid cypress
#

got it

#

im using this maven plugin to set the jar output

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
        <outputDirectory>../Server/plugins</outputDirectory>
    </configuration>
    <version>3.2.0</version>
</plugin>

how can i make it compile 2 jars to 2 different locations?

quaint mantle
#

can someone help me witht the plugin shopgui+ im trying to add spawners i made a section but dont know how to add them to the shop

vast sapphire
#

?paste

undone axleBOT
quaint mantle
vast sapphire
#

a pasting site for code

#

https://paste.md-5.net/lezinequga.java
So i'm having an issue getting a location the config section "locations", the generators I have work however when I reload/ restart the server, I can't get the location from the config. I have been stuck on this last part for 2 days and I would greatly appreciate any help with this config issue. Thanks.

sullen dome
#

what is the best way to load two custom worlds on startup? only way i see is guessing how long it could eventually take... and i dont need to explain why thats not good

#

(because i dont really think i want to load two worlds at the same time)

quaint mantle
#

i think thats the method name

unique halo
unreal quartz
#

same thing

vast sapphire
unique halo
quaint mantle
#

Failed to execute goal on project ConfigGuiExample: Could not resolve dependencies for project me.imaginedev:ConfigGuiExample:jar:1.0.0: Failure to find me.imaginedev:ConfigGuiAPI:jar:1.0.0

unique halo
#

in player throw egg event, how do i check if the egg hit an entity or not

quaint mantle
#

you can add metadata to the egg to make sure its from your plugin

torn shuttle
#

ok seriously intellij, in what world is !Objects.equals(string, string2) a better solution than string != string2

#

intellij pls

#

you're drunk go home

quaint mantle
#

nah intellij is right in that case

torn shuttle
#

how?

torn shuttle
#

don't they both do that?

quaint mantle
#

well one may be null

#
null.equals(object) // NPE
object.equals(null) // False
Objects.equals(null, null) // True
torn shuttle
#

I mean sure but doesn't != also deal with null just fine

#

because it looks like it is

quaint mantle
#

but the second one may mean that both are null

torn shuttle
#

I'm confused, can't you just do a != b and have the same result

quaint mantle
#

it calls .equals

#

not ==

#

memory location, .equals

torn shuttle
#

oh because == can only compare object references?

#

hm

quaint mantle
#

bro what

#
public boolean equals(Object a, Object b) {
    if (a == b) return true;
    if (a == null) return false;
    return a.equals(b);
}
#

this is literally objects.equals

torn shuttle
#

you mean Objects.equals right

quaint mantle
#

jfc man

torn shuttle
#

what, they aren't the same

quaint mantle
#

😠 😠 😠 😠 😠 😠 😠

torn shuttle
#

you feeling ok there imagine, I think nnya rubbed off on you

quaint mantle
#

are you ok?

#

i just explained it like 5 times

#
/*
    Equivallant to Objects.equals()
 */
public boolean equals(Object a, Object b) {
    if (a == b) return true;
    if (a == null) return false;
    return a.equals(b);
}
torn shuttle
#

oh that is not how I read that

#

man I'm completely out of it today

quaint mantle
#

mmm can a teleport cause return an enum?

if(event.getCause() == Material.CHORUS_FRUIT)

asking since this is giving me an error that i'm not sure how to fix

#

its in PlayerTeleportEvent by the way

quaint mantle
#

wait it's an enum though?

quaint mantle
#

you're comparing the pointer of the 2 strings.. Which the jvm can store specific strings in memory with a consistent pointer but you shouldn't trust it

#

oh wait, so i forgot that PlayerTeleportEvent had enums in it like this

if(PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT == event.getCause())

so would this work?

quaint mantle
#

?

#
if (event.getCause() == PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT) {

}
#

i see that, but what difference does it usually make?

quaint mantle
#

oh, alrighty then

#

wait.... how does one tell which one should go first or second?

quaint mantle
#

for strings it should be reversed

#
if ("myString".equals(nullable)) {

}
#

ohhh, i c i c now, thanks

quaint mantle
#

null safe equals check

hasty prawn
#

Just looks weird when you call a method on a constant like that

#

I normally do it the other way around and handle the possible null

quaint mantle
#

it looks weird but i always do it

torn shuttle
#

I think I've been looking at code for too long, my brain is melting

#

on the upside it was for a worthy cause, I think everything works

crude charm
#
[ERROR] Plugin org.apache.maven.plugins:maven-jar-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-jar-plugin:jar:2.5: 1 prob
lem was encountered while building the effective model
[ERROR] [FATAL] Non-parseable POM C:\Users\wsmit\.m2\repository\org\apache\maven\plugins\maven-jar-plugin\2.5\maven-jar-plugin-2.5.pom: end tag name </head> must be the same as start tag <link> from line 7 (
position: TEXT seen ...</style>\n  </head>... @31:10)  @ line 31, column 10
[ERROR] -> [Help 1]

vale ember
crude charm
#

but how do I fix it

vale ember
crude charm
#

I have 3

vale ember
#

3 pom.xmls in one plugin?

crude charm
#

*4

vale ember
#

Why?

crude charm
unique halo
#

is there a reason sometimes world.getblock sometimes doesn't work for me? (using 1.8.8 spigot)
it happens pretty rarely though

spiral dome
#

in one plugin or in one project?

compact ice
#

its spigot 1.8

#

spigot 1.8 SUCKS

#

HARDCORE

crude charm
spiral dome
#

epic

vale ember
#

So post the upper one pom.xml

crude charm
#

this is the "global" pom

#

?paste

undone axleBOT
crude charm
#

this is the bukkit one

#

lmk if you want any others

vale ember
#

Try cleaning the local .m2/repository/ folder manually

digital plinth
#

is it possible to pause either a plain java runnable or bukkitRunnable

quaint mantle
#
if (condition) {

}

simple

vale ember
#

You are using bukkit scheduler?

crude charm
digital plinth
crude charm
#

probs should have thought of that myself lol but whatever it works now

digital plinth
#

if a condition is met

#

thread.sleep crashes the game i've heard?

sullen dome
#
[06:29:59 WARN]: Nag author(s): '[Rivex]' of 'SSP' about their usage of System.out/err.print. Please use your plugin's logger instead (JavaPlugin#getLogger).```
is that actually a spigot thing, or paper? lol
digital plinth
#

Rivex?

#

is that a plugin

sullen dome
#

Supa

#

that is my plugin, yes

#

why do you ask?

sullen dome
#

interesting. spigot now annoys me when printing out stuff for testing lol

quaint mantle
#

out > "DEBUG:ERROR"

#

just use println

sullen dome
#

i actually do use printLn lol

#

thats what gave me this lol

digital plinth
#

is it possible to change the period of each runnable

#

like have a int inside the runnbale

#

adn update it in the run method

dusky lynx
#

is there a way to get a specific mob skull with; SkullMeta#setOwner ?

digital plinth
#

and have it change the delay

digital plinth
#

just get the item

#

or set the block material

dusky lynx
digital plinth
#

o

#

1.8 bad

#

use 1.16 or 1.17 lol

#

1.8 is full of bugs

sullen dome
#

1.8 is old-ass

#

and i kinda start to hate those 1.8 HaS BeTtEr PvP SyStEm people lmao

dusky lynx
#

not my choice, i just making the plugin for the server

sullen dome
#

bump the admin lol

dusky lynx
#

lmao

sullen dome
#

i still wonder how you can hire a developer for 1.8... that's just hillarious

digital plinth
#

bun bun

#

dun dun

sullen dome
#

no idea :3

digital plinth
#

da dun da dun da dun dunnnnn

sullen dome
#

sorry

digital plinth
#

okay

sullen dome
#

dun dun

#

loggers are shit

#

lgl

digital plinth
#

nop u cant

#

wait

#

hold on

sullen dome
#

huh

#

?

#

can't what

digital plinth
#

yea no

#

impossible

sullen dome
#

oh lol, thought you meant smt from me lol

#

i hate it

final monolith
#

hi guys, i have a question

#

I saw that some plugins we managed to put in Maven and already get the API from there

torn shuttle
#

what's up with all the br people in here lately

final monolith
#

when I put a plugin directly into Maven, does it need to be on the server?

proud basin
#

that isn’t grammatically correct

final monolith
#

sorry, its google translate, bruh

hasty prawn
#

Because if that's what you're asking, it depends. You can either build it into your plugin (compile scope), or tell it that it will be there (provided scope). If you're depending on another plugin, you probably will use provided.

final monolith
#

thats my question

hasty prawn
#

Yeah I think we're on the same page just saying it differently.

final monolith
#

i too

torn shuttle
#

your sentence structure gets lost in google translate

final monolith
hasty prawn
#

If you're adding a plugin into your maven, set the scope to provided and run it on the server

#

If you're adding a library then set the scope to compile and don't put it on the server

final monolith
#

🤔

torn shuttle
#

depende, há certas configurações de maven que funcionam ser ter de ter o plugin no teu servidor

#

alright I'm done creating config systems, I'm going back to home renovations

digital plinth
#

gimme s2

#

XD

torn shuttle
#

weebs and brazucas, my life is a living nightmare

torn shuttle
#

like what dessie said earlier

final monolith
#

oh ok

#

thanks guys

torn shuttle
#

you're better off reading guides online

final monolith
#

thanks men

torn shuttle
#

de nada 🇵🇹

final monolith
#

🇧🇷

quaint mantle
#

how do you use PDC in tile blocks ? nvm I was doing a stupid mistake that's y my code was not working and I suspected that there is a new way.

unique halo
#

why does world.getblockat sometimes say the block is air when it's not

#

will world.loadchunk do anything to stop it from saying the block is air

keen kelp
#

Is there a easy way to make the server slower?

#

like deliberately lower the tps

#

To a certain amount

hybrid spoke
#

NMS

keen kelp
#

So modify the server?

hybrid spoke
#

^^

keen kelp
#

Is it exactly the effect of lagging?

#

Like server can't keep up too much things to calculate

#

Oh also what's the rant with easy mode about?

crisp fog
#

what plugin the skyblock plugins

#

skyblock island

opal juniper
#

should i compare worlds by name?

eternal oxide
#

name, id or instance. all work

opal juniper
#

ok cool

#

am i right in saying that world doesn't override equals

narrow vessel
tawny mulch
#

Hey, so my question is how to spawn an Entity with a custom skin
I already searched for it on google and I am able to spawn an EntityPlayer per nms but how do I interact with the newly spawned Entity? I know that the PlayerInteractEntityEvent doesn't fire because the Entity is client-side and not server-side
I didn't find any help for that problem except that I should use ProtocolLib but for that I don't find any help either..neither for spawning nor for interacting with it
Dunno if I'm too stupid to google xD

https://gist.github.com/nimbl0/f3606b489016a2d7dba9da5ac4a5d7e7
This is my current class for spawning the NPC
I'm fairly new to NMS 😅

hybrid spoke
opal juniper
#

ah ok

#

im just doing name now

hybrid spoke
tawny mulch
#

hm but how?
Do I have to do something like in the spawn() again? Instead of ADD_PLAYER it's USE_ENTITY?
That's confusing me a bit

hybrid spoke
#

store the entity ID of your EntityPlayer and check in the packet listener if the used entity is your player

opal juniper
#

is there a good way to serialise and deserialise an object

opal juniper
#

hmmyyeahh i didnt think of that

hybrid spoke
#

what do you want to serialize anyways?

#

and what is "Parcel" for a class name

#

ew

tawny mulch
opal juniper
#

i thought i had pushed or something

hybrid spoke
opal juniper
#

It has fields:

Location
Set<UUID>
DroneInventory
tawny mulch
#

Sometimes I feel soo dumb lmfao...I googled "protocollib tutorial" and the github page of protocollib gives me exactly the information I need
2000iq
thanks xD

opal juniper
#

oh wait

#

can GSON only serialise if the fields are public

hybrid spoke
#

not sure it probably have to access it

#

never really worked with GSON

opal juniper
hybrid spoke
#

what is Parcel supposed to do?

opal juniper
#

right apparently there is an
@Expose

tawny mulch
#

yea u have to define which fields gson should include

opal juniper
#

it represents a delivery once finished

hybrid spoke
#

and you name it Parcel?

opal juniper
#

myeah

#

that makes sense

hybrid spoke
#

we already had something like this. do a DeliveryResult or smth

#

that would make much more sense

#

and is just a wrapper for the provided informations

opal juniper
#

meh

hybrid spoke
#

so we can evaluate them

opal juniper
#

java.lang.reflect.InaccessibleObjectException: Unable to make field private java.lang.Object java.lang.ref.Reference.referent accessible: module java.base does not "opens java.lang.ref" to unnamed module @2aa5fe93 bruh

eternal night
#

Java 16 babyyy

#

🥳🥳🥳

opal juniper
eternal night
#

But why even XD

#

You can set the reference can't you ?

opal juniper
#

idk im stupid

#

dont use gson that much

#

if at all

eternal night
#

Ohhh, gson

#

Yeah it has trouble with the new java version. Well the version of gson that Minecraft ports at least

opal juniper
#

turns out i needed a Gson builder

#

although...

#
@Expose
private final Location location;
@Expose
private Set<UUID> authorisedPlayers;
@Expose
private final DroneInventory inventory;

{"location":{},"authorisedPlayers":["MY_UUID"],"inventory":{}}

#

is it cause gson dont know how to serialise them or something

toxic mesa
#

Okay so I've not used protocollib a lot but I want to use the Entity Position (https://wiki.vg/Protocol#Entity_Position), How can I use this? PacketType.Play.Client.POSITION uses the position event and something like PacketType.Play.Client.ENTITY_POSITION doesn't exist.

quaint mantle
#

how 2 make player execute command on bungee

#

tell quicj\

#

chiop chioop

#

..?

#

Ok thanks

#

np

#

fr tho

#

how to make a player execute a command on bungee

#

yk liek

#

a bungee plguin

#

tell quick

#

ProxiedPlayer.performCommand(String);

#

bad

#

ProxyServer.getInstance().getPluginManager().dispatchCommand(sender, commandline);

#

k

#

i just6 farted

#

are you dumb?

#

Do you really think it's funny or will anyone care that you just farted?

#

My project folder structure is Minecraft > Plugins > ProximityChat,

On InteliJ when I go to files>project structures>artifacts>add>JAR>using modules from dependencies it keeps forcing me to using Plugins and not the ProxmityChat which is my actual project file.

ivory sleet
opal juniper
#

myeah idrk

ivory sleet
#

You should probably provide a TypeAdapter for DroneInventory and Location

opal juniper
#

hmm maybe

#

inventory={inventoryType=DEPOSIT, location={world=world, x=90.0, y=88.0, z=120.0, pitch=0.0, yaw=0.0}, inventory={}}

having an issue deserialising this

#

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 35 path $.

ivory sleet
#

Yeah

quaint mantle
#

how to send command to bungeecord

#

using spigot

tawny mulch
#

Soo I know how to listen to a Packet but how do I determine the type of the clicked entity?

protocolManager.addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Client.USE_ENTITY) {
    @Override
    public void onPacketReceiving(PacketEvent event) {
        if(event.getPacketType() == PacketType.Play.Client.USE_ENTITY) {
            PacketContainer packet = event.getPacket();
            System.out.println(packet.getIntegers().read(0)); // i looked it up on google and it seems like this gives me the entity id? but in my case it's 28...which is a skeleton horse and not a EntityPlayer or something like that
        }
    }
});
toxic mesa
#

Okay so I've not used protocollib a lot but I want to use the Entity Position (https://wiki.vg/Protocol#Entity_Position), How can I use this? PacketType.Play.Client.POSITION uses the position event and something like PacketType.Play.Client.ENTITY_POSITION doesn't exist.

dire marsh
toxic mesa
#

ty

tawny mulch
#

1.16.5

tawny mulch
#

thanks

main dew
#

How disable physics gravel, sand etc?

quaint mantle
#

help

coral sorrel
main dew
coral sorrel
main dew
coral sorrel
#

i think worldguard can do that.

main dew
coral sorrel
#

it should work..

quaint mantle
#

how to get telleporteeee with ess api

main dew
coral sorrel
#

what blocks do you want to not have gravity?

main dew
#

all 😅

coral sorrel
#

... i could've made you a plugin that disabled gravel, sand gravity

#

but ok

main dew
#

I can't find good plugin or good source to disable this

regal moat
#

is there an event for totem of undying being used

coral sorrel
#

EntityResurrectEvent

tardy delta
#

how can i check if my config.yml has a path homes.uuid.somename and i dont know the value of somename?

#

like i have to check if there exists something under uuid

#

like now i'm adding every key under uuid to a list and check if that list isnt empty

#

i assume there are more efficient ways of doing this?

unreal quartz
#

.getKeys.size

heavy void
#

Someone knows a good license system? (I dont want AdvancedLicense, its outdated.)

tardy delta
#

and whats the difference again with .get() and .getConfigSection() ?

heavy void
#

You is trying to get it as:

a:

not:
a:
b: 'c'

#

not?

#

I dont saw the code, but i think it is this.

tardy delta
#

getKeys(false) you mean?

#

but yea you're right

unreal quartz
heavy void
#

Im bad with php ' -'

unreal quartz
#

all the more reason to make it open source

regal moat
#

basically i just want to get the name of the totem that was used

regal moat
#

hello?

#

its been

#

21 minutes

#

lol

tardy delta
#

what is faster?

if (...) {
do something
return
}
do something else if false

or if/ else?

main dew
#

How disable physics gravel, sand etc?

hybrid spoke
#

its up to you what you like more. implicit or explicit else

tardy delta
#

yea i already got answer xd

worldly ingot
#

Yeah, speed isn't the issue. It's design patterns. The more widely accepted approach is to if/return so you're not nesting a dozen if statements within one another

tardy delta
#

okay thanks

worldly ingot
#

event.getEntity().getEquipment().getItemInMain/OffHand()

#

You'll have to check in which hand it is because the event doesn't supply you with the item (though it probably could)

grim ice
#

i wanna check if a player got banned then register his ban reason and stuff in config, what event do I use

ivory bay
#

Just a fast question, can u make a package in a package in your plugin?

hidden delta
#

kick event

#

😐

tardy delta
#

I just realised Bukkit.getPlayer() also works with partial names...

ivory bay
#

Just a fast question, can u make a package in a package in your plugin?

tardy delta
#

a directory yes

ivory bay
#

oki ty

opal juniper
#

If two people have the same inventory open they are linked right?

waxen plinth
#

Yes

#

Just like if two players are looking in the same chest

opal juniper
#

Cool thanks

tardy delta
#

maybe something to use on my trade plugin but it goes brr

opal juniper
#

what?

tardy delta
#

linked inventories

opal juniper
#

ah right

quaint mantle
tardy delta
#

i have now two interventories that react on eachother with an event :/

opal juniper
#

oh thats not good

#

its so many events

#

to listen to

tardy delta
#

but you can only place items in the left part of the inventory so i dont know how it will look when they have the same inventory open

quaint mantle
#

Just open up a new menu where one player can place on left side and one can place on right

tardy delta
#

well my idea was that both place on the same side

quaint mantle
#

You could but it definitely makes it aids for no reason

grim ice
quaint mantle
#

Wdym?

grim ice
#

like essents

quaint mantle
#

Yea probably kickevent then

worldly ingot
#

It's actually more performant if you use it over #getPlayer() in a situation where you know for certain a player name is a valid one

#

(though for commands, you're always best to use #getPlayer())

tardy delta
glass sparrow
#

Can anyone help me with generating and loading a texturepack? I have written code to generate all the json files, and it all looks right, but when I load the texture pack no textures, settings, or anything loads. Not sure if it's a problem with my zip function or what

main dew
#

How disable physics gravel, sand etc?

tardy delta
glass sparrow
worldly ingot
#

Assuming you have a pack.mcmeta in there as well

glass sparrow
#

Yeah it looks like a normal pack

#

I think it's either the json formatting or the zip function

full spruce
#

i wanna make a plugin
in which if we eat we get random mob spawned
can anybody help?
if yes then please ping me

tardy delta
#

where is the best player to use LivingEntity#setCollidable(boolean b) ?

tardy delta
#

but i think could be more efficient

full spruce
#

?

tardy delta
#

what ?

full spruce
full spruce
tardy delta
#

smh

#

you know what a list is?

full spruce
#

yes

tardy delta
#

just a list

full spruce
#

ok

tardy delta
#

and learn java 😄

full spruce
#

so i can get documention on arraylist in spigot.org

eternal night
#

arraylist is a java class not really spigot specific

#

google will be enough to get docs/tutorials

full spruce
#

oh

#

thanks

tardy delta
full spruce
#

works same in spigot?

tardy delta
#

yes

#

this is just java

#

not spigot related

full spruce
#

ok

#

so mob.add("Skeleton")?

tardy delta
#

for example
list.add(EntityType.CREEPER)

#

its not a string you add

#

it has to be an entity

full spruce
#

public class Main {
public static void main(String[] args) {
ArrayList<String> cars = new ArrayList<String>();
mob.add("Skeleton")

}

full spruce
#

and those upper argument will be same?

tardy delta
#

and it is List<EntityType>

full spruce
#

public class Main

#

and that

tardy delta
#

something like that

full spruce
#

public class Main {
public static void main(String[] args) {
ArrayList<String> mob = new ArrayList<String>();
list.add("EntityType.SKELETON")

#

i'mma test it out

#

on intellij

tardy delta
#

also your whole project structure is wrong

#

you dont need an main method

full spruce
#

oh

#

i copy pasted

#

i understood

ivory sleet
#

?learnjava

undone axleBOT
tardy delta
#

is there a learn spigot tag?

mighty vine
#

no

tardy delta
#

this would be the right time XD

ivory sleet
#

No but that’s quite trivial after knowing Java

tardy delta
#

true

mighty vine
#

you can do nickname

tardy delta
#

nickname?

full spruce
#

ah

#

it is'nt working

#

public static void main(String[] args) {
ArrayList<String> mob = new ArrayList<String>();
list.add("EntityType.SKELETON")

#

heres what i did

tardy delta
#

don't use a public static void main

#

bukkit doesnt work that way

quaint mantle
#

Ye why main

full spruce
#

so?

#

just arraylist?

quaint mantle
#

Where you need to add it

#

When plugin enabled?

full spruce
tardy delta
#

on the eat event

quaint mantle
#
public final class Main extends JavaPlugin {
  @Override
  public void onEnable() {
    List<String> list = new ArrayList<>();
    . . .
  }
}
#

Meh

tardy delta
#

🤣

#

fail

narrow furnace
#

why are people in this server so against using ?learnjava

tardy delta
#

still the ovveride

quaint mantle
#

?learnjava

undone axleBOT
tardy delta
#

^^

#

already posted

quaint mantle
quaint mantle
#

Inside onEnable() do what you need

#

And learn java

full spruce
#

wait

tardy delta
#

use events

full spruce
#

i mma come after few mins

quaint mantle
full spruce
#

import org.bukkit.ChatColor;
import org.bukkit.entity.Explosive;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerBedEnterEvent;
import org.bukkit.event.player.PlayerJoinEvent;

import java.util.ArrayList;

public class FirstEvents implements Listener {
@EventHandler
public static void onPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
player.sendMessage(ChatColor.LIGHT_PURPLE + "Welcome to the server");

                public static void main(String[] args) {
            ArrayList<String> mob = new ArrayList<String>();
            list.add("EntityType.SKELETON")
}
tardy delta
#

whoa

heavy void
#

Someone knows why my code give me a NumberFormatException when i enable method name obfuscation?

narrow furnace
#

?paste

undone axleBOT
quaint mantle
#

Tf

#

Lmao

full spruce
#

public class First extends JavaPlugin {
@Override
public void onEnable(){
getServer().getPluginManager().registerEvents(new FirstEvents(),this);
System.out.println(ChatColor.AQUA + "Plugin is enabled");

}


@Override
public void onDisable(){
    System.out.println(ChatColor.RED + "Plugin is disabled");
}
tardy delta
full spruce
narrow furnace
undone axleBOT
full spruce
#

i mma come after few mins

tardy delta
#

wait what a main method inside a listener

heavy void
#

Ill send

tardy delta
#

uhh oh

quaint mantle
tardy delta
#

lol

quaint mantle
#

And without latest }

#

L

tardy delta
#

imagine compiling this without errors lol

quaint mantle
#

🎷 🐛

tardy delta
#

imagine using notepad

#

🥺

quaint mantle
#

Ahah

#

Compile in notepad ya

tardy delta
#

lmao

#

not compiling

quaint mantle
#

Compile an Minecraft plugin using javac

tardy delta
#

overrated

#

big brain

quaint mantle
#

😖

tardy delta
#

then intellij seems to be more users friendly

quaint mantle
#

IntelliJ IDEA is better

heavy void
#

AdvancedLicense Code with some modifications:
https://paste.md-5.net/utihakumal.java

I want to know, why when i enable method name obfuscation, it gives me a java.lang.NumberFormatException: For input string: "K", but when i dont enable method name obfuscation in my obfuscator, it goes.

OBS: (It only give me a error on this, dont in the whole plugin.)

(This error is on xor function)

tardy delta
#

true

quaint mantle
#

Why text

#

`text`

tardy delta
#

not going to search through this whole code

heavy void
#

I edited, (this error is on xor function)

tardy delta
#

oh god

heavy void
#

Line 122.

tardy delta
#

🤓

#

there are no line numbers here

#

to which line does it correspond?

heavy void
#

result.append

#

in xor function

tardy delta
#

oh its the same

#

🥺

heavy void
#

I already tried a try and catch, but if i do that, it dont returns the value that i want.

#

And... when i dont enable method name obfuscation in my obfuscator, it goes.

tardy delta
#

wel i dont know anything about bytes and xor and stuff

full spruce
#

hi

#

i am back

tardy delta
#

oh god

#

XD

hybrid spoke
full spruce
#

that

#

what i need to do?🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣

tardy delta
full spruce
#

same

#

i mean

#

that plugin

narrow furnace
#

what are u trying to do?

full spruce
tardy delta
#

and does it work?

full spruce
#

nope

tardy delta
#

can yu show your code

narrow furnace
#

send your code so far

tardy delta
#

😳

narrow furnace
#

o.o

full spruce
#

ok

#

there are two classes

tardy delta
#

?paste

undone axleBOT
full spruce
#

ok

#

package com.project.first;

import com.project.first.events.FirstEvents;
import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;

public class First extends JavaPlugin {
@Override
public void onEnable(){
getServer().getPluginManager().registerEvents(new FirstEvents(),this);
System.out.println(ChatColor.AQUA + "Plugin is enabled");

}



@Override
public void onDisable(){
    System.out.println(ChatColor.RED + "Plugin is disabled");
}
narrow furnace
#

no use the link

#

thats why he said

full spruce
narrow furnace
#

?paste

undone axleBOT
tardy delta
#

the link was used for something..

full spruce
#

this is class no.one

#

Main class

tardy delta
#

yes

full spruce
#

and this is another class

tardy delta
#

and where is your event that handles the eat event

full spruce
#

not made yet

tardy delta
#

well where are you waiting for

narrow furnace
#

make that

tardy delta
#

the rest looks good

full spruce
full spruce
narrow furnace
#

you have a onPlayerJoin event

hasty prawn
#

Use PlayerItemConsumeEvent

narrow furnace
#

make one for when a player eats

full spruce
#

ok

#

main class?

#

or another

#

or make a new

narrow furnace
#

same class as onPlayerJoin

full spruce
#

oh

tardy delta
#

hmm there is no eat event

narrow furnace
tardy delta
#

oh wait

#

i thought it was entiryregainhealth

#

or foodlevelchange

full spruce
#

public static void onPlayerItemConsumeEvent(PlayerConsumeEvent event) {

#

this?

regal moat
#
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "works.net.Worksnet.getCommand(String)" is null
```why
#

is this

#

happening

#

to me

tardy delta
#

yes

tardy delta
hasty prawn
#

^ Put it in the plugin.yml

regal moat
#

shit

#

kdsjfklsdsd

#

i always forget

tardy delta
#

🥺

full spruce
#

public static void onPlayerItemConsumeEvent(PlayerItemConsumeEvent event) {
Player player = event.getPlayer();

#

this is the code so far

#

any more things to add?

tardy delta
#

hey what is a good way to get all entities spawning or something? i want to disable collision for all of them the same for players?

hasty prawn
full spruce
#

thats the question how you do that

narrow furnace
#

make a list

#

arraylist

full spruce
#

arraylist?

#

oh

narrow furnace
#

and add all the mobs u want

#

then spawn a random element from that list

tardy delta
#

do you know a better way to spawn a random entity rather than putting all entity types in a list and picking a random one?

narrow furnace
#

idk

#

id split it into a seperate method tho

tardy delta
#

seems such a waste

narrow furnace
#

spawnRandomMob(ArrayList mobs)

#

then onPlayerEat or ever is just new ArrayList and then pass that list into spawnRandomMob

tardy delta
#

i would say prepare the list on enable

narrow furnace
#

yeah

severe zenith
#

hey, does Bukkit.getScheduler().scheduleSyncDelayedTask() run in background or does it delay to following statements too?

tardy delta
#

just a for

full spruce
#

public static void onPlayerItemConsumeEvent(PlayerItemConsumeEvent event) {
Player player = event.getPlayer();

            ArrayList<String> mob = new ArrayList<String>();
            mob.add("Entity.CREEPER");
            mob.add("Entity.SKELETON");
            mob.add("Entity.ZOMBIE");
            mob.add("Entity.HUSK");
            System.out.println(mob);
full spruce
#

so this is the code so far

severe zenith
narrow furnace
#

dont println(mob)

eternal oxide
tardy delta
full spruce
#

yes

#

i mean undead

#

so i have to type all?

tardy delta
#

for (EntityType t : EntityType.values()) {
list.add(t);
}

#

this adds them all

narrow furnace
#

or u could just use that list..

tardy delta
#

oh smh true

narrow furnace
#

rather than copying on list to another list

tardy delta
#

i got the idea of that arraylist in my head

narrow furnace
#

okay so we dont need the serperate method then if we have the list already

#

just get a random element in the EntityType.values() list

hybrid spoke
regal moat
#

?paste

undone axleBOT
regal moat
#

i need this for a sec

tardy delta
#

ignore it

full spruce
#

so?

#

type them all?

narrow furnace
#

what version is this plugin btw

tardy delta
#

wait

full spruce
#

ummm

#

1.17 i think so

narrow furnace
#

ok

regal moat
#

i dont see whats wrong

#

or maybe im blind

hybrid spoke
#

you are blind

#

first the item can be null

#

second the meta too

full spruce
#

mob

hasty prawn
#

You're also only checking on the first one if p.getEquipment() is null, not the item itself.

regal moat
# hybrid spoke second the meta too

i literally set the metadata ```java
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
if (commandSender instanceof Player){
Player p = (Player) commandSender;
ItemStack i = new ItemStack(Material.TOTEM_OF_UNDYING);
ItemMeta m = i.getItemMeta();
m.setDisplayName("Totem Of Teleportation");
i.setItemMeta(m);
p.getInventory().addItem(i);
}
return false;
}

regal moat
#

what do i do to fix it

#

im blind pls tell me

tardy delta
hybrid spoke
#

and spawn it

tardy delta
#

😂

#

ow true you could use []

hasty prawn
hybrid spoke
#

no risk no fun

hasty prawn
#

Absolutely true

full spruce
#

Ok so this is the code by far

#

?paste

undone axleBOT
full spruce
tardy delta
#
event.getPlayer().getWorld().spawnEntity(event.getPlayer().getLocation(), EntityType.values()[new Random().nextInt(EntityType.values().length)]);
hybrid spoke
full spruce
#

add this too?

tardy delta
#

what is the difference with the threadlocalrandom?

hybrid spoke
tardy delta
#

take mine or that from him idk

hybrid spoke
tardy delta
#

oh

hybrid spoke
#

and if it hits the exact length of the artay

narrow furnace
#

@full spruce no need for the tabs line 4-8

hybrid spoke
#

since indexoutofbounds

narrow furnace
#

idk if thats in the code or just the paste

hybrid spoke
#

otherwise remove the entities which arent just like Firebalö

#

Firebalö

#

FIREBALL

#

fuck my phone

full spruce
#

it is showing armour and

regal moat
tardy delta
hybrid spoke
hasty prawn
#

For both the Main hand and Offhand items ^

hybrid spoke
#

^

full spruce
#

should i run the code

hybrid spoke
hybrid spoke
full spruce
#

so

#

what I should add

hasty prawn
full spruce
#

or remove

full spruce
#

what

hybrid spoke
#

but without the HEY SUB ME LEAVE COMMENT

hasty prawn
#

True

full spruce
hybrid spoke
#

its a dead store

full spruce
#

array?

hybrid spoke
#

created but never used

hasty prawn
#

Do you only want to be able to spawn those 4 mobs?

full spruce
#

nope

#

all undead

tardy delta
full spruce
#

where's your code

full spruce
#

then?

tardy delta
#

i know 🥺

#

only for ythe spawning

hybrid spoke
#

creating everytime a new Random instance is not needed

full spruce
#

then?

hybrid spoke
#

ThreadLocalRandom is faster too