#help-archived

1 messages · Page 91 of 1

brisk mango
#

@frigid ember

frigid ember
#

just color trans

brisk mango
#

show

frigid ember
#
    public static String format(String message) {
        return ChatColor.translateAlternateColorCodes('&', message);
    }```
brisk mango
#

and the null pointer occurs on that line?

wraith thicket
#

Again, you'll get the error if the message argument is null

#

Yes - it's clear from the stacktrace ...

frigid ember
#

but its looking for the display that is specify &9&l» &5&lServer Selector &9&l«

wraith thicket
#

Perhaps you got your lines mixed up between the source and the stacktrace?

frigid ember
#

No i didnt.

wraith thicket
#

What version of MC are you using exactly?

#

1.7... oh

#

lol

frigid ember
#

mhm

wraith thicket
#
    public static String translateAlternateColorCodes(char altColorChar, String textToTranslate) {
        char[] b = textToTranslate.toCharArray(); // line 206 -> your input string is null
        for (int i = 0; i < b.length - 1; i++) {
            if (b[i] == altColorChar && "0123456789AaBbCcDdEeFfKkLlMmNnOoRr".indexOf(b[i+1]) > -1) {
                b[i] = ChatColor.COLOR_CHAR;
                b[i+1] = Character.toLowerCase(b[i+1]);
            }
        }
        return new String(b);
    }
frigid ember
#

wtf

#

lmfao

#

ok so i fixed it

#

it was me being stupid

wraith thicket
#

Different version on server than in IDE?

frigid ember
#

No, so the error was getServerGui in ServerInventory because in the config it suppose to have the size of the inventory and the name but i deleted it on accident

brisk mango
#

wait

#

arent you getting the inventory stuff from config every time that method gets called

frigid ember
#

mhm

brisk mango
#

are u?

#

lol

frigid ember
#

yes?

brisk mango
#

um thats pretty bad thing to do

frigid ember
#

whats better?

#

to save it from the config?

wraith thicket
#

You'd be better off creating the instance once and storing it. And when you need it, just use its getGUI method or whatever you need

brisk mango
#

public final class Main extends JavaPlugin {

private final List<String> inventoryTitles = new ArrayList<>();
private final List<Integer> inventorySizes = new ArrayList<>();
private final List<ItemStack> inventoryContents = new ArrayList<>();

private final List<InventoryHolder> inventoryHolders = new ArrayList<>();

@Override 
public void onEnable() {

}

private void loadInventories() {

}

}
#

just do it this way and then u can save all inventories u create to a list

frigid ember
#

i only create one inventory lol

brisk mango
#

better than getting it from a file each time

wraith thicket
#

All the more reason to do it once...

brisk mango
#

doesnt matter its still better

#

having it in memory

#

lol

frigid ember
#

hmm

brisk mango
#

Map<String, Object> would be better

#

instead of using the index

#

u can use the inventory title to get the value

#

or just

#

Map<InventoryHolder, Object>

#

if(holder instanceof Menu) {
int size = map.get(holder);
}
#

etc

#

menu would be for example

#

interface Menu extends InventoryHolder {
//...
}
frigid ember
#

ill just do it like i do my queues.

#

not config

brisk mango
#

you can use config

#

but use it the way i told you not like you do

frigid ember
#

yes i do.

#

i mean just not get it every time

#

for my queues i get them from the queue and thats pretty much it then save it

wraith thicket
brisk mango
#

@wraith thicket I believe that an instanceof check is more efficient than a string comparison

#

InventoryHolders are fine

fleet crane
#

no

frigid ember
#

lol

fleet crane
#

you don't go implementing random bukkit interfaces

brisk mango
#

"random bukkit interfaces" I thought you are the one that maintains the API

fleet crane
#

InventoryHolder= random bukkit interface

#

don't implement it in your plugin

#

you're not supposed to

brisk mango
#

is there any good reason to not use it though?

fleet crane
#

any more than you would implement Cake and expect setBlockData(MyCake) to work

brisk mango
#

wait so you're saying that its better to compare inventory titles in InventoryClickEvent?

#

since there is then no other way to check the inventory

fleet crane
#

you can also just compare inventories with ==

#

that's a better way imo....

brisk mango
#

wait actually never thought of that

#

wait so

wraith thicket
#

Exactly - just keep track of the inventories and check the instances.

brisk mango
#

final IdentityHashMap<String, Inventory>

would be fine no?

#

like

fleet crane
#

dunno why has to be an identity map

#

but sure

brisk mango
#

because u would use ==

#
@EventHandler
void onClick(InventoryClickEvent event) {
if(event.getInventory() == inventories.get("inventory")) {
//...
}
}
#

ignore what i just said lol

#

im just dumb sometimes

fluid marlin
#

Anyone here familiar with NMS NPCs?

#

Having trouble getting an NPC to jump and crouch, I got it to spawn, rotate and hit so far.

brisk mango
#

what are you using right now

fluid marlin
#

Using for what?

#

Or are you not talking to me

brisk mango
#

im talking to you

#

you said youre having trouble

#

so are you getting an error for example or u just dont know what to use / how to use

fluid marlin
#

not getting an error

#

I just dont know what to use

#

I have some things that I tried but with no success

#
    public void entityVelocity(short x, short y, short z){
        PacketPlayOutEntityVelocity packet = new PacketPlayOutEntityVelocity();
        setValue(packet, "a", entityID);
        setValue(packet, "b", x);
        setValue(packet, "c", y);
        setValue(packet, "d", z);
        sendPacket(packet);
    }

this is what I have for jump

brisk mango
#

I dont know what setValue does

fluid marlin
#
    public void entityAction(int animation){
        PacketPlayInEntityAction packet = new PacketPlayInEntityAction();
        setValue(packet, "a", entityID);
        setValue(packet, "animation", (byte)animation);
        setValue(packet, "c", 0);
        sendPacket(packet);
    }

and this is what I have for crouch

brisk mango
#

Do you know that Vector exists

#

it has X-Y-Z

#

you dont need to use short x, short y, short z

#

to set the velocity

#

you can just do new Vector(..

fluid marlin
#

I'm aware but the packet requires you to set x y z indpendatly

brisk mango
#

so just get it from the vector? lol

#

whatever

#

for the head rotation, i think

fluid marlin
#

Sure, but that's not the issue right now

brisk mango
#

PacketPlayOutEntityHeadRotation

#

is this packet

fluid marlin
#

what head-rotation?

#

I'm not trying to rotate their head, i already got that to work

#

I'm trying to get them to jump and crouch

brisk mango
#

and does setting the velocity not work?

fluid marlin
#

the velocity packet doesn't make it jump no

brisk mango
#

like what does it do

#

nothing?

#

okay

fluid marlin
#

it just does nothing

#

my crouch code makes the client looking at it disconnect

#

Unserialized packet exception i think it was

brisk mango
#

what lol

#

send stack trace

fluid marlin
#
Internal Exception: io.netty.handler.codec.EncoderException: java.io.IOException: Can't serialize unregistered packet
#

Sorry this is the right error

#

There wasn't any stack trace

brisk mango
#

i dont think i can help you this much with NMS since i havent myself done alot of NMS, just some basics

fluid marlin
#

damn

#

welp if anyone who's reading this can help me please let me know (and ping me)

daring crane
#

the client only uses the entity velocity for some stuff like the minecart sound

#

to make an npc jump you have to send move packets

fluid marlin
#

@daring crane which packet exactly?

brisk mango
#

what does entity velocity packet to do with a sound

daring crane
#

you need the packets like PacketPlayOutRelEntityMoveLook

#

@brisk mango minecarts use their velocity to determine their sound volume

fluid marlin
#

@daring crane what about crouch?

brisk mango
#

makes sense

daring crane
#

sneaking is a datawatcher field

fluid marlin
#

@daring crane what are the fields in the jump packet u said?

daring crane
#

are your npcs not able to walk?

#

the "right" way: keep track of the client-side position on the server, use the different move packets to move it

fluid marlin
#

I'm not trying to move it

#

just make it jump

daring crane
#

the easy way: just use teleport packets instead (PacketPlayOutEntityTeleport)

#

velocity doesnt move the entity

pastel basin
#

it depends on the entity

daring crane
#

at least not in this case because they only exist in packets

fluid marlin
#

PacketPlayOutEntityVelocity
doesn't work.

daring crane
#

the server uses the velocity to move entities every tick

#

but in this case the server doesnt even know the entity exists

fluid marlin
#

@daring crane wouldn't teleportation make it seem like... well teleportation?

daring crane
#

the client interpolates it

#

those packets are used for players too

fluid marlin
#

so i just teleport it up and down?

#

and it'll do the rest

daring crane
#

if you walk around youre just teleporting a lot

#

yep

pastel basin
#

back when I use to create fake falling blocks two packets were sent to the player to update the entity velocity

daring crane
#

falling blocks are one of the only exceptions where the client uses the entity velocity to move the entity

pastel basin
#

not true, you can move any entity with velocity as it does the same as org.bukkit.entity.Entity#setVelocity

daring crane
#

thats because the server is performing the movement

#

funny because the server doesnt send the packets to everyone online

#

the packets are only sent to players who actually see the entity

#

= are in range

#

except that it wont in this case because setting the velocity doesnt move the entity

#

thats why the server performs the movement every tick

#

let me guess, the other one is a move packet

fluid marlin
#

Entity#setVelocity didn't work

#

I've already tried that

#

it didn't make the NPC move or jump. it just did nothing.

brisk mango
#

@fluid marlin but Entity is an bukkit class, NPC is an packet

#

wwhich has nothing to do with Entity

fluid marlin
#

You make a new EntityPlayer

#

and then do Player npcPlayer = EntityPlayer#getBukkitEntity()#getPlayer

#

I know

#

I tried that at first, it didn't work.

#

Hence why now im using what @daring crane suggested ^

brisk mango
#

EntityPlayer is an NMS class @fluid marlin

fluid marlin
#

I know

#

and then I make a new Player

brisk mango
#

new Player()

#

Player is an interface

fluid marlin
#

and Use EntityPlayer#getBukkitEntity#getPlayer

#

no not a new player

#
Player npcPlayer = EntityPlayer#getBukkitEntity#getPlayer;
brisk mango
#

but what surprisingly works is Player player = new CraftPlayer()

#

ah mk

mint sky
#

could anyone with a busy server that uses LP please run /lp verbose record ...wait a bit then /lp verbose paste please, just trying to get a large set of data

#

30secs to a min is all

brisk mango
#

@pastel basin This guy just litterly told you like 3 times that setting the entity's velocity with packet wont work

daring crane
#

@fluid marlin what are you doing with the bukkit entity api

#

are you not spawning the entity using packets?

#

because if you do you shouldnt use the bukkit entity api at all

brisk mango
#

no

pastel basin
#

yes

brisk mango
#

you need to teleport the entity

#

no

daring crane
#

you still didnt say which magic packet that is

pastel basin
#

teleporting the entity besides being performance expensive it will not look smooth to the player

daring crane
#

im making very smooth roller coasters using teleport packets

pastel basin
#

using velocities will make the entity look like it's walking

daring crane
#

using velocity for smooth movement is wrong, it might even make it worse

brisk mango
#

@pastel basin why are you spreading bullshit

#

🤦‍♂️

daring crane
#

if its the right way why doesnt the vanilla server do it?

brisk mango
#

its not bukkit so its not performance expensive and its not laggy @pastel basin

#

only shit in bukkit is performance expensive because its shit designed API

swift compass
#

How to get Material of raw fish (bukkit 1.15.2)?

brisk mango
#

im pretty sure it exists in the Material enum

#

Material.RAW_FISH

swift compass
#

Does not exsists

brisk mango
#

it does

#

no idea what version ur using then

daring crane
#

PacketPlayOutEntityMetadata is 100% unrelated to movement

brisk mango
#

LEGACY_RAW_FISH

#

@swift compass

swift compass
#

Is deprecated

daring crane
#

well, you did Entity#setVelocity

#

which is completely unrelated to this conversation

#

oh right, your falling blocks

swift compass
#

@brisk mango Do you have any idea ?

brisk mango
#

nope i dont use 1.15.2

#

check the docs

swift compass
#

Ok

#

Thanks

daring crane
#

so im sending a PacketPlayOutSpawnEntityLiving for an armor stand and a PacketPlayOutEntityVelocity with (0, 1, 0)

#

its not moving at all

#

and no, PacketPlayOutEntityMetadata wont change that

#

congratulations, youve arrived at what i said 20 mins ago

#

did the same thing with a zombie now, its not moving at all

pastel basin
#

did you send the metadata packet?

brisk mango
#

i guess you have to teleport it because zombie is an exception @daring crane

daring crane
#

lmao

brisk mango
#

@pastel basin i think youre braindamaged somehow

daring crane
#

alright, ill send a metadata packet

pastel basin
#

look who's talking

brisk mango
#

looks like

#

im not talking about packets

#

im talking about you lol

daring crane
#

breaking news: the metadata packet didnt change anything

brisk mango
#

i mean this is not the first time ur saying stupid shit

#

u did before too when i said BukkitRunnable is an useless class and u argued about it with no reason why should it be useful

#

fine

pastel basin
#

I just said that BukkitRunnablr looks cleaner

brisk mango
#

it doesnt really look cleaner, its about if people prefer/like more lambda than doing new BukkitRunable(), it might look cleaner but the code is more shit. Anyway, how did you change the entity's velocity with the packets if this guy cant get it to work?

pastel basin
#

but I'm pretty sure I used it before and it worked

brisk mango
#

fine

wraith thicket
#

Actually, the advantage of the BukkitRunnable class is the #cancel method

brisk mango
#

the only advantage

pastel basin
#

omg please stop talking about bukkitrunnables

brisk mango
#

but you know that a Consumer<BukkitTask> exists right @wraith thicket

wraith thicket
#

It's a convenience, really

brisk mango
#

You can just do task -> task.cancel();

marsh hawk
#

I recently moved my website to a https domain and ever since when i try to join my proxy on the same ip i get 'Error occurred while contacting login servers ,are they down?' do these two have something to do with eachother

pastel basin
#

this subject was argued 100 times already

brisk mango
#

fine not arguing about it no more then

#

sure.

fluid marlin
#

@fluid marlin what are you doing with the bukkit entity api
@daring crane I am spawning the entity using packets.

daring crane
#

then you should never even have an Entity instance

fluid marlin
#

i dont

#

I used to

#

@daring crane can you remind me what's the packet for crouching?

daring crane
#

PacketPlayOutEntityMetadata

fluid marlin
#

What are the fields in that packet @daring crane

daring crane
#

entityId, dataWatcher, true

#

you have to create a DataWatcher and set its Pose item

#

btw the DataWatcher needs an Entity in its constructor, its not used for anything important though

#

so you can just pass a fake object

fluid marlin
#

can I pass a null?

fluid marlin
#

What do i set in the datawatcher

#

after creating it with the fake object

daring crane
#

.set(net.minecraft.server.v1_15_R1.Entity.POSE, net.minecraft.server.v1_15_R1.EntityPose.CROUCHING)

fluid marlin
#

there is no set

#

and EntityPose isn't a class either

#

Im doing this on 1.8

daring crane
#

which mc version are you on

#

oh

fluid marlin
#

i'm trying to make the NPC work on all versions but i gotta start from lowest lol

daring crane
#

pretty sure you need to use watch instead of set

#

nvm its a

#

try .a(0, 0x02)

fluid marlin
#

should i cast the second one to (bye)

daring crane
#

yep

fluid marlin
#

👍

#
    public void entityMetadata(){
        PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata();
        setValue(packet, "a", entityID);
        Entity fakeObject = null;
        DataWatcher dataWatcher = new DataWatcher(fakeObject);
        dataWatcher.a(0, (byte) 0x02);
        setValue(packet, "b", dataWatcher);
        setValue(packet, "c", true);
        sendPacket(packet);
    }

@daring crane this is what i got, aint working.

daring crane
#

fakeObject cant be null

fluid marlin
#

Setting a DataWatcher to null works for me in my spawn fucntion btw

#

What does it need to be?

daring crane
#

actually i think it can be null in 1.8

brisk mango
#

@fluid marlin You realise that some classes dont have to be visible if they are package-private?

#

not talking specifically about NMS but in general

#

and alot of shit needs to be accessed using reflection

fluid marlin
#

I have a reflection

#

that how I set my values

#

and send packets

brisk mango
#

i mean for classes

#

whatever

pastel basin
#

why don't you use the constructor instead of setting values? 🤔

brisk mango
#

Wdym use the constructor

#

what constructor

pastel basin
#

packetplayoutentitymetadata has a constructor for entity id

daring crane
#

@fluid marlin seems like you have to use watch

#

and if you use watch the entity really cant be null

pastel basin
#

but you are setting the value after you instantiated this class

fluid marlin
#

The first value im setting is the entity id

#

@daring crane what should I put it as then?

#

Should i get the EntityPlayer and have the entity be the entityplayer?

daring crane
#

just create an nms Entity using its constructor

#

that sounds so wrong tbh but you kinda have to

#

new Entity(null) should be enough

#

nvm Entity is abstract

#

maybe new EntityEgg(null)

pastel basin
#

^

#

each entity has its own class extending Entity

fluid marlin
#

the EntityEgg constructor is a world

daring crane
#

the world can be null

fluid marlin
#

should I set it as null or just give it a world

#

okok

#
 [NPC] Task #607 for NPC v1.0 generated an exception
java.lang.NullPointerException
        at net.minecraft.server.v1_8_R3.DataWatcher.watch(DataWatcher.java:110) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
        at me.moshe.npc.ver1_8.NPCManager.entityMetadata(NPCManager.java:77) ~[?:?]
        at me.moshe.npc.commands.NPCCommand$1$2.run(NPCCommand.java:46) ~[?:?]
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_231]

@daring crane ^^

daring crane
#

is the entity still null

fluid marlin
#

the error is on the DataWatcher#watch

#

nope its an entityegg

#

and i set the world to null

daring crane
#

and youre really passing that entity in the datawatcher constructor?

#

the entity is the only thing that could possibly cause that exception

fluid marlin
#
    public void entityMetadata(){
        PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata();
        setValue(packet, "a", entityID);
        EntityEgg fakeEntity = new EntityEgg(null);
        DataWatcher dataWatcher = new DataWatcher(fakeEntity);
        dataWatcher.watch(0, (byte) 0x02);
        setValue(packet, "b", dataWatcher);
        setValue(packet, "c", true);
        sendPacket(packet);
    }
daring crane
#

hmm seems like .a(...) was right

fluid marlin
#

I thought so, so i tried switching it back to a

#

which just didn't do anything

#

without any errors or anything

daring crane
#

what happens if you call both

#

first a, then watch

fluid marlin
#

I'll try lol

#

wish there were good tutorials on this shit

#

I understand things much better when there's a voice or a person explaining it to me but that's just me personally

daring crane
#

i learned using datawatchers by looking at other open source plugins

#

but i have no clue how they worked in 1.8

fluid marlin
#

a() then watch() isn't working

#

just doing nothinhg

#

doesn't generate any exceptions either

daring crane
#

try using new PacketPlayOutEntityMetadata(entityID, dataWatcher, true)

#

instead of setValue

#

seems like its doing important stuff in the constructor

#

field "c" doesnt even exist, its only a constructor parameter

fluid marlin
#

should i use a or watch?

daring crane
#

a

fluid marlin
#

eyyyy it works

#

how do i make it uncrouch?

daring crane
#

set 0 to (byte) 0x00

fluid marlin
#

👍

daring crane
#

but you have to use .watch for that

#

you only need .a once to register the item, then you should use .watch

#

thats why watch wasnt working earlier btw, the item wasnt registered

fluid marlin
#

👍
tysm @daring crane

daring crane
#

np

fluid marlin
#

It worked with a tho btw

#

the uncrouch

daring crane
#

oh right, because youre not reusing the datawatcher

#

would be cleaner (and probably better for performance) to just make one datawatcher for the entity and modify it

fluid marlin
#

👍

#

I'll probably come back for more help once I start making this for other versions if minecraft changed a lot of how it works in different versions

daring crane
#

im pretty sure only the method names have changed

#

a -> register, watch -> set

fluid marlin
#

lets hope so :v

daring crane
#

and since some version you have to set the pose (DATA_POSE) instead of the flags (0)

fluid marlin
#

@daring crane Would I have to create an NPC class for each version or is there an easier way

daring crane
#

imo the best way is to make one class for every mc version

#

and make them implement an interface

rare junco
#

On the chat is says []CoBra5332 how do I take the [] away?

frigid ember
#

maybe you are useing array

#

right?

worn gate
#

I've got a question :
I am coding a programme which checks .minecraft files to check if someone is cheating. My question is : is it possible to detect an injected client such as vape with tasklist ?

wraith thicket
#

Try it out and see is what I'd suggest.
Bare in mind that people can play this game on MacOS or varius linux distros as well, so a Windows-only application will not really be a good "anticheat" solution.

#

Not to mention that even if you do find the client that way, modifying it in a way that you cannot would not be all that difficult.

sturdy oar
#

client sided anticheat are not a really great idea

frigid ember
#

theres always bypasses to them...

#
            if (event.getItem().getItemMeta().hasDisplayName() && event.getItem().getItemMeta().getDisplayName() != null) {
``` reason for null apointer?
sturdy oar
#

