#help-archived

1 messages Β· Page 9 of 1

dusky herald
#

com.voidcitymc.Police.Main

#

com.voidcitymc.OtherPlugin.Main

#

if you stick to naming them in their own packages then you shouldnt have anymore issues at all

sharp hollow
#

If we followed proper naming conventions it would be
com.voidcitymc.police.Main
and
com.voidcitymc.otherplugin.Main

dusky herald
#

^

naive goblet
#

Imagine uppercase packages

dusky herald
#

Okay, I finished my PageSorter class; for anyone ya'll are free to use idgaf

naive goblet
#

Uses pastebin

#

You realize I get ephilephsy attack of it.

dusky herald
#

πŸ€·β€β™‚οΈ

naive goblet
#

There's like 1 million other bins

dusky herald
#

I have GitHub, havent pushed it yet.

#

Lol.

#

But I also just dont feel like sharing my project yet

naive goblet
#

Okay I'll check out your current code

dusky herald
#

It's nothing special.

#

Just to save other people time.

#

Like, if they want to sort their objects into pages like for commands

naive goblet
#

I mean certain things could be better but good work

#

params lowercase though

#

Name conventions is important

dusky herald
#

They were lowercase before, I actually uppercased them for other reasons.

#

I'll probably change it.

silver pewter
#

Hello, to make a server selector when I need to use the bungeecord api or not?

naive goblet
#

I don't think so

#

hmm

dusky herald
#

The only reason I even bothered to make the class, was because I added the functionality into a command

#

and then earlier I was like im a fucking dumbass, I should have just made it into its own class

naive goblet
#

Yeah

silver pewter
#

@naive goblet, how would you send people to the server then

naive goblet
#

PluginMessageListener

#

iirc

dusky herald
#

btw @naive goblet I started learning Java a few years ago and then I stopped for a few years, so if you got any pointers feel free.

#

besides the naming conventions

naive goblet
#

I have some but we'll take it when you use a proper bin :]

dusky herald
#

πŸ˜†

median wing
#

Anyone know how to make armorstands follow a player?

#

?

naive goblet
#

Specify

#

Context

median wing
#

I basically have a command that is just for testing for now, but on command execution an armor stand spawns, I'm trying to make it follow the player after they execute the command.

naive goblet
#

First you’d need to track PlayerMoveEvent

#

Then maybe teleport the armor stand ?

#

With no gravity?

vast dome
#

hey guys

gusty crane
#

Hey

vast dome
#

i need a little help

#

i buy a plugin called BannerBoard but i didn't receive the key for the renderskin function... any idea about it?

gusty crane
#

idk anything about a key

cloud sparrow
#

Contact the developer of the plugin for help in a private message.

#

We can't help you with something we don't manage.

gusty crane
#

also do try avoiding asking for support in the review section

#

theres plenty of other ways

#

may i ask tho

#

how does one use the lore thing again

#

meta.setLore("what to put here?");

#

keep getting an error

#

im big brain rn

dusky herald
#

You put a List<String>

median wing
dusky herald
#

List<String> lore = new ArrayList();
lore.add("Line1");
lore.add("line2");
lore.add("line3");

frigid ember
#

lol

hearty basalt
#

Anyone can help me set up my server lol

frigid ember
#

sure

hearty basalt
#

Do i run buildtools as my sever

#

server*

frigid ember
#

spigot

median wing
#

I do maven but idk

dusky herald
#

Follow the instructions on how to use BuildTools, it will compile the Spigot server for you.

frigid ember
#

yes

gusty crane
#

oh thanks i had completely forgoten about that

#

appreciate it

hearty basalt
#

Follow the instructions on how to use BuildTools, it will compile the Spigot server for you.
@dusky herald Thats what i meant

median wing
#

guys, anyone know how I can use the setVelocity() to have an armorstand follow a player?

hearty basalt
#

it decompiled craftbukkit,bukkit,spigot,and maven

dusky herald
#

use Spigot

frigid ember
#

yes

#

like i said

dusky herald
#

Go to Spigot -> Spigot-Server -> Target

#

then use spigot-1.15.2-R0.1-SNAPSHOT as your server

#

You could drag it to a specific folder somewhere else on your PC

median wing
#

you guys know?

dusky herald
#

and run it off of a bat

#

@median wing I don't know anything about the armorstand, or even if its an entity...I could maybe figure out a way?

median wing
#

Armorstands are considered entities, and yes please, if you could it would be appreciated

hearty basalt
#

thanks bro

dusky herald
#

@median wing Velocity is a Vector-type class, you can construct using Vector(double x, double y, doublez) (or even float and int)

#

i.e. Vector aSMove = new Vector(x, y, z)

#

armorStand.setVelocity(aSMove);

#

You can read this to figure out how to calculate your Vector, and how to make it move towards your Player

#

So you can probably get figure out how much to calculate the vector for the ArmorStand to move, like if it's following the Player

#

by creating a vector, and using the difference between the distance of the ArmorStand and Player to figure out what your X,Y,Zs need to be

frigid ember
#

How would I structure multiple animations in an oop friendly way?

dusky herald
#

and then instead of putting it on a PlayerMoveEvent, you could probably create a Runnable to make your mobs move with your players

#

because a PlayerMoveEvent would more than likely trigger too frequently.

#

As far as helping you step by step, I probably cant because that'll take me too much time, lmao.

gusty crane
#

so eherm

#

about that lore

dusky herald
#

yes

#

@frigid ember I dont know, sorry 😦

median wing
#

Thank you Blackveiled

#

much appreciated

dusky herald
#

Just remember the vector is relative to the current position of the Entity

#

So it's not coordinates, it's rather just the distance you want the Entity to move.

gusty crane
#

if(sender instanceof Player) {
Player p = (Player) sender;
Inventory inv = Bukkit.createInventory(null, 9, "Weapond of mass destruction: ");
ItemStack gs = new ItemStack(Material.GOLD_SPADE);
ItemMeta meta = gs.getItemMeta();
meta.setDisplayName(ChatColor.YELLOW + "Claiming Spade");
ArrayList<String> lore = new ArrayList<>();
lore.add(ChatColor.GRAY + "Worse than what both the Americans and Soviets had!");
gs.setDurability((short) 0);
gs.setItemMeta(meta);
inv.setItem(4, gs);
p.openInventory(inv);

#

that worked well

#

now i am new

dusky herald
#

You didnt set the lore.

#

gs.setLore(lore);

#

or, sorry

gusty crane
#

i knew that.

dusky herald
#

meta.setLore(lore);

#

my bad

gusty crane
#

i mean

hearty basalt
#

can someone try connect to my server

gusty crane
#

i knew that

dusky herald
#

Oh, lol. What's wrong?

#

@hearty basalt you can connect to it right?

gusty crane
#

thx tho appreciate it

dusky herald
#

@gusty crane it works though right?

gusty crane
#

i mean honestly i belive this is going way down ive got no idea on how to make this work for bungee but

#

not getting any errors

dusky herald
#

You just gotta be creative πŸ˜‰

#

Part of the challenge of developing is figuring out ways to make it work.

gusty crane
#

there isnt any extra modifications i gotta do tho to make it work for bungeecord

#

tho is it

#

hope not

dusky herald
#

I really don't have an answer for that. What you did should work, but as far as working with BungeeCord; I have no idea. I've never worked with it before.

gusty crane
#

ye this is my first plugin so

#

just placing my bets

dusky herald
#

Trial and error is your best bet. If you haven't really worked with Java much then you should read tutorials online to teach you the basics.

#

and then read the API Docs for Spigot and BungeeCord and that should help you learn how to apply them to your plugin.

gusty crane
#

ive worked with python and headaches due to my server doing the impossible

#

and with little to no sleep this will work by the sheer amount of hope

#

its not really that advanced its just like u do a command get a gui get a spade and lifes great

#

ik im good at explaining

frigid ember
#

yes listen to that man

potent creek
#

Hey does anyone know about a plugin that allows for an item economy, but players cannot craft the items themselves? Like some sort of paper with an NBT tag or something?

frigid ember
#

yes covid 19 plugin

gusty crane
#

works on 1.15.2 and all as far as im aware

potent creek
#

@gusty crane Do you use it yourself?

gusty crane
#

i mess around with alot of plugins

#

but yes

potent creek
#

@gusty crane and it works as an economy plugin with vault etc?

gusty crane
#

works like it

#

u do the command u get the paper with a very readable name and if u click it it gives u the money

#

but depends what u mean as an economy plugin

potent creek
#

like you right click the paper and it gives you money into your bank account?

gusty crane
#

yes

potent creek
#

ohh that's not what we're looking for - I really meant like an item economy

#

like how server use gold ingots as a currency, but instead of gold ingots some item that cannot be forged

#

(otherwise you get mad deflation)

gusty crane
#

think ive seen that aswell

#

but depending on what u mean

#

idk the name tho

potent creek
#

maybe it's me but compared to the old days it has become somewhat harder to find plugins

gusty crane
#

there is most likely a plugin out there doing it if not one coulda always make one

#

i can agree in that

#

ish

wanton delta
#

hey i'm using protocollib to change the name of an entity via packet

gusty crane
#

u could prob do some cheap programming so to say tho

potent creek
#

yeah getting used to the spigot api now with a couple of customs but I like to avoid re-inventing the wheel

wanton delta
#

watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(MetaIndex.ENTITY_CUSTOM_NAME.getIndex(), Registry.getChatComponentSerializer()), new ChatComponentText(lineOfText)); is what i got so far, but doesn't seem to work. I can modify values like visibility and boundingbox fine, but the custom name doesn't show.