item can be null

frigid ember
#

so add check to see if item isnt null ok

sturdy oar
#

what event is that?

fluid marlin
#

@daring crane I'm now using it for later versions and a() is removed and there is a register() instead like you said but what's a DataWatcherObject?

frigid ember
#

checking if an item is null worked thanks.

daring crane
#

@fluid marlin they changed the keys from numbers to those objects

#

pretty sure you need Entity.T instead of 0 there

fluid marlin
#

Whats Entity.T

daring crane
#

oh rip its not called T in all versions

#

instead of 0 you need the datawatcher key now

#

for example in 1.13.2 its Entity.aC (its protected so you need reflection)

#

just look at Entity.setFlag(int, boolean) with a decompiler, it should say datawatcher.set(...) somewhere

#

the first parameter is what you need

hazy belfry
#

Hi I am getting a weird bug where commands are not being displayed in the command preview area and I can't figure out how to fix that.
If anyone knows it would be appreciated.

Plugin list:

Plugins (56): AdvancedPortals, AuctionHouse, BuycraftX, ChatControl, ChestShop, Citizens, ClearLag, Coins, CommandNPC*, CosmicVaults, DeluxeMenus, DeluxeSellwands, DeluxeTags*, EpicFurnaces, EpicRename, EpicSpawners, Essentials, EssentialsSpawn, FastAsyncWorldEdit, FeatherBoard*, FogusCore, GoldenCrates, GUIShop, HolographicDisplays, HolographicExtension, IridiumSkyblock, Item2Chat, LuckPerms, LuckPermsMVdWHook*, mcMMO, MoneyNote*, MovingDevApi, Multiverse-Core, MVdWPlaceholderAPI*, PlaceholderAPI, PlugMan, ProtocolLib, ProtocolSupport, RewardPRO, ServerlistMOTD*, StaffChatReloaded, SuperMobCoins, SuperVanish, TAB, UltimateModeration, UltimateStacker, UltimateTimber, UltimateTroll, Vault, VoidGenerator, VoidTeleport, VoteParty, Votifier, VotingPlugin, WorldEdit, WorldGuard

brisk mango
#

what is an preview area

#

also how do you expect us to tell why its not displaying by showing us all the plugins

#

you should know lol

hazy belfry
wraith thicket
hazy belfry
#

let me check

frigid ember
#

hey how do i give /tpa perms to other player? (plugin : Simple Tpa 3.7)

brisk mango
#

wat

wraith thicket
supple scroll
#

Hello guys,
idk if this is okay but I need some advice for a modpack server.
So I want to host a modpack server for about 15-20 people. The modpack is about 150 mods big. Over the past years I hosted many servers but almost every time the server got lags (12-18 TPS). Now is the question: what is the best way to host a modpack server? Should I use something like SpongeForge or use waterfall? Which hoster is the best/cheapest? Root server or just a minecraft server?

I hope you guys can help me with this because I just don't know how to go on with this

#

Also what would be the best 'performance' modpack for example

pastel condor
pastel basin
#

what is the exception?

tardy lance
#

i want to spawn an npc but i need to have the minecraftserver.
i the tutorial he has done this:

MinecraftServer ms = (MinecraftServer) Bukkit.getServer();

This isn't working for me because it says it cant convert.
Does somone has an idea?

wraith thicket
tardy lance
#

@wraith thicket so like this ? MinecraftServer ms = DedicatedServer.getServer();