frigid ember
#

How can I spawn ender crystals, the same as a normal entity?

rapid yacht
#

hey guys

#

I need help finding a plugin

#

that I completely forgot the name of

#

basically it allowed the players to levelup through a gui with money, it also had the ability to give certain rewards for each level of the rankup (ex. one carrot for ranking up to level 2, four diamonds for ranking up to level 3 etc) Does anyone know the name of the plugin?
I'm pretty sure it was Level(something) I could be wrong though

#

and I remember that the levels you could redeem had a minecart with chest as the item

#

levels that you didn't unlock yet had a minecart I believe

flint grove
open hatch
#

having an issue with discord, wont let me post. Seems a file name kicks off a warning

#

First time installing Spigot. Followed the wiki. Ran BuildTools no problem, created build files. Got an error with the start up scrip. The spigot file name with the jar extension has the version in it. Seems like it shouldn't.

fleet crane
#

that API has been removed a long time ago

#

the jar name has the version in it

#

change your script or rename the jar

open hatch
#

ok, thanks

silver pewter
#

Hello, how can I set custom player head textures?

flint grove
fleet crane
#

doesnt change my answer

quick arch
#

Should be easy to change

flint grove
#

Im messaging the author to see if he can change it as a quick fix im going to build my own version without checking for the api

quick arch
#

It can be fixed easily, I just forgot the link

#

https://api.spigotmc.org/legacy/update.php?resource=

#

there's the link

flint grove
#

That would work thanks

#

now to change the api link in the plugin lol

quick arch
#

The method should also be get now

flint grove
#

okay

quick arch
#

I should be able to fork it

flint grove
#

yeah if you dont mind since im newer to java

#

fork then you can also submit a pr

quick arch
#

yeah

flint grove
#

the resource id is 14754

ebon yoke
#

any idea why i cannot use tp while i do have the node minecraft,command,tp

#

replace , with .

flint grove
#

operator error

ebon yoke
#

because the bot thinks its a url otherwise

#

and what does that mean ?

unique hamlet
#

Your name is familiar johncsuti

flint grove
#

yours too hmm

acoustic herald
#

is anybody here good with bedwars rel

flint grove
#

what server were we in?? @unique hamlet

unique hamlet
#

Ragearcade??

#

Familar?

flint grove
#

nope

unique hamlet
#

Hmm,

flint grove
#

@quick arch its under Session.java

quick arch
#

yeah

flint grove
#

looks like most of the code is already there

frigid ember
#

lol

open hatch
#

@fleet crane That was it, thanks again. Working on installing EssentialsX (and Vault)

quick arch
flint grove
#

lol

ebon yoke
#

any further info on my question ? would really like to be able to tp without being op

flint grove
#

use a permissions plugin that works

ebon yoke
#

could it be the permissions plugin tho ill try another one but seems unlikely

frigid ember
#

luck perms

#

^^^^^^

flint grove
#

yes use lp its the best one around some permission plugins i have tried dont work well with some things permissionsex

quick arch
#

Only removed a couple of lines

flint grove
#

thanks

quick arch
#

Time to fork it and make a pr

frigid ember
#

Are Manager classes a sign of bad design?

#

lol

flint grove
#

are we able to specify an api version? [22:48:07 WARN]: Legacy plugin Scoreboard-revision vR3 1.4.2 RELEASE does not specify an api-version.

#

make it full 1.15 compatible?

quick arch
#

oh yeah

frigid ember
#

usually that means something is just not specify correctly however it was made

quick arch
#

actually, that shouldn't matter much

frigid ember
#

yes

quick arch
#

that just shows that its still using legacy stuff

flint grove
#

creature comforts

#

no warnings when you start the server looks nice and feels nice

frigid ember
#

true

little depot
#

hey i just wanna ask, is there a free login plugin for 1.15.2 ?

frigid ember
#

for what

little depot
#

for a server

frigid ember
#

Hey guys, Are Manager classes a sign of bad design?

quick arch
flint grove
#

thanks ill give it a go

quick arch
flint grove
#

yeah and github hasn't seen him in longer but its a start

quick arch
#

yeah

dusky herald
#

@frigid ember Nah, I wouldn't say managers are a bad design. They're a good way to access your data in a centralized location.

flint grove
#

works great thanks for your help

quick arch
#

πŸ‘

frigid ember
#

I looked it up online and it said that they are a sign of bad design, I'm guessing that site was wrong, thanks

acoustic herald
#

is anybody here good with bedwars rel

dusky herald
#

@frigid ember I mean, you shouldn't make a manager if there is no need.

frigid ember
#

@acoustic herald

#

i do

potent creek
#

there is most likely a plugin out there doing it if not one coulda always make one
@gusty crane I found a plugin that allows for a non-foreable item-based economy! The New Economy plugin works if I add lore to the items!

neat grail
#

Guys, how do I change the spawn point when going through the end portal?

latent rock
#

Is there a good plugin that logs everything a player does

dusky herald
#

There usually are, maybe look up a Logger plugin?

cloud sparrow
#

Core Protect

#

@latent rock

latent rock
#

Thanks

idle dagger
dusky herald
#

Well, it says malformed JSON

#

on Line 1

idle dagger
#

would that cause a crash though? seems like it should be handled but if that's what causing it I can fix it

fleet crane
#

thats not a crash

#

if theres a crash there will be a log in crash-reports

full meadow
#

One message removed from a suspended account.

fleet crane
#

yes

fleet crane
#

cool

#

now report it to the bug tracker please

idle dagger
#

πŸ‘

civic patio
#

really the only stuff I need to store on a db is vault,luck perm info, and mcmmo stats right (fac server)

velvet halo
#

There are resources that will recommend you having to use a database. I recommend reading more over the resource description to see if it is necessary

frigid ember
#

so, i have some questions - I am thinking of creating a "keyframing" tool, which would allow people to create "custom mobs" per se, through keyframing

#

my thought is that you'd start a new "project" or something - an armorstand spawns at your location, marking the center. you can spawn other entities or armor stands and "link" them to the origin, adding them to a list. as the mob moves, these entities are teleported relative to the origin entity.

#

so let's say you create an arm or something; you have a few armor stands in position. you save their data and positioning as a "frame", move them, make another "frame", etc etc. when it's active, each frame is played, one after the next.

#

my question is this: if i want to extend this to ANY entity, not just armor stands, is there a sort of "catch-all" way i can serialize an entity's data? (such as its armor contents, things it is holding, invisible, potion effects, etc etc.)

#

you can essentially convert an ItemStack to a String, just wondering the same about entity data

#

or if i'd have to poke through every NBT value of every entity in the game and make my own saving-parsing-contraption