wraith thicket
#

No.

tardy lance
#

oh

hollow thorn
#

Bukkit.getServer().getServer

#

()

#

is that right

wraith thicket
#

You do Bukkit#getServer , cast to CraftServer, then do CraftServer#getServer

tardy lance
#

@hollow thorn no this isnt implemented anymore

#

@wraith thicket okay i will try thanks

hollow thorn
#

if i were to make a crafting recipe

#

for obby

#

where you combine a water bucket and a lava bucket

#

how would i make it so it leaves the buckets

wraith thicket
#

I don't know, but you can get the vanilla recpie for a Honey Block (e.g) and see what it's like.

tardy lance
#

@wraith thicket yes it works, thanks. but know i got the error at casting this:

WorldServer ws = (WorldServer) p.getWorld();

wraith thicket
#

...

pastel basin
#

Cast world to CraftWorld then use CraftWorld#getHandle

wraith thicket
#

I assume p is a Player object?

tardy lance
#

yes

wraith thicket
#

Then yes, like Epicnity said, first cast its result to CraftWorld, then #getHandle

tardy lance
#

Thanks 😄

#

Im a big oof in minecraft plugins

tiny dagger
#

well it happens

vernal spruce
#

anyone know when boundingbox was added?

wraith thicket
#

Somewhere between 1.13 and and 1.13.2

real root
#

Hello, can a member of staff please PM me on discord?

iron plaza
#

hi

#

i have problem with my chat plugin, so when im typing something on chat i have "[]" behind my nickname. I cannot remove it and I changed all essentials chat config. How can i remove this?

tiny dagger
#

multiverse prefix most likely

iron plaza
#

how can I remove it? :0

#

ok nvm i did it thx u very much ❤️

tiny dagger
#

yeah

#

probabily it was in config but i don't remember

vernal spruce
#

is it a dumb ideea to have a object named instance?

lament wolf
#

Hello I need explanations on this

#
public void onEnable() {
        BukkitScheduler scheduler = getServer().getScheduler();
        scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
            @Override
            public void run() {
                // Do something
            }
        }, 0L, 20L);
    }```
#

So

#
  1. the scheduler starts
#
  1. He do line by line the run()
#
  1. he waits 20 ticks doing nothing ???
#
  1. he redo run() line by line ?
#

etc etc ?

wraith thicket
#

You can think of it like that

lament wolf
#

okay

arctic hound
#

Hello, I need help and want to loop entities with a certain UUID but that doesn't work because the chunk is not loaded in this area or there are no players nearby. Is there any solution?

wraith thicket
#

What are you actually trying to achieve?

arctic hound
#

I use vehicles with ArmorStands and with a car key you should have your position and distance. But that's not possible if the chunk is not loaded there

wraith thicket
#

The distance between you (the holder of the key) and the car?

arctic hound
#

yes

wraith thicket
#

Why would it matter if the car is in an unloaded chunk?

#

The distance is simply "too big", isn't it?

#

I.e you could set the maximum value for the distance if the chunk is not loaded

arctic hound
#

yes the distance is 2000 meters long..

#

But how can I do it anyway?

#

How do I set the maximum

wraith thicket
arctic hound
#

Now don't really understand how to put it, can you give me an example?

wraith thicket
#

What? double val = Double.MAX_VALUE; ?

arctic hound
#

How does that work with the entity and the player distance?

vernal spruce
#

jeez that hurts my brain

#

what?

wraith thicket
#

Really not sure what you're trying to ask

#
double dist2; // distance squared
if (!chunkLoaded) dist2 = Double.MAX_VALUE;
else dist2 = locEntity.distanceSquared(locPlayer); // would encourage using #distanceSquared to avoid the costly square rooting
arctic hound
#
                                     Entity car = Bukkit.getServer().getEntity(uuid); 
player.sendMessage(""+car);
player.sendMessage(""+car.getLocation());
player.sendMessage(""+player.getLocation().distance(car.getLocation());
``` That's how I do it, but if the player is not close to that, I get the message "zero"
wraith thicket
#

You mean "null", right?

arctic hound
#

yes

wraith thicket
#

Then just null-check

#

if (car== null) // you know its not loaded

arctic hound
#

Okay, but how do I load that now?

#
   double dist2; 
    dist2 = Double.MAX_VALUE; }``` Do you mean so?
#

Yes, but how do I get the distance now when the car is far away?

wraith thicket
#

You've just defined the distance as its maximum value

arctic hound
#

And then I can loop the entity again or how?

lament wolf
#

Yo, still with my:

public void onEnable() {
        BukkitScheduler scheduler = getServer().getScheduler();
        scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
            @Override
            public void run() {
                // Do something
            }
        }, 0L, 20L);
    }```
How can I cancel the runnabe ? I don't find method for ;-;
bronze marten
#

the method returns a bukkittask

#

which contains an id

dusty topaz
#

scheduler#cancelTask(id)

bronze marten
#

you can use that id to cancel tasks

brisk mango
#

no

#

that method is shit

#

use BukkitTask#cancel

lament wolf
#

but in my case it has to be inside the runnable.

brisk mango
#

use a Consumer<BukkitTask>

#

Bukkit.getScheduler().runTaskLater(task -> {
task.cancel();
}, 20L);
#

and dont use scheduleBlaBla

#

runTaskTimer/Later exists for a reason

lament wolf
#

So in your code "20L" is the period ?

brisk mango
#

it doesnt matter what is my period, it was just an example

lament wolf
#

Okay

brisk mango
#

also take look at lambdas

#

also you know that you dont have to declare a variable for everything you use @lament wolf

#

you can just do Bukkit.getScheduler().schedule

young dawn
#

Does anybody know what this crash message means? My minecraft installation isn't even directed at that file location.

brisk mango
#

Its not your minecraft installation

#

it has to do something with the lightweight java game library

#

but no idea

young dawn
#

Do you know of some potential solutions?

brisk mango
#

but no idea

young dawn
#

fixed it, apparently my ssd ran out of space

main holly
#

Xdddddd

frigid ember
#

So i have the latest mc version with protocall support but people who use 1.8.9 forge or Baldin cannot join my single Kitpvp server

#

i need a solution to this

lament wolf
#

When I do

player1.hidePlayer(player2);```

player1 can't see player2 or inverse ?
#

or both

surreal sedge
#

I'm sorry to come again but I encounter some issues with my yaml configuration :
I have the following yaml :

leaderboard-displays:
        - title: "main"
          location:
                world: "world"
                x: -60
                y: 66
                z: 0
          objectives:
                - "kills"
                - "balance"

I can't use a mapping for retrieving the list of displays, because it would have no sense to give them a name, and the titles aren't unique, because they refer to which leaderboard they display (there can be several displays for one leaderboard)
LeaderboardDisplay implements ConfigurationSerializable, so that's ok, and take and return a Map which contains the title, the location (in form of a Map) and the objectives (a List of String)
so now, how can I retrieve this ?
with a getList() and then downcast each objects to a Map ?

brisk mango
#

player1 cant see player2 @lament wolf

#

youre hiding a player to a player

#

i didnt understand anything from your question @surreal sedge

#

what is an leaderboard display lol

surreal sedge
#

it s an object I made, that's not the point x)
I want to create it from the configuration file

brisk mango
#

Create what from configuration file

surreal sedge
#

an object

#

a list of this objects

brisk mango
#

yeah but can you be more exact

#

so you want to get a List<Object> from YAML?

surreal sedge
#

eh... yes
but with getList i don't know to which object I should cast it

frigid ember
#

So i have the latest mc version with protocall support but people who use 1.8.9 forge or Baldin cannot join my single Kitpvp server
i need a solution to this

brisk mango
#

public List<Object> getList() {
final List<Object> list = new ArrayList<>();

for(Object object : getConfig().getList("your_list")) {
list.add(object);
} 
}
#

or just

surreal sedge
#

yes, I'm here already

brisk mango
#

getConfig().getList("your_list").forEach(object -> list.add(object));

surreal sedge
#

but wat is the type of the underlying Object

brisk mango
#

so what is the problem then

#

wdym

#

u dont need to cast it to anything

surreal sedge
#

I want to create a list of a custom class, not a list of Object, it has no interest for me

brisk mango
#

what do you mean a list of custom class

surreal sedge
#

this custom class is named LeadeboardDisplay, and implements ConfigurationSerializable

brisk mango
#

if u have an list in YAML it isnt a list of custom classes

#

its an list of objects

surreal sedge
#

a class I wrote myself ?

#

ok, but with Object I can't do anything right ?

brisk mango
#

it cant be saved to YAML though like the way you said?

#

it can be only serialized

#

why wouldnt you be able to do anything with the object

#

for example if you had a list of strings

#

and then u would use the method on the list of strings

#

it would return a list of strings

#

Object is just an abstract thing

#

can be pretty much anything

surreal sedge
#

and how can I deserialize them ? I wrote a deserialize method wich takes the map returned by serialize and return the same object
but for string there's a special method getStringList
here it's yaml objects

brisk mango
#

it doesnt matter tho

#

you should know what you are storing in lists

#

in a YAML file

#

so you can tell if it should return a string list or integer list

#

or boolean list

surreal sedge
#

yes, I know what I'm storing
I'm storing element with this forms

        - title: "main"
          location:
                world: "world"
                x: -60
                y: 66
                z: 0
          objectives:
                - "kills"
                - "balance"
#

but how can I convert that to a java object ?

brisk mango
#

so just getStringList()? like idk whats ur point pretty much rn

surreal sedge
#

It's not string

brisk mango
#

huh

#

what is it then

surreal sedge
#

strings would be like ```yaml

  • title
  • location
  • objectives
brisk mango
#

no you pretty much dont know what youre saying

#

objectives:
- "kills"
- "balance"
#

is an string list

#

as it doesnt have to be in the quotes though

#

objectives is an string list

surreal sedge
#

yes, I know

brisk mango
#

۞๑,¸,ø¤º°๑۩ ןєคภ ๑۩ ,¸,ø¤º°๑۞dnes v 16:41

It's not string
@surreal sedge

surreal sedge
#

but this is an element of my list

brisk mango
#

so whaaaaaat?

surreal sedge
#

my list looks like this

leaderboard-displays:
        - title: "main"
          location:
                world: "world"
                x: -60
                y: 66
                z: 0
          objectives:
                - "kills"
                - "balance"
        - title: "something"
          location:
            world: "world"
            x: 100
            y: 50
            z: 0
            objectives:
              - "life"
#

so I have a list of string (objectives) inside an other list

brisk mango
#

thats not a list inside of an list

#

why is there an - before title

#

leaderboard_displays is an section1

#

title is string

surreal sedge
#

so I mistake by writing this file ?

brisk mango
#

your yaml looks fucked up

#

why not do it like this

surreal sedge
#

wikipedia use a similar syntax

brisk mango
#
leaderboard_displays:
  main:
    name:
    world:
    x:
    y:
    z:
    objectives:
    - objective1
    - objective2
  main1:
   name:
   world:
   x:
   y:
   z:
   objectives:
   - objective1
   - objective2
#

this looks way better

tiny dagger
#

you're still struggling?

#

:d

brisk mango
#

bruh i dont even know whats this dudes point

#

cannot get a list of objects from a yaml

surreal sedge
#