dusky herald
#

I'm not 100% sure, but I would say yes, as long as they share the same interfaces. If not, then you would have to go through the values of those entities.

#

I'd look through the entities APIs and interfaces and see how you could handle them all.

frigid ember
#

alright, thank you!

grim sapphire
#

any good inventory apis/libraries for 1.15?

frigid ember
#

used cardboard for a while

grim sapphire
#

?

frigid ember
#

ahh heck it was a class i found somewhere on the bukkit forums, it's really old but it allows serialization of inventories

#

they'd be converted to a string, which could be converted to an ItemStack[]

#

and with that you could do whatever you like

#

yeah here it is

#

it's around 15 lines of code

#

two methods, itemToStringBlob(ItemStack stack), and stringBlobToItem(String stringBlob)

civic patio
#

multiverse core isn't working for me - is this due to me having via version installed?

#

would it just be okay to use multiworld

compact marsh
#

Do you have any errors in the console?

#

If so, please send us the error.

fleet burrow
#

How would I compress a location to a Long?

timid valley
#

return ((long)x & 0x7FFFFFF) | (((long)z & 0x7FFFFFF) << 27) | ((long)y << 54);

#

note, this does not match vanillas method

#

see BlockPosition.a if you need to match vanillas

#

public static long a(int i, int j, int k) {

#
public static int getBlockKeyX(long packed) {
        return (int) ((packed << 37) >> 37);
}
public static int getBlockKeyY(long packed) {
        return (int) (packed >>> 54);
}
public static int getBlockKeyZ(long packed) {
        return (int) ((packed << 10) >> 37);
}

to unpack it.

fleet burrow
#

Thanks πŸ™‚

frigid ember
#

hmmmm, this is strange

civic patio
#

making a plugin that requires actions given clicking an item in a pop-up gui

#

what event should I use for when the player clicks an item and then an action occurs

#

in the gui that pops up

fleet burrow
#

InventoryClickEvent

naive goblet
#

If you’re going to create menus, you may consider implementing InventoryHolder

#

any good inventory apis/libraries for 1.15?
@grim sapphire Make your own framework for it otherwise. (:

mossy zenith
#

I'm not sure why this isn't working... πŸ€”

        Player player = event.getPlayer();
        ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
        BookMeta bookMeta = (BookMeta) book.getItemMeta();
        List<BaseComponent[]> pages = bookMeta.spigot().getPages();

        BaseComponent[] page = new ComponentBuilder("Click me")
                .event(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://example.com/"))
                .event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Visit our website!").create()))
                .create();
        bookMeta.spigot().addPage(page);
        bookMeta.spigot().setPages(pages);
        bookMeta.setTitle("Guidebook");
        bookMeta.setAuthor("MrReeMC");
        book.setItemMeta(bookMeta);
        player.openBook(book);```
frigid ember
#

I downloaded a custom map and is it possible to load all the chunks that are part of the map so it shows up on dynmap? (I dont want to generate other chunks that are not part of the map) (I am on 1.15.2)

uneven cradle
#

You can use ChunkMaster to prevent the world but it doesn't respect the world border

#

*pregen

frigid ember
#

i didnt work on 1.15.2 for me for some reason

uneven cradle
#

Really? Worked on my server πŸ€”

frigid ember
#

also my map is 4000 x 10000 will it still work?

uneven cradle
#

Should do.

frigid ember
#

will it generate more chunks after the map is over?

uneven cradle
#

Yes but you can just turn it off

#

It also won't generate if there are people online

frigid ember
#

how can i remove those chunks afterwards

#

i dont want them to show up in the dynmap

uneven cradle
#

I think that if you set the radius of ChunkMaster to half that of the world border then it shouldn't generate past that.

frigid ember
#

i dont have a worldborder

#

i dont know how to set it up either

#

do you know how?

#

i am a noob at this

uneven cradle
#

Half the radius of the map if you don't have a world border

#

But you will want to set up a border anyway so that people don't accidentally load the chunks and make them show up on dynmap.

frigid ember
#

@uneven cradle how do you set up a border please tell me

opal adder
#

You mean /worldborder set <size>?

frigid ember
#

i dont know

#

i just have a 4000x10000 area and i want to have a worldborder around it so no one can go outside and generate chunks

opal adder
#

If you are running a server that is version 1.8 and above, just type /worldborder

frigid ember
#

what do i do after it

#

just /worldborder ?

opal adder
#

Well if you wanted a 10k sized worldborder, that extended to 10k on each coordinate, you would type /worldborder set 20000, however you're situation seems slightly different. But you can very easily look up how to set a worldborder online, because that is a default command built into minecraft 1.8+

frigid ember
#

all the ones i saw made it a square

#

but i need to make it a rectangle because mine is 4000 x 10000

fleet crane
#

If you’re going to create menus, you may consider implementing InventoryHolder
@naive goblet noooo, don't do that

#

/me cries

vernal lance
#

What about custom inventory holders?

#

Are they that bad?

fleet crane
#

You're not meant to do that

#

I have no idea where tf this trend started

vernal lance
#

I mean I used to use titles for detection but inventory holders makes it way easier to check and reliable

#

So that's probably why people like it

fleet crane
#

The method literally returns Inventory that you can == on

#

I have no idea why implement custom inventory holder would be the logical step

tiny dagger
#

^

#

i was actually suprised by that too

echo rune
#

hi all can i please have some help

fleet crane
#

?ask

worldly heathBOT
#

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

tiny dagger
#

okay md

echo rune
#

Do 0 tick farms not work on spigot? my friend made a server for the 2 of us to play, and it isnt working

tiny dagger
#

i'm pretty sure spigot fixes mc bugs if any found

vernal lance
#

What if the inventory isn't always the exact same though

fleet crane
#

I have no idea but it sounds like cheating

vernal lance
#

I guess you can make a object which extends the inventory

#

And return that perhaps

fleet crane
#

Pretty sure heard someone saying they removed them from vanilla in 1.16 anyway

echo rune
#

yes but im on 1.15

vernal lance
#

Good to know

frigid ember
#

i dont know what to do

echo rune
#

and i cant find anytrhing on the internet saying if u can or not

frigid ember
#

when i do /fill -5376 0 -2688 -5376 256 2688 minecraft:barrier it says position not loaded

naive goblet
#

www spigotmc org/wiki/creating-a-gui-inventory/ @fleet crane Update this as well?

frigid ember
#

how do i make my flying speed really fast

#

is there a plugin for it for 1.15

naive goblet
#

Velocity

frigid ember
#

i dont see a version for 1.15

naive goblet
#

Lmao it’s not likely to change anything that would break earlier versions in 1.15

frigid ember
#

ok

#

how do i give a player a item in java whit spigot plugin?

naive goblet
#

Player#getInventory#addItem(ItemStack)

frigid ember
#

and item stack is the id of the item?

naive goblet
#

For instance java //Getting player Conclure, getting inventory, adding new itemstack with material diamond and a stacksize of 2 Bukkit.getPlayer("Conclure").getInventory().addItem(new ItemStack(Material.DIAMOND, 2));

frigid ember
#

thanks

sour dock
#

no need to check for titles or create custom implementations of bukkit classes

fierce jay
naive goblet
#

Contact the author of the plugin?

sour dock
#

my plugin

vernal lance
#

The issue is

#

If you have dynamically generated inventories

sour dock
#

my inventories are dynamically generated and items are changed while the inventory is open

#

InventoryView stays the same

#

I don't know if checking equality for Inventory works but md5 said it so it probably does

vernal lance
#

Perhaps, I'll look into it more when I add support for 1.16

#

But I personally prefer minecraft itself dealing with the inventory side so I don't have to save it somewhere

#

Especially if they'd be removed after they are closed

#

Since they are also per player

sour dock
#

my menus are as well

vernal lance
#

Got examples of yours?

sour dock
#

yeah, I use this util for my menus

#

I can send an example, one sec

#

leaderboard menu with player heads

#

(you open this menu by calling the constructor)

#

this one has a refresh timer

vernal lance
sour dock
#

this item builder is very convenient

#

spigot should have a built-in item builder

vernal lance
#

I'll look into it more when it does end up breaking

#

or when I have spare time to future proof the plugin

sour dock
#
new ItemBuilder(Material.DIAMOND_PICKAXE).unbreakable().damage(40).name("Test").create()
vernal lance
#

so basically in a nutshell you save the inventoryView and you test that correct?

sour dock
#

yes

#

this util class is basically just a wrapper for everything

#

it provides a more simple "on close" and "on click" event

normal swift
#
new ItemBuilder(Material.DIAMOND_PICKAXE).unbreakable().damage(40).name("Test").create()

@sour dock Wow Easier way than dealing with default standards

vernal lance
#

wouldn't you also be able to make a custom Inventory object which implements the Inventory class ThinkingInverted

sour dock
#

but why would you that

#

if you can simply test for equality

vernal lance
#

so you can easily test that compared to saving the menu yourself

#

because your solution requires you to save everything

#

when I could technically add a enum to the custom inventory

#

which I can easily check for

sour dock
#

"save everything" just the inventory object

vernal lance
#

just a random thought

#

well each time a inventory gets created

#

and then you have to worry about removing it after

sour dock
#

garbage collection does that

#

I don't keep iconmenu instances around

#

there's no need to

vernal lance
#

so you rely on Java garbage collection to deal with it

#

I see

#

not sure how reliable that is

sour dock
#

it's not like you can manually garbage collect lol

vernal lance
#

I suppose

sour dock
#

are you talking about manually setting a local variable to null at the end of a method?

vernal lance
#

anyhow thanks for the info :)

#

nah

tiny dagger
#

i haven't seen garbage collection to fail so far

#

πŸ€”

sour dock
#

you don't have any control over it anyway

tiny dagger
#

go c++

sour dock
#

even System.gc() is only a suggestion to run garbage collection

tiny dagger
#

if you just want total control

sour dock
#

yeah enjoy segmentation faults and double free errors

sharp hollow
#

Wouldn't be hard to create a plugin that's just nothing but item builders tbh πŸ˜‚ @sour dock @normal swift

sour dock
#

I just shade this into all my plugins

normal swift
#

i think i will implement this too in future plugins

#

never thought about it until now

#

lol

tiny dagger
#

btw, anyone knows if the 1.8.8 ymlconfig replaced any dot to ,?

#

it seems to happen to some users all of the sudden since i released legacy version

normal swift
#

never ran into this issue

brazen heron
#

Hello everyone, i have a question. I am not a developer myself, but I'm wondering if it is possible to make a plugin that can display a webpage in a Minecraft server? It will not be used to watch video's, but it would be enough if you can read the website and fill in some things... I was thinking maybe this can be done by using item frames, maps and armor stands?
Since I am not a developer myself I wonder if someone can tell me if this is possible!?

normal swift
#

display webpage in minecraft

#

you mean whole website

tiny dagger
#

but did you used configurationsections?

#

so far to me is working

brazen heron
#

yes

tiny dagger
#

maybe weird things the users were using then πŸ€”

normal swift
#

Tried to Create YamlConfiguration from scratch?

#

or you are using default builtin spigot

brazen heron
#

I don't have a server myself, but I first wanted to know if it is possible

tiny dagger
#

i use the build in spigot

#

same as i do for the 1.14+ version

#

but it seems to me both work as expected

#

yet to 2 users

#

all their dots are replaced with commas

#

so weird

brazen heron
#

But there is already a plugin?

normal swift
#

@brazen heron maybe it is posible to display text from website but dont know if you want this

#

just like spigot update checker for checking server version from string on their website

brazen heron
#

No I really need a whole picture of the website

normal swift
#

you cant use pictures in minecraft chat without mods

brazen heron
#

It doesn't have to be in the chat either, but it has to be on a wall from item frames

normal swift
zenith siren
#

How do I pause a for-each loop?

#

Or a while-loop

normal swift
#

break;

zenith siren
#

That stops it

#

Not pause it

#

I need it to pause it for and X amount of seconds when a string in the list begins with "wait "

normal swift
#

add boolean isPaused = true

#

and check it on loop begining

#

then via command change it

zenith siren
#

I got this string list config.getStringList("commands"). I want to execute them after each other but there's a custom "command". You can add - wait 5 which will wait 5 seconds before the next command will execute, I can't seem to find a way to implement it

normal swift
#

Honestly i dont know

#

i dont have an idea how to doit

#

@sour dock any idea?

sour dock
#

yes

#

easy to do this recursively

zenith siren
#

What

sour dock
#
void exec(List<String> commands) {
  while (!commands.isEmpty()) {
    String command = commands.remove(0);
    if (command is wait command)
      bukkit scheduler, call exec(commands) after some time
      break;
    else 
      run command normally
  }
}
#

it would probably be best to use some other data structure, removing the first item from an arraylist is not a good idea

#

or rewrite this code so you remove the last element

#

or keep an index and don't remove elements

zenith siren
#

Wow that's smart

#

Thanks!

sour dock
#

you're probably going to have max 10-20 commands so using an arraylist is fine for performance even though it won't be O(1)

#

for a minimal effort improvement you can use a Queue

#

since this is FIFO

#

or a stack and add it backwards πŸ€”

#

though at that point you might as well just use an arraylist in a smarter way

#

I'm just rambling at this point

stone rampart
#

I'm so dumb lol

#

I was reading that code for so long like what language is that

sour dock
#

java + english

stone rampart
#

yeah ik now

#

just late hours brain

frigid ember
#

that is general

sour dock
keen magnet
#

hi, the event doesn't get fired

#

um I got warned when posted the code

stone rampart
#

try this

keen magnet
#

for posting a link

stone rampart
#

5 tips on how to fire an employee gracefully

#

haha joking

#

what event

sour dock
#

might need to !verify first

stone rampart
#

and link the code with a code block with three backticks on either side

normal swift
#

i need to rest 0_0

stone rampart
#

write the code*

#

```java

<code>
```

keen magnet
#

I did

stone rampart
#

@keen magnet write it like that

keen magnet
#

and I got warned

#

wow

#

"posting an url"

#

lmao

stone rampart
#

copy that thing

#

```java

<code>
```

#

this

#

and write the code where it says <code>

keen magnet
#

I know

#

that's what I did

#

and I got warned

stone rampart
#
?```
keen magnet
#

anyways I verified myself

stone rampart
#

ok

keen magnet
#
    @EventHandler
    public void onItemDamage(PlayerItemDamageEvent e){

        System.out.println("uwu");

    }
stone rampart
#

link

keen magnet
#

it's not a link

#

damn

#

getServer().getPluginManager().registerEvents(new ItemDamageListener(), this);

stone rampart
#

did you register the event

keen magnet
#

yes

normal swift
#

Hey guys ever heard of Geyser Server?

stone rampart
#

does itemdamagelistener implement listener

sour dock
#

it has to

#

or you'd get a compiler error

keen magnet
#

yeah

#

isn't it supposed to get called when hitting with a sword for example?

#

oh

#

wow

#

it doesn't only for the sword for some reason

naive goblet
#

Just check the item on entitydamageeveent or smtng

solemn grove
#

Do I still need to check for permission with sender.hasPermission if I wrote them in the plugin.yml?

commands:
  mycommands:
    description: The decription
    permission: plugin.command.perm
    usage: /mycommands [parameter]

permissions:
  plugin.command.perm:
    description: Allow player to access this command.
    default: op

Another question, I always thought YAML will not parse "." (dot) correctly for keys. But this example puts them in: https://www.spigotmc.org/wiki/plugin-yml/#permissions. So YAML will actually parse them correctly?

naive goblet
#

Yes

#

when return false;

#

it will send the permission message

#

I think you can do like Command#testPermission()

sour dock
#

yes, use testPermission

naive goblet
#

It will test for the permission you assigned in plugin yaml

solemn grove
#

thanks

naive goblet
#

If fail it'll send the perm msg I think

solemn grove
#

how about the dot in YAML file

naive goblet
#

if you don't call the testSilent method or smtng

#

wym

sour dock
#

yes it will send a permission message that is unfortunately unconfigurable

#

the dots are fine

solemn grove
#

0.o

sour dock
#

may want to enclose them in quotes if you want

naive goblet
#

Tajam or just create your own command constructor

#

Not if you do it silent

#

I think

sour dock
#

you don't really need to worry about the dots, you don't need to access the permission yourself

naive goblet
#

bruh

sour dock
#

I wish the bukkit configuration API didn't use dots for accessing members

naive goblet
#

There's much wrong with the API

#

But it's working :]

#
    public boolean testPermissionSilent(@NotNull CommandSender target) {
        if ((permission == null) || (permission.length() == 0)) {
            return true;
        }

        for (String p : permission.split(";")) {
            if (target.hasPermission(p)) {
                return true;
            }
        }

        return false;
    }
sour dock
#

bukkit is considered a legacy API by most people at this point

solemn grove
#

because I remember last time i place dot in my config file it breaks the configuration

#

so I am confused

naive goblet
#
//onCommand
if (!command.testPermissionSilent(sender)) {
  return false;
}
``` iirc
sour dock
#

shouldn't you return true, so it doesn't send the command usage?

naive goblet
#

Is false sending command usage?

sour dock
#

and use the non-silent version so the user knows what's going on

#

yes

naive goblet
#

uh ok

#

Well better just make your own Command.

sour dock
#

why?

#

declaring it in plugin.yml instead of making your own subclass manually is the convention

#

unless you want to make the command name configurable

tardy moon
#

Hi,
Can I search for the name of a plugin by giving a description here?

subtle blade
#

bukkit is considered a legacy API by most people at this point
Those people would be considering wrong because Bukkit is still actively maintained and is the main API the majority of people use. In terms of server software, however, CraftBukkit is considered legacy

sour dock
#

yeah I'm not saying I agree

#

they say move to sponge but sponge doesn't even have 1.13+ versions I believe

#

I get why people don't like Bukkit but it's hard to change an API for compatibility reasons

naive goblet
#

More freedom RobinMC. Being able to construct what you want and make subcommands etc. Then we can use the CommandMap and register our commands instead.

sour dock
#

yeah I know, I do it myself as well but I wouldn't recommend it to someone here

#

I'm pretty sure you need reflection to get the commandmap instance

naive goblet
#

I'd say it's better but ig it's preference, if you want to go with bukkits way of doing it sure.

sour dock
#

(or at least if you want to make it version independent)

naive goblet
#

Yes reflections obv

#

It's not hard though

#

You just have to get SimpleCommandMap and then all g.

#

@subtle blade I donated 10$ is that enough to change name? If so how do I do it?

subtle blade
#

It is, yes. Though it won't be processed immediately because md does these manually. Additionally, if you've donated with an email not associated with your Spigot account, create a thread in Donation Enquiries with the email you used to donate

rocky knot
#

@sour dock i would discourage from moving to sponge.
Bukkit/spigot/craftbukkit is simplistic, old and sometimes stupid beyond imagination. but eventually you can always do what you want.
Sponge lacks dozens of features, some parts of its api are extremly retarded.

Eventually in spigot you code your plugin features. In sponge you battle with its api

sour dock
#

yeah on the one hand the bukkit api lacks a lot of features, but that makes it easy to understand and get started with, and gives a lot of freedom to create your own utilities etc

#

I am not saying Sponge is better at all

rocky knot
#

Just for example to create custom nbt on an item in spigot its one line. In sponge it was around 150 lines of stupid boilerplate code. Which you cannot realy abstract away. And on top of that if your plugin wont load and player server loads the item you lose your nbt tags

peak marten
#

We created a very very advanced plugin, with tons and tons of features, and we only used spigot API

#

Question though, I've never stumbled upon this issue before

#
@EventHandler
    public void onDoorInteract(PlayerInteractEvent e){

        Bukkit.broadcastMessage(e.getMaterial().toString());

        if(!(e.getAction() == Action.RIGHT_CLICK_BLOCK))
            return;

For some reason, the broadcasted message is Always AIR. No matter with what block I'm interacting. Any idea?

sour dock
#

is e.getMaterial the clicked block or the item used (in player hand)?

peak marten
#

Good question

#

let me check

#

You are right

#

It is

sour dock
#

I think there's a getClickedBlock method

peak marten
#

That should be it

#

Thanks Robin

#

I don't know how I've missed that

mental vortex
#

How to reset a user's data so it's as if they never joined the server before?

subtle blade
#

Delete their player data folder

proper bison
#

anyone know how to get luck perms prefix with bungee for a bungee plugin with a variable ??

mental vortex
#

Oh thx

peak marten
#

Did anyone try to hover over the server icon of spigot already? That's quite a nice animation πŸ˜„

frigid ember
#

funnycube made it I think

peak marten
#

He is artist?

fleet burrow
#

Is there anyway I could override the ticking functionality of a tile state block?

#

the one gotten from implementing ITickable

frigid ember
rocky knot
#

oop principles in java
2020

If you are using more than 2 levels of inheritance you are doing it wrong.

Thats all you need to know

naive goblet
#
    @Override
    public void onEnable() {
        sendMessage("&aSpotlights Loading...");
        sendMessage(" ");
        
        this.manager = new SpotlightManager(this);
        
        getConfig().addDefault("texture-enabled", true);
        getConfig().addDefault("messages.texture-disabled", "&cAnimated spotlights will not work properly because texture packs have been disabled");
        
        getConfig().options().copyDefaults(true);
        saveConfig();
        
        sendMessage(" &a- Configuration loaded!" );
      
        CommandRegistry.register(new SpotlightCommand());
        
        sendMessage(" &a- Commands registered!" );

        ListenerRegistry.register(this, new JoinListener(this), new CrystalDamage(this));
        
        sendMessage(" &a- Listeners are listening!" );

        Bukkit.getConsoleSender().sendMessage(" ");
        Bukkit.getConsoleSender().sendMessage("Spotlights Enabled - By Phaze");
        Bukkit.getConsoleSender().sendMessage(" ");
    }
``` It's quite messy formatted.
#

Oh nvm

#

mb it was just for me on the source code...

sour dock
#

If you are using more than 2 levels of inheritance you are doing it wrong.
oh no

#

I am in trouble

naive goblet
#

same lol

#

But @frigid ember you should consider regex when parsing ints through strings.

fleet burrow
#

Is there a more efficient way to do this?

List<String> locations = configLoad.getStringList("locations");
            locations.add(loc);
            configLoad.set("locations", locations);```
#

configLoad is a YamlConfiguration object

sour dock
#

not sure if the string list returned by the configuration API is mutable, you could try
configLoad.getStringList("locations").add(loc)

naive goblet
#

Phaze I personally don't like short variable names like "s" or "loc" but it's preferences ig.

sour dock
#

particularly, the variable name should not be about the variable type but about the variable content. location is no different from loc. spawnLocation or homeLocation is actually useful!

#

String string =

frigid ember
#

Alright, thanks guys

naive goblet
#

And also when overriding methods

#

Please use @Override

#

It'll make it easier for you later I promise.

sour dock
#

configure IDE to automatically add override annotaions :)

#

in eclipse preferences > java > editor > save actions

frigid ember
naive goblet
#

Switch to IntelliJ

sour dock
#

go to save actions

nimble solar
#

eclipse
2020

sour dock
silver pewter
#

Hello, how can I get the playercount for another server within bungee but using the spigot api

sour dock
#

plugin messaging channels

#

though the wiki should be enough to understand it

silver pewter
#

okay thanks

void glen
#

How does one get a custom ban/kick message

frigid ember
#

people still use eclipse?

ashen stirrup
#

How would you keep certain items on death? The method I tried throws a ConcurrentModificationException

Code:

    @EventHandler
    public void onDeath(PlayerDeathEvent e){
        Player p = e.getEntity();

        ItemStack firework = new ItemStack(Material.FIREWORK);
        ItemMeta fireworkMeta = firework.getItemMeta();
        fireworkMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', core.getConfig().getString("missile-name")));
        firework.setItemMeta(fireworkMeta);

        for (ItemStack item : e.getDrops()){
            if (item.getType().equals(firework.getType())){
                if (item.hasItemMeta() && item.getItemMeta().getDisplayName().equalsIgnoreCase(firework.getItemMeta().getDisplayName())){
                    e.getDrops().remove(item);
                }
            }
        }
    }
cloud sparrow
#

you give it back to them>?

naive goblet
#

You could setKeepInventory and then filter the inventory

ashen stirrup
#

I can't remove the item from th e drops

#

Oh

#

It does remove it from the drops

#

I think

upper skiff
tiny dagger
#

woof

cloud sparrow
#

Choco you got any idea how to make my profile visible?

#

People been telling me it gives them errors when clicking my link.

sharp hollow
frigid ember
left tusk
#

Hi, I'm currently setting up a Spigot server for my first time. I'm doing a 1.15.2 version I downloaded and I cannot get the .bat to work properly.

nimble solar
#

Send your script over, I might be able to help.

#

You can DM me if the bot is being stupid lol

left tusk
#

ok

ashen stirrup
#

How do you check for End Portal creation?

#

The PortalCreateEvent seems to work for EndPortals in 1.15.2 but not in 1.8

void glen
#

How do you create a custom ban message/screen

sour dock
#

the kickPlayer method in Player

void glen
#

Where can I find it?

boreal brook
#

in the Player class

sour dock
#

are you a plugin developer or server owner

boreal brook
#

^

sour dock
#

if server owner, /ban <message> or get a plugin that can do more

storm tulip
#

Is scheduling tasks per say laggy?
I have a async position monitor that updates every 5 ticks, and everything it calls is part of my own API, which uses concurrent collections, except for the last line, in which I need to get a player's location.

I run this like

Bukkit.getScheduler().runTask(instance, Runnable { fPlayer.lastLocation = player.location })

Is this alright to do?

void glen
#

@sour dock Can you name a plugin that can do it for me?

naive goblet
#

Is scheduling tasks per say laggy?
I have a async position monitor that updates every 5 ticks, and everything it calls is part of my own API, which uses concurrent collections, except for the last line, in which I need to get a player's location.

I run this like

Bukkit.getScheduler().runTask(instance, Runnable { fPlayer.lastLocation = player.location })

Is this alright to do?
@storm tulip use lambda :p

wanton delta
#

@storm tulip if its async it wont cause lag to the server directly, but depending on the size of the task the machine itself may end up suffering. But i think for what youre doing youll be fine

#

but as per the API

#

you should never access bukkit api within async tasks

#

you should run it in sync, you shouldnt have to worry about it if youre updating locations

storm tulip
#

Yeah that’s what I am thinking I don’t know if it’ll hurt to schedule so many tasks

#

I’m asking about the overhead of running a task it self

#

Like it’s async to not cause direct lag but I know I gotta be careful

wanton delta
#

i would recommend creating an event

#

can call that event with a task

#

that runs every 5 ticks from startup

#

and then use a listener

storm tulip
#

Okay and this would all be sync

wanton delta
#

yes

#

otherwise you risk running into problem

#

async tasks are meant for big processes that would stall main server threads

#

using the bukkit api wont be an issue with sync

storm tulip
#

Yeah I mean I’m not doing anything extremely intensive per say but I wanted to make sure I don’t process 300 players locations and other stuff 4 time a second

wanton delta
#

it sounds a lot worse than it actually is

storm tulip
#

And I know computers are fast so it technically won’t stall a thread to do what I wanna do but I just fear for large player counts

wanton delta
#

i recommend against scheduling a new task per player, which is why i said to make one task that runs every 5 ticks on startup and create an event for it

storm tulip
#

Yeah makes sense

wanton delta
#

well its less about the server and more about the machine you run it on

storm tulip
#

I could do that or hold all the players and update it once they’re all processed

wanton delta
#

i would assume you upgrade the machine when needed

storm tulip
#

So I schedule one task

#

It’s gonna be a public plugin

#

So I actually need to account for those shared hosted servers but I can also safely assume they have lower playercounts due to their lower budget

wanton delta
#

if you think about all the other plugins out there

#

and all the big servers

#

and stuff like cheat prevention

#

idk grabbing locations isnt intensive at all

storm tulip
#

Yeah and that’s basically all I’m doing from bukkit api other than online players

#

The rest is grabbing data and comparing it from my own collections

#

It’s basically a task to update every time a player moves to a new chunk

#

PlayerMoveEvent fires when you literally move your head

#

So I did this repeating task to check locations instead

wanton delta
#

well you could use PlayerMoveEvent

#
  return;```
storm tulip
#

I ran this task sync versus playermoveevent and playermoveevent is a lot more expensive due to it firing so much

#

Yes but every time someone moves their head

#

It checks

wanton delta
#

and thats ok

#

once again its not that intensive

#

as long as you dont run the entire portion of code every time the event fires you'll be ok

storm tulip
#

That’s how FUUID and SavageFactions did it and it deffo would hit timings which is why I’m trying a diff approach.

Imma move back to playermoveevent and test around I guess

wanton delta
#

before that check you could test if their X or Z coordinate changed

#
    return;```
storm tulip
#

Yeah that’s what we used to do

wanton delta
#

ah

storm tulip
#

yeah idk

Im kinda comparing moving heads of 300 ppl firing events to checking them manually 4 times a second

#

with factions a lot of players are AFK as well, so playermoveevent wont fire for them, which is something else to consider I guess

frigid ember
#

Hi! Quick query, server version 1.12.
Got a plugin that dispatches commands on certain events, want it to set 2x blocks at a time.
Anyone know if minecraft's /setblock is laggy or if it'll handle okay?

astral flower
#

weight.405 in a permission of a group what is?

sour dock
#

@rocky knot you say more than 2 levels of inheritance and you're doing something wrong

#

I present this beauty

#

the sad part is this is not a joke

rocky knot
#

bukkit command api is pretty retarded

subtle blade
#

That looks... horrendous

woven saddle
#

Is there a lib or something that translate spigot 1.12.2 enchantments names to those of minecraft ?

green hornet
#

is this normal for World.a

chrome lark
#

yes

green hornet
#

great thanks

tiny dagger
#

How does one create a local build tool reposity for maven? πŸ€”

chrome lark
#

maven does that automatically

tiny dagger
#

I need nms

chrome lark
#

That's the ~/.m2/repository thing

tiny dagger
#

Oh hmm

chrome lark
#

You'd just run buildtools locally and then spigot will be in the local repo

tiny dagger
#

Ohh

#

Okay thanks

golden bison
#

does anyone know a spigot world edit plugin?

woven saddle
#

bukkit's one works well on spigot

#

or use FAWE

#

which is better tho

eternal holly
#

Using SpigotAPI 1.15.2, how is it possible to check if an OfflinePlayer, that I got via Bukkit.getOfflinePlayer(name), is a real player and not just any String?

#

I hope it is somewhat understandable what I mean lol

devout sierra
#

I'm looking for a plug-in that allow me to imitate mob spawns with blocks instead of the mob spawner

#

Anything like that aviable?
because I can't find anything

fleet burrow
#

Is it possible to create my own custom block that is tickable? So that it ticks along with Minecraft? Without using schedules or anything

subtle blade
#

Without using schedules or anything
No

#

You would have to use a scheduler

fleet burrow
#

Darn, because I've heard from someone you could register your own block with NMS and use ITickable

frigid ember
sharp hollow
#

Util should be public final class Util

keen moth
#

*public final class

sharp hollow
#

Shhh

#

I've got a lot on my mind, none of it good so it's hard to focus

keen moth
#

Phaze, I wouldn't even use Optional. It bloats code imo. I'd just have a traditional null check.

frigid ember
#

Do I keep the private constructor if I make the class final?

sharp hollow
#

yes

keen moth
#

Also, here:
Entity ent = cLoc.getWorld().getEntities().stream() .filter(e -> e.getName().equals(id) && e instanceof EnderCrystal).findFirst().orElse(null);
this is contradictory to what an Optional is used for. Either use Optional::isPresent or Optional::ifPresent. No point in returning null if your choice is to use an Optional.

sharp hollow
#

a Utility class should be

public final class <Class Name>{
  private <Class Name>{
  
  }

  //public static methods
}
#

I've probably fucked that up somehow

#

point is there

frigid ember
#

Do I do too much logic in the Spotlight class?

pastel basin
#

in SpotlightManager instead of setting spotlights field on constructor you should just do private Set<Spotlight> spotlights = new HashSet<>(); it makes easier for others to understand your code.

keen moth
#

For your spotlight manager, I'd suggest using a Map. The key being the ID, and the value being the object. This eliminates the need for having to loop over the collection each time and provides you an O(1) lookup time.

frigid ember
#

ok

sour dock
#

@frigid ember why does this method have a non-void return type if you always return null

frigid ember
#

I meant to return the crystal

subtle blade
#

Is there no API for EnderCrystal#setInvisible()? It's mapped so it has to be used somewhere

pastel basin
#

I didn't know you could make endercrystals invisible, I was trying for ages to set one but I couldn't find the answer in spigot forums

sour dock
#

@rocky knot I'd like to use aikars commands system but I don't think it lets you determine command names/aliases at runtime

#

since it is set using annotations

frigid ember
#

@subtle blade no I don't see it

subtle blade
#

I wonder where that method is used then. We only map methods if they're used by CraftBukkit

frigid ember
#

@pastel basin I'm not sure if it works, I haven't tried it yet

wind swan
#

Is there an event I'm missing that is the dragon breath capturing into a bottle?

pastel basin
#

@wind swan PlayerInteractEvent?

keen moth
#

looks like only armorstand has setVisible

chrome lark
#

ACF has variables for letting you pull aliases/command names, etc, out of configs for the commands, the wiki goes over a lot of that

fleet burrow
#

Is it possible to inject custom block data into a block?

chrome lark
#

with the API? no

pastel basin
#

Is it possible to inject custom block data into a block?
@fleet burrow
do you mean persistent data?

fleet burrow
#

Nope

#

Something that can go on any block

wind swan
#

@pastel basin I was hoping for something more specific to the bottle capturing. I've tried the interactevent, but I'm uncertain of how to get the exact situation where a bottle can be captured (I've tried going down the getNearbyEntities route and checking for ones with their particle matching DRAGON_BREATH), but could never get the positioning correct to match 100%

#

Reason I ask is for an items stacking plugin, so I need only the events that would give the player a bottle

chrome lark
#

you just wanna check if they're interacting with specific blocks?

pastel basin
#

wait, are particles entities? i didn't know that

fleet burrow
#

You talking to me? Because yeah lmao

wind swan
#

Here's some of what I had:

World world = player.getWorld();
        Collection<Entity> entities = world.getNearbyEntities(player.getLocation(), 20, 10, 20, (e) -> e.getType() == EntityType.AREA_EFFECT_CLOUD);
        boolean found = false;
        for (Entity entity : entities) {
            AreaEffectCloud cloud = (AreaEffectCloud) entity;
            if (cloud.getParticle() == Particle.DRAGON_BREATH) {

But then you have to determine if the player can capture from that somehow

#

unless I'm missing something

pastel basin
#

@fleet burrow idk what kind of data you mean, if you want to store stuff on blocks you can use a PersistentDataContainer which is available for every kind of block

fleet burrow
#

Pretty sure it's only available for blocks that extend TileState

frigid ember
#
    @Nullable
    public Spotlight getSpotlight(String id) {
    return spotlights.getOrDefault(id, null);
    }

Is this correct usage or can I not use null here either

subtle blade
#

It's fine, just redundant. get() will return null if not found anyways

#

return spotlights.get(id) will achieve the same goal

frigid ember
#

alright thanks

fleet burrow
#

But I have been told there is a way to inject data into blockdata

rocky knot
#

Does anybody understand how resourcepacks are made?

I have defined a custom texture as

{
    "parent": "item/handheld",
    "textures": {
        "layer0": "item/cobblestone"
    },
    "overrides": [
        { "predicate": {"custom_model_data":1500}, "model": "item/gui/skilltree_horizontal"}
    ]
}

My custom texture works, but at the same time it somehow makes minecraft not to render default texture for cobblestone block.

pastel basin
#

@fleet burrow That would be so damn complicated, I already did it with a custom spawner plugin before PersistentDataContainers. What I did was, checking for when the player places the block on the ground and saving the data manually on a configuration with the coordinates and world, then checking for when the player breaks and deleting the config and adding my data to the lore of the itemstack that dropped from that block

dark shuttle
#

Why tf is LivingEntity#addPotionEffect so heavy

pastel basin
#

@fleet burrow That would be so damn complicated, I already did it with a custom spawner plugin before PersistentDataContainers. What I did was, checking for when the player places the block on the ground and saving the data manually on a configuration with the coordinates and world, then checking for when the player breaks and deleting the config and adding my data to the lore of the itemstack that dropped from that block
but there is a lot of flaws by using this, like if the block was moved by a piston or broke by an explosion

dark shuttle
#

Both adding and removing potion effect affecting server performance

subtle blade
#

Hit the gym, my dude

#

Well, I hate to tell ya, those aren't terribly performance heavy:

    @Override
    public boolean addPotionEffect(PotionEffect effect, boolean force) {
        getHandle().addEffect(new MobEffect(MobEffectList.fromId(effect.getType().getId()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles()), EntityPotionEffectEvent.Cause.PLUGIN);
        return true;
    }

    ...

    @Override
    public void removePotionEffect(PotionEffectType type) {
        getHandle().removeEffect(MobEffectList.fromId(type.getId()), EntityPotionEffectEvent.Cause.PLUGIN);
    }```
#

That's literally it

#

So I would blame it on the plugin using them being stupid

#

i.e. throwing away instances of PotionEffect instead of using constants. Or doing so while calling those methods frequently (such as every tick)

#

Also, interestingly enough, force doesn't seem to be used?

#

Ah, was as a result of changes made in a previous commit to allow for concurrent potion effects. Force is unnecessary

pastel basin
#

yea and why is this a boolean if it will return true every time

subtle blade
#

It did return false before the recent change

#

It's in preparation for 1.16 where you can stack potion effects of the same type

sour dock
#

deprecate this and create a new method with void return type and no force argument?

subtle blade
#

Unnecessary, though there is one already that has no force argument

sour dock
#

oh yeah you can't do that then

subtle blade
#

If it remains like that in 1.16 (which it likely will), then yes it should be deprecated

sour dock
#

this class doesn't make sense to me, any reason why it uses getType() instead of this?

#

(this is org.bukkit.potion.PotionEffectTypeWrapper)

#

hm, now I am even more confused as to why this wrapper even exists at all

#

enum would seem to be a better choice

valid timber
#

my post... nooo

#

i worked so hard typing that

eternal holly
#

Using SpigotAPI 1.15.2, how is it possible to check if an OfflinePlayer, that I got via Bukkit.getOfflinePlayer(name), is a real player and not just any String? I hope it is somewhat understandable what I mean lol

dusky herald
#

You use a UUID to get an offlinePlayer

wind swan
#

Should it be possible to add a recipe with no datapacks enabled that contain recipes?

pastel basin
#

Is there a performance difference between using a single listener for every thing that you want to work with that event and setting a listener for every instance of my class?
E.g:

public class OnPlayerToggleSneak implements Listener {
  public void onPlayerToggleSneak(PlayerToggleSneakEvent event) {
    MyClass.someData...
  }
}

public class MyClass {
  public static HashSet<Data> someData = new HashSet<>();
  
  public MyClass(Data data) {
    someData.add(data);
  }
}

and

public class MyClass implements Listener {
  private HashSet<Data> someData = new HashSet<>();

  public MyClass(Data data) {
    Bukkit.getPluginManager().registerEvents(main, this);
    someData.add(data);
  }

  public void onPlayerToggleSneak(PlayerToggleSneakEvent event) {
    check some data...
  }
}
wind swan
#

Running into an issue due to a user disabling the vanilla datapack and my recipe plugin fails to add recipes

valid timber
#

I DIDNT POST A URL

#

ok

frigid ember
#

Imagine not being verified

valid timber
#

i have no dms

#

I did the command, I checked my inbox, nothing

#

ok deep breaths, where exactly are the PMs? I checked "Conversations" and it is totally empty

#

T_T

#

I just want to know why the DataWatcher in the legacy api is telling me boolean is not a valid type, and I would post some logs and relevant info except the bot keeps blocking it and I can't get verified because the OTHER bot won't PM me

pastel basin
#

did you check if your dms are enabled?

valid timber
#

on spigotmc

#

it says it's on

pastel basin
#

πŸ€”

valid timber
#

Ok, on the entity metadata format protocol for entity base class, it says that index 3 is a type of "Boolean" for "Is custom name visible"

#

so I do DataWatcher.a(3, true) to set it

#

and it says Unknown data type: Boolean

fleet burrow
#

why is PlayerInteractEvent#isCancelled deprecated?

#

in 1.15

pastel basin
#

@fleet burrow playerinteractevent is cancelled by default because of some minecraft stuff

#

I read about it somewhere

#

idk exactly why

#

but it was always cancelled

valid timber
#

okay after observing the spigot source... Boolean is not a data type

#

so... what am I supposed to do?

#

am I just supposed to like cast true to a byte or something?

pastel basin
#

looking into..

valid timber
#

wh-

#

this bot thinks code is URLs

#

why

#

-_-

#

and my messages on the forums are still empty :)

fleet burrow
#

So how would I got about cancelling a player right clicking on say, a command block?

#

as setCancelled doesn't seem to work

pastel basin
#

i think its setAction or something

sour dock
#

I've manually registered a Command subclass using the register method in CommandMap, now how do I unregister? I've tried removing the command from the knownCommands hashmap and the command indeed doesn't work afterwards, but it still shows up in tab completion and bukkit still seems to keep the command instance around somewhere

fleet burrow
#

e.setUseInteractedBlock(Event.Result.DENY);

#

Thanks πŸ™‚

pastel basin
#

but i use setCancelled and its not Deprecated and works fine

fleet burrow
#

I got a hold of the guy who says he knows how to store custom block data in a block

#

Odd

#

I'll update you if it works

#

Maybe you'll use it

pastel basin
#

only isCancelled is deprecated

fleet burrow
#

if it was you i talked to haha

#

yup it was

pastel basin
#

idk either

#

lol

#

@valid timber I couldn't find DataWatcher.a(3, true) on DataWatcher class

valid timber
#

legacy api

#

1.8

pastel basin
#

oh

#

then i cant help you

valid timber
#

sorry, all my original posts said that

#

but they all got deleted by the bot for links :) without any links

fleet burrow
#

He sent me this piece of code

final Set<Long> locations = new HashSet<>(); //Eventually replace with custom set type.
void save(file: Path) {
  try (final WritableByteChannel out = Files.newBufferedChannel(file)) {
    final ByteBuffer buffer = ByteBuffer.allocate(locations.size() * 8);
    locations.forEach(buffer::putLong); //Eventually replace with direct memory access.
    buffer.flip()
    while (buffer.hasRemaining()) out.write(buffer);
  }
}```
I'll ask him what the file parameter is πŸ€·β€β™‚οΈ
pastel basin
#

but that code stores only the locations, not the custom data of the block

#

a yaml is much more simpler, i would suggest saving the location with BukkitObjectOutputStream, converting it to base64 and saving it into a single key in the yaml

#

and then add your custom data to the file

frigid ember
pastel basin
#

is the link to the resourcepack a directlink?

frigid ember
#

Yes

pastel basin
#

@frigid ember The way I got this to work was by using Player#setResourcePack(String) on a 20 ticks delayed BukkitRunnable.

frigid ember
#

Alright thanks

#

@pastel basin its still not working for some reason

pastel basin
#

Are you sure the link is working correctly? I use it like this on PlayerJoinEvent and it works fine

(BukkitRunnable) () -> {
  p.setResourcePack(config.getString("Resource Packs.URL"));
}.runTaskLater(PlayMoreSounds.getPlugin(), 20);
pale rampart
#

When starting the spigot server will it overlap with the local server I made beforr using spigot?

orchid garden
#

!verify syrusxd

tawdry lilyBOT
#

A private message has been sent to your SpigotMC.org account for verification!

orchid garden
#

could i get my discord name changed

#

spigot name changed

pastel basin
#

only if you donate 10 dollars i think

upper hearth
#

^ You have to donate to change your spigot name

timber pike
#

Does anyone know how to silence the org.mongodb driver logging?

orchid garden
#

no, im saying

#

i've changed my spigot name

#

i'd like my discord name changed

pastel basin
#

unverify your discord account from spigot by changing your nick, then verify again

orchid garden
#

?

gusty crane
#

wqsaaaaaaeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

orchid garden
#

@pastel basin could you explain what you mean

pastel basin
#

Change your nick here so you get unverified, then verify again

orchid garden
#

im not allowed to

pastel basin
#

!verify syrusxd
@orchid garden
but your nick seems like already changed?

orchid garden
#

lo wot

#

xd

#

i didnt see it change

pastel basin
#

lol

#

I think only unverified people can change their nicks, sad

gusty crane
#

oh sry about that

#

my cat walked over my keyboard

#

layed on my keyboard

#

without consent

wide niche
#

Will the new minecraft eula effect on plugin developer rights of selling their plugins for hard currency?

subtle blade
#

What changes?

#

Source?

subtle blade
#

I see updated date, yea. Did they announce anything or is there a diff?

wheat birch
#

So I'm trying to get my plugin to support both Vault and Reserve (another economy api.) For some reason vault doesn't throw any classnotfoundexceptions when I try to search for it, but reserve does, even though my enabling of their providers is the exact same. (IN this instance, neither are on the server) What's up with that? Is vault just magic?

vault = new ShopEconomyVault(plugin);
        if(vault.enabled)
        {
            api = API.VAULT;
            return true;
        }

        if(Bukkit.getPluginManager().getPlugin("Reserve") != null)
        {
            reserve = new ShopEconomyReserve(plugin);
            if(reserve.enabled)
            {
                api = API.RESERVE;
                return true;
            }
        }

is what I had to do to get around it. With Reserve I need to check if it's there, but vault is fine w/o it.

wide niche
#

For capes its over already, just asking about plugins

subtle blade
#

(I’m on my phone at work)

#

I doubt it will be an issue

wide niche
#

No selling for hard currency aka real money

subtle blade
#

That’s always been the case though

wide niche
#

End of topic (additionally for commercial use)

#

From beginning of that is new I guess

subtle blade
#

For in-game, non-tangible products for an advantage

wide niche
#

All plugins given for free its allowed

#

But for hard currency such as real money not allowed

#

Hard currency is real money or anything that can be converted into real money, including, but not limited to, Bitcoins. Soft currency is available in-game only and has no real-world value. You may not sell soft currency for hard currency, neither separately or along with ranks as a single or recurring payout. This is regardless of what you can use the soft currency for.

subtle blade
#

This all seems to apply to how users monetize their plugin use, not the plugins themselves

wide niche
#

That’s a description for high currency only

#

Check t he whole post of commercial use

#

The*

#

Also i think you are correct too

#

Capes are pretty much dead ;v

frigid ember
#

Can anyone explain me how to use spleef plugin?

#

like can anyone help me set it up

#

Hey guys, I have this code but the texture pack freezes my game, 1.15.2

    @EventHandler
    public void onJoin(PlayerJoinEvent e) {
    Player p = e.getPlayer();
    
    if (!textureEnabled) {
        p.sendMessage(Util.color(textureDisabledMessage));
        return;
    }
    
    new BukkitRunnable() {
        
        @Override
        public void run() {
        p.setResourcePack("https://srv-file9.gofile.io/download/2Rh0Tw/texturessssz.zip");        
        }
    }.runTaskLater(main, 20L);
    }
#

@pastel basin

#

is there a plugin that respawns you to the last place you were in a certain world after leaving and rejoining?

tiny dagger
#

does anyone know if i can make proguard export me jars directly obfuscated?

frigid ember
#

@frigid ember if it is just one server you are talking about, this should happen automatically :)

#

if not, you should save the player's location to some sort of database

#

i used sql to store player data

#

@frigid ember i just remembered that

#

thanks

#

good luck :D