the problem here is that I have to named each objects, whith names that don't have any sense
because several LeaderboardDisplay (the class I'm trying to deserialize) can have the same title

brisk mango
#

bruh thats not my problem though xD

#

what im i supposed to do about that

#

design it with a better way and then u wont have that problem

surreal sedge
#

ok, but I tried to use an other syntax
here you named objects main and main1
np, I will use this syntax since I didn't attempt to do what I wanted to do
thanks for the time you spend

brisk mango
#

like

#

i dont understand how an object class can have same title

#

final LeaderboardDisplay display = new LeaderboardDisplay("name", location, objectives);
frigid ember
#

got the same problem as yesterday when i put a new plugins files isnt creating

brisk mango
#

each instance should have its own name then

#

File#mkdir

#

@frigid ember

frigid ember
#

what

brisk mango
#

what?

frigid ember
#

?

brisk mango
#

wdym what

frigid ember
#

what is file#mdke

#

something

brisk mango
#

well

#

File is an java class

#

and mkdir is an boolean/method

frigid ember
#

ok

#

so how do I fix ti

#

it*

#

without reinstalling again

brisk mango
#

in order to have it; make d i retcory

#

without reinstalling what?

frigid ember
#

spigot

#

and my whole server

brisk mango
#

?????

#

what the fuck are you saying

frigid ember
#

????

brisk mango
#

stop being a troll

frigid ember
#

???

#

what?

brisk mango
#

why would you have to reinstall your whole server just to make a file directory for plugin

#

you make no sense

frigid ember
#

I tried everything yesterday

#

and had to reinstall everything

brisk mango
#

Learn java

#

or the spoonfeed is

#
public final class DataFile {

    private final Main plugin;
    private final String name;

    private File file;
    private YamlConfiguration config;

    public DataFile(Main plugin, String name) {
        this.plugin = plugin;
        this.name = name;
    }

    public boolean setup() {

        if(!plugin.getDataFolder().exists()) {
           plugin.getDataFolder().mkdir();
        }

        file = new File(plugin.getDataFolder(), name);

        boolean succeded = false;

        if (!file.exists()) {
            try {
                succeded = file.createNewFile();
                config = YamlConfiguration.loadConfiguration(file);
            } catch (Throwable reason) {
                throw new RuntimeException(reason);
            }
        }

        return succeded;
    }

    public void save() {
        try {
            config.save(file);
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
    }

    public void reload() {
        config = YamlConfiguration.loadConfiguration(file);
    }

    public YamlConfiguration getConfig() {
        return config;
    }
}
frigid ember
#

ok

#

i just said plugins doesnt create his directory

#

and after creating my self his directory it doesnt work either

brisk mango
#

just use my class

frigid ember
#

i reinstalled it

low sonnet
#

Looking for people in the cosmic test server or cosmic communty that have access to cosmic plugins or cosmic test server plugins (Aka looking for a dev that will be willing to help me and my jouney on creating a cosmic test server) Dm me and we can get talking

tardy lance
#

Hi, does someone know how to get a uuid from a name ? (player not online)

brisk mango
#

Bukkit.getOfflinePlayer(String name).getUUID()

tardy lance
#

okay thanks

surreal sedge
#

@brisk mango title don't represent the title of the LeaderboardDisplay but the title of what it's displays, so several LeaderboardDisplay can displays the same datas, which are stored in a map with their title as key

brisk mango
#

bruh i cant do nothing about that tho because i havent designed the plugin

#

try thinking of something better

low sonnet
#

Looking for people in the cosmic test server or cosmic communty that have access to cosmic plugins or cosmic test server plugins (Aka looking for a dev that will be willing to help me and my jouney on creating a cosmic test server) Dm me and we can get talking

tardy lance
#

@brisk mango but this method is marked as depricated?

brisk mango
#

idk why

#

its the only way to get an offline player tho

#

or just

#

for(OfflinePlayer player : Bukkit.getOfflinePlayers())

#

or

#

Bukkit.getOfflinePlayers().forEach(offlinePlayer -> offlinePlayer.getName());

tardy lance
#

i will try some, thanks for your support 🙂

cloud sparrow
#

@brisk mango @tardy lance Just because it's depreciated doesn't mean you can't use it, it's just letting you know that there are changes in new Minecraft versions. As you may know it's not deprecated in new Spigot versions, but it's deprecated in older Bukkit versions due to the switch from usernames to UUIDs in 1.8, many years ago.

brisk mango
#

@cloud sparrow did I say that you cant use it?

spring cradle
#

Is there an existing event which can be called when a player define a new spawning point (by right-clicking on a bed) or i must use PlayerEnterBedEvent ?

tardy lance
#

Does someone know how to add argument suggestions like /gamemode creative/adventure (Version 1.14.4)

brisk mango
#

tab completion

#

you need to set its tab executor to a command

#

JavaPlugin#getCommand(String name)#setTabCompleter(...

tardy lance
#

okay thanks i will try some 😄

wind dock
#

so-i got cmi through balckspigot(dont judge me too harshly please im broke) and it seems to work as intended, does this rule out the possibility its a virus?

oak stump
vernal spruce
#

@wind dock why would you even say that here?

wind dock
#

uh-idk

#

I just was asking :/

#

is that against the rules or :/

naive goblet
#

Talking about leaked resources or similar stuff should be avoided Geometry

tiny dagger
#

yes geometry there is a possibility, usually people who broke rules broke other rules too

naive goblet
#

@oak stump which line is 21?

#

I can’t see on phone currently

#

And the bin lines is messing up :/

grand aurora
#

Is there any way to get the cause of a PlayerDeathEvent? I want to test if the player died by falling out of the world.

tiny dagger
#

damage

#

you can do it on entitydamageevent

#

check if their health is less or equal to the damage and do your thing

grand aurora
#

How does that work?

#

I want to know if the cause of their death was by falling out of the world, regardless of their previous health or damage

oak stump
#

@oak stump which line is 21?
@naive goblet thats the problem, line 21 is plugin.getCommand("book").setExecutor(this);

naive goblet
#

Can be invalid argument when invoking it’s constructor

oak stump
#

huh

#

my brain isnt processing

naive goblet
#

Maybe a field that isn’t declared

oak stump
#

but they all r xD

naive goblet
#

how do you invoke the constructor

#

And where

oak stump
#

i dunno, only just looked at it, not my code

naive goblet
#

Can you find where they invoke the constructor

#

If you don’t know what I mean it’s when you add new Class()

oak stump
#

i know

#

im looking

#

Main class (Main.java) line 21

naive goblet
#

Send main

oak stump
#

oh thought i did

#
package me.dubleu.cenchants;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

import me.dubleu.cenchants.commands.BookCommand;
import me.dubleu.cenchants.enchants.SpaceWalkerEnchantment;
import me.dubleu.cenchants.enchants.SpeedEnchantment;
import me.dubleu.cenchants.utils.Utils;

public class Main extends JavaPlugin {
    
    public void onEnable() {
        Bukkit.getServer().getConsoleSender().sendMessage(Utils.chat("\n\n &8[&a*&8] &aSuccesfully enabled SpectrumEnchants v1.3.2 \n\n"));
        
        //Load the enchants (Listeners)
        new SpeedEnchantment(this);
        new SpaceWalkerEnchantment(this);
        
        //Load the commands
        new BookCommand(this);
    }
    
    public void onDisable() {
        Bukkit.getServer().getConsoleSender().sendMessage(Utils.chat("\n\n &8[&a*&8] &aSuccesfully disabled SpectrumEnchants v1.3.2 \n\n"));

        
    }

}```
#

wtf is wrong

#

my brain isnt working

naive goblet
#

i dunno, only just looked at it, not my code
pretty sure it is btw

oak stump
#

ye lol package

#

remade whole thing

dry shuttle
#

have you declared the command in the plugin.yml?

oak stump
#

cuz he didnt have a main class or anything

naive goblet
#
commands:
  <commandname>:```
oak stump
#

have you declared the command in the plugin.yml?
yeah he did it already

#
commands:
  <commandname>:```

not to be rude but i aint stoopid xD

naive goblet
#

Huh

#

It wasn’t to you?

dry shuttle
#

code seems to be fine

naive goblet
#

It is

oak stump
#

lol so wtf is problem

naive goblet
#

He probably changed something since the error

#

I mean NPE is normally thrown when invoking un-assigned fields

oak stump
#

found it

#

all good

#

thanks alot anyways

dry shuttle
#

my premium resource got reset to universal catagory and now I have to wait for the thing to be approved again

#

is any way to contact resource staff or smth?

oak stump
#

nope

#

well unless u tag them here, but no

naive goblet
#

Pretty sure dm works

dry shuttle
#

I added Inkzzz but he hasn't responded yet

naive goblet
#

Added?

#

Just dm?

dry shuttle
#

I added on discord

naive goblet
#

Why lol

dry shuttle
#

figured it'd be faster

naive goblet
#

Just dm him instead of friend requesting?

#

Like you don’t need him as friend to start a convo?

dry shuttle
#

I do

naive goblet
#

He has that turned off?

dry shuttle
#

probably

naive goblet
#

If you say so

#

¯_(ツ)_/¯

dry shuttle
#

should I private message them on the forums?

#

I'm kind of in a rush bc I've got people dming me trying to buy the thing

left plover
#

Dm a resource staff member on the forums

#

Is there a way to convert Block to Door like ((Door) block).isOpen(); explanation 100

naive goblet
#

Yes do an instanceof check and then cast

#

Idk if door has some sort of meta or data that should be casted instead of the block itself

left plover
#

Door and TrapDoor aren't interfaces like everything else but that doesn't mean anything does it?

naive goblet
#

Not really

left plover
#

Im clicking a door which should return a door block, trying to cast it to Door and thats when I get an error

org.bukkit.craftbukkit.v1_8_R3.block.CraftBlock cannot be cast to org.bukkit.material.Door

naive goblet
#

?jd

worldly heathBOT
naive goblet
#

Lemme check

#

So you’d have to do something like this

young dawn
oak stump
#

found it
okay found the error but when i try to execute the command it says it doesnt exist lol

naive goblet
#
Block block;
if (block.getType() != Material.DOOR) return;
BlockData data = block.getData();//might be getBlockData();
if (data instanceof Door) {
Door doorData = (Door) BlockData;
}```
#

You want to import the data.type one

#

So you get the right Door one

pliant tiger
#

Guys, how to get a correct IBlockState?

CraftMagicNumbers.getBlock(block).fromLegacyData(block.getData());

Returns invalid data

left plover
#

I'm using 1_8_R3, BlockData apparently isnt a class and block.getData(); is deprecated

naive goblet
#

@young dawn iirc there is a config option you should enable

#

Might want to look that up on the wiki

#

Macho maybe it’s MaterialData

young dawn
#

I disabled online mode in both of my spigot servers and enabled bungeecord.

left plover
#

yes that exists, I'll try it

young dawn
#

And I enabled IP forwarding in my bungeecord server

oak stump
#

okay found the error but when i try to execute the command it says it doesnt exist lol
found it all gooood, thanks for all the help

naive goblet
#

Maybe you need to enable in spigot.yml long time since I worked at that stuff

#

@pliant tiger Block#getState() ?

left plover
#

block.getData() returns a byte and it wants a MaterialData and is still deprecated

naive goblet
#

I mean does it matter if you use deprecated methods?

#

You’re in 1.8.8 anyways

left plover
#

Not really

#

It's still returning a byte, what do I do with that

pliant tiger
#

@pliant tiger Block#getState() ?
@naive goblet its not a NMS

naive goblet
#

Block#getBlockData @left plover

left plover
#

Not a method

naive goblet
#

Oh I see can’t look into it now at phone Ivasik sry

#

getMetaData ?

left plover
#

Yes but wants a string?

naive goblet
#

What?

left plover
#

yeah

naive goblet
#

Wym

left plover
naive goblet
#

Uhm

#

Wait

#

What if you call getState

#

And then work it around from there ?

left plover
#

Yes that works, block.getState().getData()

naive goblet
#

Ok 👌

left plover
#

So do I convert that to a door? With (Door) block.getState().getData()

naive goblet
#

Yes

#

And be sure it’s the right Door import

#

It might be called DoorMeta or DoorData or smtng

left plover
#

Ok, ill try it now, only Door and TrapDoor are classes

naive goblet
#

Okay use Door

left plover
#

Ok

#

Ok that seems to work. Thank you!

celest light
#

One of the pieces of data I need is the typeId, but I see that EntityType.getTypeId is deprecated.

wind dock
#

@tiny dagger oh shoot- how do I know if its not a virus? or is there a way to get rid of it altoegther before it does too much damage?

tiny dagger
#

you can't tell

#

unless he was stupid

wind dock
#

oh

#

how do i get rid of it quickly?

tiny dagger
#

i dunno

wind dock
#

would just like

#

dragging it to the recycle bin

#

and delete

#

would that work

tiny dagger
#

i mean i don't even know if it was virused

#

but nothing is free

wind dock
#

oh

oak stump
red linden
#

Are there any people with a little bit of experience in Illustrator?

oak stump
pliant tiger
#

Guys, how to get a correct IBlockState?

CraftMagicNumbers.getBlock(block).fromLegacyData(block.getData());

Returns invalid data

dry shuttle
#

@oak stump has to be an issue with the plugin.yml

oak stump
#

Kk

hollow crystal
#

Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf Wtf

oak stump
#
version: 2.7.0
name: SpectrumEnchants
author: TheDdosDevil

commands:
  book:
    description: to lazy to do one```
#

@oak stump has to be an issue with the plugin.yml
@dry shuttle can’t be because there is no issue xD look

#

All the enchants work it’s just this command, the command opens a gui, do you think it could be something to do with the gui being wrong?

#

No way

#

xD

#

I have had the conversation

dry shuttle
#

plugin.getCommand("") returns null if the command is not found, It can only be this that is causing the npe

oak stump
#

BookCommand.21 plugin.getCommand(“book”).setExecutor(this);

#

And main 21 is new BookCommand(this);

#

plugin.getCommand("") returns null if the command is not found, It can only be this that is causing the npe
@dry shuttle how can it not find the command, it is everywhere lol

#

I broke spigot

#

Btw spigot 1.8.8

#

Try to register the command in the mainclass
@proud furnace annoyingly tried that FIRST before in the class and it didn’t work

#

No it’s not

#

Definitely not

#

But it’s not my code, I remade it for a guy who said he needs help on my discord

#

Seriously...

#

???

#

That’s not mistake

dry shuttle
#

lol

oak stump
#

xD

dry shuttle
#

Its the getCommand thats returning null right?

oak stump
#

Ye

upper hearth
#

Try to print plugin

dry shuttle
#

plugin can't be null

upper hearth
#

Yes it can

dry shuttle
#

not in his case

oak stump
#

It can’t rn

upper hearth
#

Oh he's just passing this

dry shuttle
#

yea

oak stump
#

Ye

#

I when I thought I’d finally got the hang of it and could be considered “intermediate” xD

silk cape
#

Need help

#

i use wildstacker to stack my drops

#

my cactus farm isnot efficient

#

sometimes drops stack on first drop, sometimes on second

hallow surge
#

i know this is probably a basic java concept but how do I get the messages from the string List to send to the player so it reads of the list like
Line 1
Line 2
instead of Line 1, Line 2

lament wolf
#

\n

hallow surge
#

but string lists are not compatable with p.sendMessage() for some reason

lament wolf
#

Juste

#

Do

#

Arrays.asList(Line1, Line2)

hallow surge
#

okay ill figure out how to draw config values from an array list

bright forge
#

Can something be done?

#

He just says all plugins are lagging

#

Thing is my plugin is about Exploit protection and i can't make it paid because it would be excluding people that really needs it

tardy lance
#

How can i get an Inventorys name? event.getClickedInventory().getTitle() doesn't exists anymore

cloud sparrow
#

e.getView().getTitle()

frigid ember
#

try:
event.getView().getTitle()

#

that same time

tardy lance
#

Thanks 😄

cloud sparrow
#

You have to get the InventoryView from the event with getView(), and then you can call getTitle().

round lichen
#

Can somebody help me?

cloud sparrow
#

with?

#

u need to explain your question

round lichen
#

I made like a command called /sign <text> and I need to have a variable text from args.lenght == 1

#

how do I cast that

cloud sparrow
#

I'm sorry? are you mentioning you want to check if they have a argument for position 0 of the string array in the onCommand?

runic wadi
#

voter suppression you're all reported

round lichen
#

nah not really

#

can you join gen 1? I need to explain

#

pls

cloud sparrow
#
/sign args[0] args[1] args[2]
#
String message = "";

for (int i = 0; i < args.length;i++) {
    message = String.valueOf(message) + args[i] + " "; 
}
round lichen
#

}else if(args.length >= 1) {
String message = "";

                for (int i = 0; i < args.length;i++) {
                    message = String.valueOf(message) + args[i] + " "; 
                }
            }
oak stump
tardy lance
#

I've developed a plugin that opens a gui with an item in it which is named after a money balance stored in files named after the players uuid. but if two people open the menu at the same time, they got the same value...

wraith thicket
#

Create a new inventory for each player and keep track of them per UUID

gray plume
#

I have a custom command made.. how can I make it so this custom command pops up as a suggested command?

tiny dagger
#

you need to asign a tabexecutor as well to it

vernal spruce
#

less scuffy way for a capture point area logic?

tiny dagger
#

selection

vernal spruce
#

it works however not sure at what performance cost

tiny dagger
#

yeah it's a weird logic

vernal spruce
#

i use kind of a weight system

tiny dagger
#

i would've made a ticable interface

oak stump
#

If anyone can help plz do ^^ , if anything friend me

vernal spruce
#

basically each second i pass the list of players inside that region,do the checkings

#

then clear it and so on..

tiny dagger
#

is book registered? @oak stump

#

oh it is

#

nvm

#

debug it

vernal spruce
#

well good enough for a starting point

#

gonna eventually look for a better logic

tardy lance
#

@wraith thicket Every time someone enters the command it creates a new inventory. when it opens it checks if it has the title "Horseshop". If yes, then he changes the 8th slot items name.

ItemStack is = event.getView().getItem(8);

vernal spruce
#

you know inventory slots start from 0 right?

wraith thicket
#

Don't check the name - keep track of the Inventory objects

tardy lance
#

@vernal spruce yes

vernal spruce
#

hmm i think you would have better luck looking into abstract inventory holders

#

its alot easyer once you get the base done

keen goblet
#

Hey guys i have a little problème,
How to have the player execute a command when he right clicks on a PNJ
My code :

import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Villager;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

public class CommandCustomNPC implements CommandExecutor {

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

        
        if(sender instanceof Player) {
            
            //variables
            Player joueur = (Player) sender;
            Location loc = joueur.getLocation();
            Villager npc = (Villager) loc.getWorld().spawnEntity(loc, EntityType.VILLAGER);
            net.minecraft.server.v1_7_R4.Entity nmsVillager = ((CraftEntity) npc).getHandle();
            
            npc.setCustomName("§2Onlydays §cl'inactif");
            npc.setCustomNameVisible(true);
            nmsVillager.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
            
        }
        
        return false;
    }
vernal spruce
#

why not name things in english in the code..

#

doesnt the api teleport rotate his body?

wraith thicket
#

you don't go implementing random bukkit interfaces
by md_5

#

Custom InventoryHolder implementations are a misuses of the API

vernal spruce
#

why can we do it rather than lock it behind something?

wraith thicket
#

It's an oversight.

tiny dagger
#

you can't

#

lock it really

#

unless its public

vernal spruce
#

damn then why it got so popular

tiny dagger
#

is removed and kept on a package basis

wraith thicket
#

You could hide the method that takes it as an argument

tiny dagger
#

oh

#

i thought inventory holder was an internal thing

vernal spruce
#

mhmm guess i gotta change some plugins gui management

tiny dagger
#

why is it exposed?

wraith thicket
#

An oversight most likely

vernal spruce
#

for so many versions though?

chilly cairn
#

I have iron farm on my server and after updating to paper-283 it broke, villagers teleported out of their cages and died, can anyone help?

tiny dagger
#

well people missuses it

vernal spruce
#

well.. ur asking a paper issue on spigot discord? 🤔

#

paper =/= spigot..

wraith thicket
chilly cairn
#

i know

#

i was not aware of paper discord

wraith thicket
#

Go to their wesbide -> community

#

It's there in nice discord blue

vernal spruce
#

so we are using a bug

tardy lance
#

@wraith thicket but i dont get it, why it changes all inventorys named "Horseshop"? I only change that one that is open...

vernal spruce
#

wich somehow works?

keen goblet
vernal spruce
#

well good to know,guess gonna stick to good ol uuid/inventory

tardy lance
vernal spruce
#

noice

#

pastebin has blocked ur ip

#

please use md5s..

#

?paste

worldly heathBOT
tardy lance
#

thanks

vernal spruce
#

oh boy

#

ur creating the inventory in the command?

opal bay
#

oh boy

tardy lance
#

bro idk from this

vernal spruce
#

if the items will always be the same wouldnt it be better to already have them created in a inventory

#

then simply make a copy of that inventory?

obtuse rose
#

hm @subtle blade it's been 2 days and my name haven't get sync with SpigotMC name yet. It's suppose to auto sync right? or did I missed something

vernal spruce
#

dont think names are synced

tardy lance
#

@vernal spruce ehm...

#

maybe?

vernal spruce
#

tbh just go with a manager class

south quiver
#

what does this mean? 20.05 15:42:43 [Server] WARN jontyMS was kicked due to keepalive timeout!

vernal spruce
#

wich keeps track of opened inventories

#

and from there do the work like opening a new inventory and so on

tardy lance
#

cant i just give that inventory an id to track it later?

fathom coral
#

On my server, when I type /send it says that I dont have permission. I have the * permission, so how can I fix this?

vernal spruce
#

thats where the manager comes in,you hold a hashmap with inventory/uuid (or w/e order)

#

so a simple method should be called from the command

tardy lance
#

absolutly no idea how to use hashmaps...

#

i am big oof

vernal spruce
#

oh boy.. they arent rly complicated

#

you can think of it like a pair,name-value they will always be connected

#

HashMap<UUID,Inventory> openedInventories = new HashMap<UUID,Inventory>();

#

but this goes into java basics wich i think you have a easyer time

#

looking at a tutorial..

#

rather than me explaining a specific example

tiny dagger
#

Map<UUID,Inventory> openedInventories = new HashMap<>(); this looks better imo

vernal spruce
#

yeah dont think there is much difference

tiny dagger
#

well

#

first of all you're using the map

#

instead of the hashmap

#

which means it won't break stuff as bad

tardy lance
#

war of the giants

#

who can flex more, or what`?

tiny dagger
#

when you want to use something else than hashmap

tardy lance
#

😂

tiny dagger
#

nah

vernal spruce
#

not rly its just discussion about the map types

tardy lance
#

okay, so i now use Map or Hashmap?

tiny dagger
#

well both

vernal spruce
#

well he is right bout it,you make it risk proof

tiny dagger
#

but pass it around as map

naive goblet
#

You declare it as a Map but initalize it as a HashMap I’d say

#

I mean you could define it as a HashMap in the start if you want but not really necessary

#

Having it just as a Map makes you can redeclare that Map field as another Map type if you want later

#

And afaik most map types doesn’t provide any additional methods

#

You can also stack maps

Map<Object, Object> map, map2, map3;```
tiny dagger
#

isn't this just defining extra maps

#

using the same type

tardy lance
#

Okay guys, there are thousands of methods to do what i want. but if we say id use this:

HashMap<UUID,Inventory> openedInventories = new HashMap<UUID,Inventory>();

How do i dann an entry to it?

vernal spruce
#

i guess if you want to define them later.. but usually you have a specific map you want