#help-archived

1 messages · Page 8 of 1

dusky herald
#

Entity is just the parent class for them all, but I dont see why Entity#remove wouldnt work either.

alpine vector
#

Entity#remove doesn't owkr

#

gota use setHealth then

dusky herald
#

Then do this

#

if(entity instanceof LivingEntity)

#

LivingEntity en = (LivingEntity) entity;

#

en.setHealth(0);

#

Oh

#

And

#

You should add ...

#

If(!(entity instanceof Player))

#

Unless you want to kill your players too

bronze marten
#

can a player be in a chunk that isnt populated tho

dusky herald
#

I only saw that one part of what he asked, I dont know the rest of the details.

#

Just went on an assumption;

alpine vector
#

ok i did setHealth and they wont disapwn

bronze marten
#

did you test this on new chunks or old ones

#

otherwise just move your code over to ChunkLoadEvent if you want them to be removed of old ones as well

alpine vector
#

yes

#

i did

#

deleted the world file then restart the server

#

just added debug message but to make sure it works but t never kills or remove

#
@EventHandler
    public void onSpawn(ChunkLoadEvent e) {
        for(Entity entity : e.getChunk().getEntities()) {
            if (entity instanceof LivingEntity){
                if (entity instanceof Player) return;
                LivingEntity le = (LivingEntity) entity;
                le.setHealth(0.0);
                for (Player p : Bukkit.getOnlinePlayers()) p.sendMessage(entity.getType().name());
                Bukkit.getLogger().info(entity.getType().name());
            }        
    }
}
subtle blade
#

if (entity instanceof Player) return;

#

continue, not return

frigid ember
#

How do I check if a player is in a water portal? How do I check the location

alpine vector
#

wait

#

so using return cancles the loop?

upper hearth
#

return is taking you out of the event completely, so yes, it cancels the loop

#

Continue will just go to the "value" in the loop

safe palm
#

break; will kill the loop, but continue running the code after the loop (if there is any)

#

How do I check if a player is in a water portal? How do I check the location
what's a water portal?

frigid ember
#

I want to make a teleportation portal

upper hearth
#

use PlayerMoveEvent and check if the block they're in is water

frigid ember
#

I already have that

safe palm
#

so is there an issue you're running into?

frigid ember
#

I want to check between specific coordinates

safe palm
#

well you could create a list of coordinates of the portals

#

and use Location#distance(Location) to check if they're within 2-3 blocks

#

Or you could store a specific corner of the portal, and see if the corners match. Idk, think of a cool way to do that

dark shuttle
#

Or create a region class that contains 2 location (pos1 and pos2), and check if the player location coordinate is greater or equals to pos1 and less or equals to pos2 coordinate

bronze marten
upper hearth
#

Could do regions but would only work for rectangular shapes

safe palm
#

Or create a region class that contains 2 location (pos1 and pos2), and check if the player location coordinate is greater or equals to pos1 and less or equals to pos2 coordinate
this is a better alternative

#

you could use worldguard, create a custom yourplugin-teleporter flag or something

upper hearth
#

^ Probably best solution

dark shuttle
#

If you need a spherical or circular then you just have to create a region with 1 location only, and calculate the player distance (spherical=x,y,z circular=x,y/x,z/z,y)

frigid ember
#

Is this a good method?

if ((p.getLocation().getX() > x1) && (p.getLocation().getY() > y1) && (p.getLocation().getZ() > z1)
                && (p.getLocation().getX() < x2) && (p.getLocation().getY() < y2) && (p.getLocation().getZ() < z2)) {
bronze marten
#

oof

dark shuttle
#

Make sure that pos2 coordinate is greater than pos1 coordinate

frigid ember
#

double x1 = 139;
double y1 = 68;
double z1 = -34;

    double x2 = 137;
    double y2 = 61;
    double z2 = -34;
safe palm
#

so there is only one hardcoded portal?

frigid ember
#

For now yes

alpine vector
#

@bronze marten nope nothing works even your code

dark shuttle
#

Revalidate ur pos1 and pos2 coordinate before checking if a location is inside ur region

double xlow = Math.min(x1,x2);
double xhigh = Math.max(x1,x2);
....

im typing this from my phone lol,

safe palm
#

your code wouldn't work, @frigid ember, you're checking if your y is higher then y1 (68) and if it's lower then y2 (61)

dark shuttle
#

btw, for this kind of region, i would prefer int than double

robust roost
#

Is building spigot on one computer and moving the jar file to a remote server bad practice? Like will I have issues with additional lag or anything?

subtle blade
#

No

#

Really, legally, you should be building the server on that remote server so no transfer has to occur (for legal reasons), but it's fine

robust roost
#

Ok, I just wanted to weed that out as an issue. I didn't think so

#

Thanks!

vocal wraith
#

can someone help me rq? I wanna add a custom enchantment. I already have the class written. How do I register it?

harsh anvil
#

sues every server for not building the jar on there

zenith siren
#

I made my own NPC with packets and it's a clone of a player but for some reason I can't copy the equipment, so armour for example. Why doesn't this code work?

        for(EnumItemSlot slot : EnumItemSlot.values()) {
            npc.setEquipment(slot, ((CraftPlayer) p).getHandle().getEquipment(slot));
        }
subtle blade
#

Most likely because that NPC does not exist on the server

#

It exists only on the client, correct?

zenith siren
#

Oh

#

Yea

subtle blade
#

To set its equipment, you would have to send another packet

zenith siren
#

Oof

#

Any idea what packet that is?

subtle blade
zenith siren
#

Well thanks!!

subtle blade
#

There's an entity equipment packet

#

Don't know the mapped name in Spigot

wooden harness
#

PacketPlayOutEntityEquipment iirc

subtle blade
#

That's the one

zenith siren
#

Yea

#

I was just about to type it

grim sapphire
#

how can I give players a enchanted book with a proper enchant on it via give command?

#

1.15.2- says enchanted_book is an unknown item

#

/give @s enchanted_book{StoredEnchantments:[{id:fortune,lvl:3}]} 1

subtle blade
#

That should work fine. If you're running Essentials, use /minecraft:give

#

because fuck essentials lol

grim sapphire
#

okay

upper hearth
#

Any one have any suggestions for saving and reading permission nodes from a MySQL database?

wraith apex
#

As in existing plugins or making your own?

upper hearth
#

Making my own

#

Trying to save per-player nodes into the database so they can be attached when the player joins

wraith apex
#

All I/O doe async. only Read from db once at log in. Cache the perms using a simple nice data struct. Changes / writes done immediately in case of server crash. Ensure your db schema is correctly normalised and makes sense for you needs - plan that first

upper hearth
#

Yeah, I have my database structure setup and I have caches already for all the data that's pulled. What I'm really struggling with here is saving the nodes, not sure of a good way to go about it

wraith apex
#

Well you only need to save if perms are updated

#

Update cache (if player is online and cache exists) and then update db async

upper hearth
#

I'm more talking like what to actually put into the db, per player. There's currently like 75 per-player nodes. Having a column for each one I feel would be messy

wraith apex
#

perm_node, player_uuid

#

?

#

could even extract perms and have separate table relationship if you want to be fancy and store all known nodes

upper hearth
#

So just have a separate table, and make a new column for each node?

wraith apex
#

Well if the player has a permission, add that entry

upper hearth
#

And ofc the uuid column

wraith apex
#

node, uuid

#

if they aren't there

#

they dont have that permission

#

it's up to you

upper hearth
#

Is it possible to store multiple UUIDs like that?

wraith apex
#

Yeah of course

upper hearth
#

Like
<node> | <UUID>, <UUID>, <UUID>, etc etc
?

wraith apex
#

No

#

Do you ned to know every permission node available? Or do you just want to know if a player has a permission node?

upper hearth
#

Just if they have it.

wraith apex
#
<node>          |  <uuid>
----------------------------------------------
"build.place"   | "ehehehe-eegheghe-ehjehehe"
"build.place"   | "aaaaa-aaaaaa-aaaaaaaa-aaa"
"build.destroy" | "ufufdbn-dfhdshf-dfhfsdh"
etc ..
upper hearth
#

Sure, but then multiple people have the node, correct?

wraith apex
#

Well yeah, can't multiple people have the same permission node?

#

Key would be the composite of both

upper hearth
#

Okay so we're putting that into a table

If I give 2 people the node "build.place" how would the database add the 2nd person?

wraith apex
#

By adding another row

#

<node> <uuid> are your columns

#

your player entries are your rows

upper hearth
#

Oh I can't read apparently

wraith apex
#

and you have as many rows as you want

dusky herald
#

You could store the permissions under uuid

#

And store all permissions in longtext

wraith apex
#

oh god

#

normalisation

#

sql cannot index that

#

bad

#

bad idea

dusky herald
#

Or store each permission in it's own entry

wraith apex
#

said that doesn't need to know every perm just if a player has it

dusky herald
#

Uuid | permission node (varchar)

upper hearth
#

Wouldn't it be more efficient to have the UUID as the key, and each node is just added a column with 0 or 1?

wraith apex
#

identical to my setup

dusky herald
#

Well, that's literally how I did it like 7 years ago @wraith apex lol

wraith apex
#

oh god how many perm nodes does a server have

upper hearth
#

Everything is custom on mine

#

And I'm only talking about per-player perms here, not group perms.

#

Group perms are handled differently.

dusky herald
#

Idk, you could add each node as a column, but seems like a waste of time to me

wraith apex
#

you don't require that number of columns, it's not normalised and not clear

upper hearth
#

But the number of rows I'd be adding with your method would be insane

dusky herald
#

You could just run a batch search for all entries under UUID for the player

#

And apply each node

#

That was found

wraith apex
#

Bruh

slim hemlock
#

what kind of issue can instacrash a server or instantly zombify an instance without posting any error logs whatsoever and without tps drops or mem leaks

wraith apex
#

Db's have millions of rows

#

Not millions of columns

#

MySQL optimises for rows if your structure is good.

dusky herald
#

Who cares if you have 75 entries

#

Just search with a filter, you can get all entries with 1 search query

wraith apex
#

what's the difference between pulling a column and a row?

#

nothin it's just a block of memory

dusky herald
#

The real big difference would be you would have to design the table structure radically different

#

If you wanted every permission as a column

#

Or you could just do 2 or 3 columns per node

upper hearth
#
<node>          |  <uuid>
----------------------------------------------
"build.place"   | "ehehehe-eegheghe-ehjehehe"
"build.place"   | "aaaaa-aaaaaa-aaaaaaaa-aaa"
"build.destroy" | "ufufdbn-dfhdshf-dfhfsdh"
etc

or

<uuid>                        |  <node> | <node> | <node>
----------------------------------------------
"ehehehe-eegheghe-ehjehehe"   | 0 | 1 | 0
"aaaaa-aaaaaa-aaaaaaaa-aaa"   | 1 | 0 | 1
"ufufdbn-dfhdshf-dfhfsdh"     | 1 | 1 | 1

So between these two?

dusky herald
#

First one

gusty crane
#

may i ask just

#

real quick

#

new aight

#

ChatColor.AQUA + ChatColor.BOLD + "Welcome "

#

would this be correct

#

or

#

how do i do it

wraith apex
#

need a string between

#

ChatColor.AQUA + "" + ChatColor.BOLD + "Welcome "

#

Blame java not having operator overloading

gusty crane
#

aight

#

thx

#

m8 appreciate it

wraith apex
#

❤️

upper hearth
#

So the first method is better?

wraith apex
#

yes

dusky herald
#

If you plan to add more nodes later especially

wraith apex
#

75 nodes to start with is enough to tell you that

dusky herald
#

If you add more nodes later, and you enter them as columns then you'll have to update each player later as well

wraith apex
#

what fucking db schema has 75 columns 😂

dusky herald
#

And update your plugin

#

First way you dont have to touch the plugin at all

upper hearth
#

I already have code in-place to handle stuff like that @dusky herald

wraith apex
#

ohh who was right without confusing newpeople

dusky herald
#

Well either way, the first way is a better approach and provides more versatility.

wraith apex
dusky herald
#

A course on design lol I figured itd be common sense really

wraith apex
#

Bruh I studied db design in university. We had to do relational algebra before touching sql

#

It sucked.

upper hearth
#

Alright thanks guys, I'm not really a fan of SQL ;l

dusky herald
#

Also consider the data types you pick for your tables as well; they matter as far as data transfer goes and optimizing speed

wraith apex
#

@upper hearth Why not design in relational algebra then 😂

upper hearth
#

oh god

dusky herald
#

@wraith apex btw I wasnt disagreeing with you earlier; I came in on the middle of the conversation 😂

subtle blade
#

What... is that monstrosity...

dusky herald
#

What?

#

Uuid / node / node / node?

subtle blade
#

Dude I dropped out of university so I wouldn't have to deal with calculus anymore

wraith apex
#

It's called academics being academics

#

@subtle blade

#

Can't believe I got 98% in that module.....

dusky herald
#

I dont need to go to university

#

😀

wraith apex
#

@dusky herald is correct about data types

#

int's can be indexed allowing for faster searches - but as we are using a permission node always one string (either uuid or perm node) will needed to be searched for anyway

dusky herald
#

IMO I would load all the permissions when they log in

wraith apex
#

Yeah suggested that C:

#

async

dusky herald
#

Yea lol

upper hearth
#

Yeah it will

wraith apex
#

only update when perms for a player is

#

immediately in case of server crash

upper hearth
#

Update immediately when it's granted?

wraith apex
#

or removed

#

async again

#

all i/o async

upper hearth
#

yeah always async duh

wraith apex
#

can't stress it enough not enough ppl do it

upper hearth
#

Nah I do understand that part of it

wraith apex
#

some dbs are on separate servers ya know 😭

upper hearth
#

And the Java part ofc, but SQL and db design ;(

wraith apex
#

All these people running localhost sql servers

dusky herald
#

SQL is pretty easy. Although it can get technical, it shouldnt be that hard for minecraft servers

upper hearth
#

When I implemented my database, I wasn't using async and didn't notice because localhost

wraith apex
#

DB design is difficult

upper hearth
#

Switched to my real server and oh boi

wraith apex
#

Requires thought

#

and data structure knowledge

dusky herald
#

I guess, but I've messed with databases since I was 12 so I guess I got used to it.

wraith apex
#

Well it gets hard when you consider data structs, searches and optimisations etc

#

but the rules are simple

#

If SQL was easy Mineplex would not of been down all the time when it was at its peek @dusky herald 😂

dusky herald
#

I enjoy using a bit of thought to solve problems though. Although I really do not want to program as a career.

#

That would take the fun out of it.

wraith apex
#

Yeah optimisation does take the fun out of it

#

Understanding the internals make it less satisfying when solving a problem

upper hearth
#

Depends on the optimization I think

#

I hate backend in general

wraith apex
#

it's less practical when you know internals and more just get it done :/

#

Why I will never be a code monkey

#

i.e. programming for a career

upper hearth
#

If you're working on optimizations where you can really see an improvement when using the "product", I think it can be fun

wraith apex
#

too an extent

dusky herald
#

Yeah I guess if you have to optimize it to make whatever you're working on remotely enjoyable

wraith apex
#

what i'm trying to say when you are optimising you don't get the satisfaction of solving that initial (more then likely much larger) problem

dusky herald
#

Hell sometimes when you optimize you have to start all over

wraith apex
#

@earnest bison

upper hearth
#

I dunno I think the larger problem could be making the application more enjoyable to use and work more efficiently.

#

And doing those small optimizations slowly add up to that

#

Can be cool

#

Just my opinion though

dusky herald
#

It depends. Optimization can lead to total redesigns of systems, not just changing a few things.

wraith apex
#

If the code is initially bad, yes

upper hearth
#

But I mean adding new features and stuff is clearly more fun lmao

dusky herald
#

Yeah sometimes that just contributes to the problem.

wraith apex
#

but if it's done by any good software engineer, optimising is a headache and is often down to low-level understanding (i.e. doing math differently as it's more efficient on a cpu)

upper hearth
#

Uh yeah, take Minecraft for example

#

All they do is add features and break stuff only to fix it 4 years later

dusky herald
#

They dont design Minecraft for modders.

upper hearth
#

I'm talking vanilla Minecraft

dusky herald
#

Ah well I dont know then. I havent even played MC for like 4-5 years or so

#

I'm just getting back into it.

upper hearth
#

Yeah Mojang really likes adding new features and really dislikes fixing issues. From what I've seen anyways

dark shuttle
#

They do fix issues actually

upper hearth
#

I didn't say they never fix them

wraith apex
#

Minecraft 2. The optimisation update

#

Cannot wait to compare hytale server vs minecraft

#

in terms of raw performance under load

upper hearth
#

We'll see I suppose. They have to release it first..

wraith apex
#

ikr

#

glad they are doing java server and not lua for plugins

#

omfg I would cry

upper hearth
#

IMO Hypixel announced too early

wraith apex
#

not really the hype allowed for greater investment opportunity 😉

dark shuttle
#

We are getting offtopic now? #general

wraith apex
#

need a #off-topic

upper hearth
#

#general I suppose

barren heart
#

Hello! I need help with a bit of code. I want to send a Json message to a player through BungeeCord. What I want to do is that the plugin takes a String of the configuration and transforms it into Json to be able to send it

orchid garden
#

is anyone able to help me diagnose performance issues on my server?

#

im getting about 7-9 tps with 80 people on

zealous yoke
#

with this information nobody is able to help you

#

send a timings report

wanton delta
#
            field.setAccessible(true);

            Field modifiersField = Field.class.getDeclaredField("modifiers");
            modifiersField.setAccessible(true);
            modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);

            AtomicInteger id = (AtomicInteger) field.get(null);```

I'm trying to get the `private static final` field `EntityCount`, but even after trying to bypass the `final` modifier, it doesn't allow me to set the field. anyone know how this works?
alpine musk
#

hi, I need a utility that will fill a complex closed space with a specific block. this is necessary to indicate the air blocks in the underground structure. is there something like this?

wanton delta
#

ah i see

#

entityCount is a cosntant expression so cant be modified

frigid ember
#

how do i make the lines display in configure.yml the lines for a scoreboard

orchid garden
#

how can i improve the performance of cactus farms?

soft iron
#

Any ideas why my spawners aren't working? It spawns one critter, then turns to the floating pig of doom. O.o

vocal wraith
#

yo can someone help me real quick?

frigid ember
#

With?

vocal wraith
#

I want to add a custom enchantment

frigid ember
green hornet
#

is there a way to take an nbttagcompound and turn it into an itemstack without losing the PublicBukkitValues

#

net.minecraft.server.v1_14_R1.ItemStack.a(nbttagcompound) seems to reset it

wanton delta
#

so I'm using WorldCreator to create worlds, only problem is i think the worlds i'm trying to use are too old

#

anyone know a a way to update worlds from 1.12 via bukkit?

cloud sparrow
#

What version

#

@wanton delta what version

#

1.12 to what 1.15?

wanton delta
#

yes

cloud sparrow
#

No it shouldn't work as those are outdated mechanics and different ways of how stuff are saved.

wanton delta
#

hmm

cloud sparrow
#

You can make a backup and try but no guarantee without issues.

wanton delta
#

minecraft can update them... sorta

cloud sparrow
#

@frigid ember what version

wanton delta
#

sometimes i get luck

#

sometimes i dont

cloud sparrow
#

That's your risk if you want potential corrupted chunks

soft iron
#

Mob Spawners turning to Pig of Doom

Hey guys, I'm looking for some insight on an issue I'm having on my server. For some reason, spawners, both bought from GUIShop and Spawned In, Creative-Mode Brought In, Found, etc. are turning into the broken pig of doom spawner on placement.

Things I've Tried:

  • GameRule
  • Difficulty Check
  • Restarting Server
  • Stopping and Restarting Server
  • Digging through Endless Forums
  • Checked WorldGuard flags for Global
  • Checked GriefPrevention, could not find anything about Mob Spawners.

I've still not found a resolution to the issue. Here are the list of plugins I run:

Plugins (33): CratesPlus, LuckPerms, BackOnDeath, WorldEdit, NickNames, NoFallDamage, PlaceholderAPI, Votifier, PvPToggle, DiscordBotAPI, WorldGuard, ProtocolLib, AuctionMaster, ScreenText, mHelp, EssentialsChat, AdvancedNMotd, zDiscord, mcMMO, Vault, GriefPrevention, DiscordMinecraftHook, PlayerKits, CustomEnderChest, InteractiveChat, Jobs, SafeTrade, GUIShop, AConomy, Quests, AdvancedTeleport, TimeIsMoney, SuperbVote

Any information would be greatly appreciated! Feel free to DM me if it's easier. ❤️

wind peak
#

Hi, can someone help me?

#

I wish players would lose the soulbound enchant when they die
This enchant is from the plugin: EnchantmentSolutions
Have u any suggestion?

orchid garden
#

@soft iron have you tried silkspawners

soft iron
#

Does that fix it so they still work?

#

God I really hope so..

orchid garden
#

still work?

soft iron
#

Like, so the pig thing stops happening

orchid garden
#

should

soft iron
#

You, are a god.

#

Jesus LOL

#

.> <.<

#

But does it work on 15.2

#

That shall be the question of the day

orchid garden
#

it doesnt support that no

#

found this for 1.15.2

brittle stone
#

Is it possible to uncancel cancellable events?

final verge
#

e.setCancelled(false)

wind peak
#

If you're looking for a silkspawner plugin, i have this

#

And it works on 1.15.2

brittle stone
#

I did that in my plugin, but it was still cancelled, despite my listener had priority set to HIGHEST and the plugin cancelling the same event was on NORMAL priority

wind peak
#

But.. someone can help me?

brittle stone
#

And if I understand events correctly, priorities should be LOWEST, LOW, NORMAL, HIGH, HIGHEST and then MONITOR

final verge
#

Indeed

wind peak
#

I wish players would lose the soulbound enchant when they die
This enchant is from the plugin: EnchantmentSolutions
Have u any suggestion?
@wind peak Please D:

frigid ember
#

Hey guys is there any possible ways to set up your server so that when you go to afk you wont getting kicked by being idle?

wind peak
#

Hello everyone, I have a question relating to Minecraft server hosting. Is it possible for a local running host, after port forwarding, be open to everyone around the world?
@frigid ember I think yes (?)

#

Hey guys is there any possible ways to set up your server so that when you go to afk you wont getting kicked by being idle?
@frigid ember Have u essentials?

frigid ember
#

i don't really know

pastel condor
#

Do /plugins

frigid ember
#

where can i do it?

orchid garden
#

could someone point me to a plugin that removes specific particle effects from happening?

#

specifically cactus

#

cancels it to prevent server lag, not stop for certain people

strange echo
#

particle effects happen on client side it shouldn't be causing the server to lag.

#

the server just tells the client to show particles and the client does the rest

ashen stirrup
#

return minecraftKey != null ? MinecraftKey.b() : "";
What does this mean?

quick arch
#

It'll return (nothing) if it's null

#

else, the value in MinecraftKey.b() if it's not null

ashen stirrup
#

bruh

#
    public String a() {
        return this.b;
    }

    public String b() {
        return this.a;
    }
quick arch
#

nice..

ashen stirrup
#

So if you call A it'll return B and if you call B it'll return A

#

That's from the Spigot source

final verge
#

yeah but that's just obfuscation

#

it has no real meaning

ashen stirrup
#

Oh

storm tulip
#

kekw

ashen stirrup
#

It says MinecraftKey.b() has protected access

storm tulip
#

write your source obfuscated big brain

ashen stirrup
#

Someone wanted me to edit some code for them and it has the line
return minecraftKey != null ? minecraftKey.b() : "";
which was throwing an error on .b() saying that minecraftKey.b() has protected access in net.minecraft.server.v1_15_R1.MinecraftKey

storm tulip
#

is it working for 1.14

#

nms changes stuff every few versions

#

cuz obfuscator

ashen stirrup
#

I assume it works for 1.13.2 since I'm updating it from that to 1.15.2

subtle blade
#

What did b() do and why are they using MinecraftKeys?

ashen stirrup
#
@Override
    @Nullable
    public String getMobNameOfSpawner(BlockState blockState) {
        CraftCreatureSpawner spawner = (CraftCreatureSpawner) blockState;
        try {
            TileEntityMobSpawner tile = (TileEntityMobSpawner) tileField.get(spawner);
            MinecraftKey minecraftKey = tile.getSpawner().getMobName();
            return minecraftKey != null ? minecraftKey.b() : "";
        } catch (IllegalArgumentException | IllegalAccessException e) {
            Bukkit.getLogger().warning("Reflection failed: " + e.getMessage());
            e.printStackTrace();
        }
        return null;
    }
subtle blade
#

There’s api for this. CreatureSpawner BlockState has #getSpawnedEntityType() or something like that. I’m on my phone, can’t double check

ashen stirrup
#

Cheers

#

getCreatureTypeName() I'm assuming

#

or .getSpawnedType()

subtle blade
#

Yep! That second one there

#

The first one is deprecated

#

So it’ll return an EntityType. I believe it has #getKey()

#

So getSpawnedType().getKey().getKey() will give you the entity’s ID

ashen stirrup
#

Cheers ❤️

subtle blade
#

o/

grim sapphire
#

Quick question, looking for some help designing my plugin and using OOP fundamentals to the best of my ability. Making a crate plugin and was wondering if this is a good idea of how to do this?

#

KeyType/CrateType are enums. Crate/Key/Files are Objects and the Handlers are storing basically everything about those objects, including accessing them to modify, use to grab locations from, etc

final verge
#

How are you planning on storing info on the keys

barren heart
#

Hello! I need to know if there is any way to cancel donkey chests and llamas

#

I want players to be able to climb into the flame, but not be able to open their chest

ashen stirrup
#

@grim sapphire I mean it'd work, you could make a map for <CrateObject, Key>

vocal pebble
#

help

#

i wanted to play speedrunner vs assassin

#

but idk how

keen moth
vocal pebble
#

@keen moth can you help me with that?i dont know where is plugins folder :<

keen moth
#

Your plugins folder is located in your server directory.

vocal pebble
#

what if i dont have a server?and i use Tlauncher?

keen moth
#

I'm not sure what that is. That resource is a plugin that must be ran on a server.

vocal pebble
#

i use crack

zenith palm
#

you saw nothing

#

what are you talking about man

vocal pebble
#

@keen moth can i play assassin vs speedrunner on LAN?

keen moth
#

You need a server to run it

grim sapphire
#

Frosted, for the cancel, i just do ignoreCancelled = false right?

keen moth
subtle blade
#

false is default afaik

keen moth
#

For the code you provided in #text, you'd want to set it to true

cloud sparrow
#

What's max scoreboard length on 1.15?

grim sapphire
#

Alright, thanks

keen moth
#

@cloud sparrow Scoreboard length as in title or team name?

cloud sparrow
#

well at the moment my scoreboard's color isn't going to the end of the string.

#

and I assume it's due to the length.

#

and what is the argument displayName in the registerNewObjective?

#

in the scoreboard.

#

@keen moth for the team

keen moth
#

Someone correct me if I'm wrong, but pretty sure team entries are capped at 16.

cloud sparrow
#

ah yeah I have that.

#

could be my text limit hmm.

#

color isn't going to the end:

keen moth
#

Actually, I'm pretty sure the limit was increased in 1.13+

cloud sparrow
keen moth
#

Could be an issue with the way you're formatting it, if you're doing anything fancy.

cloud sparrow
#

likely is.

#
                return new EntryBuilder()
                        .blank()
                        .next("&fRank: &7[Member]")
                        .blank()
                        .next("&fOnline: &a0")
                        .next("&fServer: &e&lHub 1")
                        .blank()
                        .build();
keen moth
#

Yea no, if there was a cap, the text would be cut off entirely, not just the color.

cloud sparrow
#

weird.

#

Idk why my color is cutting off then.

#

could be my repeat method but don't see where there would be a issue there

#

Found the issue was a length issue on my side being 16

gritty mulch
#

is this a server jar error or a plugin?

fleet crane
#

neither

#

'no space left on device'

#

can you think what that might mean

gritty mulch
#

🤣 Yea but I have over 100GB free

frigid ember
#

Does anyone know how to get the average tick duration? I can't find anything about it in the docs, but it is shown in the server gui (pic), so it must be stored somewhere.
I still can't find this, MiniDigger suggested Bukkit.getAverageTickTime, but that method is undefined, does anyone else have an idea?

fleet crane
#

is that the server your influxdb is running on?

gritty mulch
#

Uh, I'm not sure. I've never setup it up.

#

Would it be a plugin related error?

fleet crane
#

wherever you put influxdb is out of disk space

#

idk which plugin is using influxdb

#

its not clear from the log

gritty mulch
#

Alright, but I'd assume minecraft doesn't use influxdb so its kinda 'safe' to ignore 🤣

fleet crane
#

probably a statistics plugin you installed

gritty mulch
#

Alright thanks for the help 🙂

tiny dagger
#

is there any event thats runs after join?

fleet crane
#

PlayerJoinEvent

tiny dagger
#

yeah but still feels quiet fast

cloud sparrow
#

then delay it

tiny dagger
#

yeah i think so

dull ingot
#

lmfao

#

feels quite fast bruh

fleet burrow
#

Is there any simple way to set custom tile entity's?

#

I mean, I know I can register a new tile entity type, extend tile entity and lots of nms shit but.... Is there any simpler way? lol

dull ingot
#

what block are ye trying to edit

#

if it's a spawner I've got some code around

#

also afaik not really

#

nms is needed for this most of the time

fleet burrow
#

Well, hopefully any block but I can deal with blocks that are TileEntities

#

but only spawners is quite limited

dull ingot
#

I mean

#

I made my classes for spawners

#

it was for NBT tags

tiny dagger
#

i hate eclipse and its enum bug :\

fleet burrow
#

So why are you using eclipse/

dull ingot
#
        CraftWorld world = (CraftWorld) block.getWorld();
        TileEntity teblock = world.getTileEntityAt(block.getX(), block.getY(), block.getZ());
        if (teblock != null) {
            NBTTagCompound ntc = new NBTTagCompound();
            teblock.save(ntc);
            return ntc;
        } else {
            return null;
        }
    }```
tiny dagger
#

because i know where everything is

dull ingot
#

this stuff

#

proabbly works for your block too yea

#

since it's just general tileentities

#

so if you need to set nbt for blocks I can send you some code

#

I tested it on versions 1.7 all the way to 1.15

fleet burrow
#

That'll set nbt for the block?

dull ingot
#

this gets NBT

fleet burrow
#

ahhh

dull ingot
#

there's another method to set it

fleet burrow
#

What about setting then?

dull ingot
#
        CraftWorld world = (CraftWorld) block.getWorld();
        TileEntity teblock = world.getTileEntityAt(block.getX(), block.getY(), block.getZ());
        if (teblock != null) {
            teblock.a(ntc);
            return;
        } else {
            return;
        }
    }```
#

this is for 1.10 btw

#

if you want it I can send you whatever version you need lol

fleet burrow
#

1.15

#

lmao

dull ingot
#

aight

keen moth
#

Regular blocks don't store nbt, only tile entities

dull ingot
#
        CraftWorld world = (CraftWorld) block.getWorld();
        TileEntity teblock = world.getHandle().getTileEntity(new BlockPosition(block.getX(), block.getY(), block.getZ()));
        if (teblock != null) {
            NBTTagCompound ntc = new NBTTagCompound();
            teblock.save(ntc);
            return ntc;
        } else {
            return null;
        }
    }

    private static void setNBT(Block block, NBTTagCompound ntc) {
        CraftWorld world = (CraftWorld) block.getWorld();
        TileEntity teblock = world.getHandle().getTileEntity(new BlockPosition(block.getX(), block.getY(), block.getZ()));
        if (teblock != null) {
            teblock.load(ntc);
            return;
        } else {
            return;
        }
    }```
#

there you go

#

yea he's working with tile entities

fleet burrow
#

Yeah, I could deal with only tile entites its ok

dull ingot
#

it's gotten better in 1.15

fleet burrow
#

I might just place a sign at the very top of the chunk

dull ingot
#

cos the methods are named save and load

#

instead of a b c d

#

spigot has built in spawner value editing instead of nms for 1.15 anyway

#

so 🤷‍♂️

#

I made it for no reason for 1.15 tbh but it makes it easier to have everything nms when I was adding multi version support

keen moth
#

Some improvements on that code which sets the nbt: No need for return statements & the else block.

dull ingot
#

true but I like to do it

#

I just get paranoid if it ain't there

fleet burrow
#

I've been told there are ways to set block data also but that would be less efficient no?

keen moth
#

Are you storing custom data in the tile entity? If not, there may already be api you can use to modify the data

fleet burrow
#

I am

#

Custom data

fiery pendant
#

hey guys

#

can someone help me?

#

I'm trying to sell custom items in sign shop

#

but it says unknown item

#

The item I'm selling is a key for a crate

#

the id for the key is 131#2

fleet burrow
#

@dull ingot Well, thank you very much 😛

#

although if I register a new tile entity type I could implement ITickable

#

and have some logic that I need be there

#

but that'll make everything much less simple because of all the other implementations I need

frigid ember
#

hmm

#

how do i change my nickname

#

rn its qbasty

#

on spigot

#

ill rejoin

#

didnt work

#

rip

floral laurel
#

Hello, can someone please help me to use CompletableFuture for Bukkit - Bungeecord messaging channels

#

i need the information from GetServer in RealTime

#

please

dull ingot
#

@fleet burrow np

#

if you ever need multiversion support just hmu

fiery pendant
#

hey guys
can someone help me?
I'm trying to sell custom items in sign shop
but it says unknown item
The item I'm selling is a key for a crate
the id for the key is 131#2

#

hey guys
can someone help me?
I'm trying to sell custom items in sign shop
but it says unknown item
The item I'm selling is a key for a crate
the id for the key is 131#2
I'm trying to sell the key

normal swift
#

why #2

#

there is no 131#2

fiery pendant
#

Like i said

#

It's a custom item,

#

@normal swift

normal swift
#

Im not quite sure that signshop supports custom items

#

@fiery pendant ask @golden vault because he is a maintainer

fiery pendant
#

hey @golden vault ?

visual stream
#

is there an tutorial into the wiki for permissions ? i'm struggling right now 🧐

golden vault
#

@fiery pendant it works with custom items but I don't understand how you are even trying to use id's. Just put the item in the chest and link it to the sign with redstone. If you have more questions please join the Signshop discord link on the Spigot page.

tiny dagger
tiny dagger
#

wow

#

how have i not seen this

sour dock
#

all the functional interface stuff is very nice

tiny dagger
#

yeah its way too good

mint shell
#

normal mp4
@mint shell Fixed it with a backup region file. Luckily I make sometimes a backup. I lost 1 day of AFKing and some minor changes.

frigid ember
#

Hello, my spigot account was "hacked" and my email adress was changed

frigid ember
#

Nice

runic turret
#

any one here knows how can I disable auto-opening of files at vscode when move a file to vscode window?

fleet burrow
#
        CraftWorld world = (CraftWorld) block.getWorld();
        TileEntity teblock = world.getHandle().getTileEntity(new BlockPosition(block.getX(), block.getY(), block.getZ()));
        if (teblock != null) {
            NBTTagCompound ntc = new NBTTagCompound();
            teblock.save(ntc);
            return ntc;
        } else {
            return null;
        }
    }

    private static void setNBT(Block block, NBTTagCompound ntc) {
        CraftWorld world = (CraftWorld) block.getWorld();
        TileEntity teblock = world.getHandle().getTileEntity(new BlockPosition(block.getX(), block.getY(), block.getZ()));
        if (teblock != null) {
            teblock.load(ntc);
            return;
        } else {
            return;
        }
    }```

@dull ingot Why does the getNBT method use a method called save

#

and the setNBT uses load

#

naming makes no sense lmao, just want to make sure it's correct..

sharp hollow
#

@frigid ember send an email to spigots support email

frigid ember
#

Can i have the mail pls?

sharp hollow
frigid ember
#

Thx

sharp hollow
#

Welcome ^.^

subtle blade
#

@fleet burrow the naming is strange. save(NBTTagCompound) saves the contents of the tile entity's NBT to the provided NBT compound. load(NBTTagCompound) loads the contents of the provided NBTTagCompound to the tile entity's NBT

#

Think of save() kind of like "copy to" and load() kind of like "read from"

fleet burrow
#

If it's that then isn't it incorrect?

subtle blade
#

It is correct

fleet burrow
#

Huh

#

A command block is a tile entity right?

subtle blade
#

Correct

sharp hollow
#

You're saving a compound to a TileEntity

#

or, loading a compound from a TileEntity

subtle blade
#

On an unrelated note, I'd write those methods a little differently.

    private static NBTTagCompound getNBT(Block block) {
        CraftWorld world = (CraftWorld) block.getWorld();
        TileEntity teblock = world.getHandle().getTileEntity(new BlockPosition(block.getX(), block.getY(), block.getZ()));

        NBTTagCompound tag = new NBTTagCompound();
        if (teblock != null) {
            teblock.save(tag);
        }

        return tag;
    }

    private static void setNBT(Block block, NBTTagCompound ntc) {
        CraftWorld world = (CraftWorld) block.getWorld();
        TileEntity teblock = world.getHandle().getTileEntity(new BlockPosition(block.getX(), block.getY(), block.getZ()));
        if (teblock != null) {
            teblock.load(ntc);
        }
    }```
fleet burrow
#

Yeah I refactored it also 😛

#
            String machineJson = gson.toJson(playerMachine, PlayerMachine.class);
            NBTTagCompound nbt = getNBT(playerMachine.getOpenGUIBlockLocation().getBlock());
            if (nbt == null) nbt = new NBTTagCompound();
            System.out.println(playerMachine.getOpenGUIBlockLocation().getBlock());
            nbt.setString("machine", machineJson);
            setNBT(playerMachine.getOpenGUIBlockLocation().getBlock(), nbt);
            System.out.println(getNBT(playerMachine.getOpenGUIBlockLocation().getBlock()));```
I have this setup but getNBT seems to return null?
#

even though I set it a line before

subtle blade
#

Well for one, should definitely make a variable for playerMachine.getOpenGUIBlockLocation().getBlock(). You use it 4 times ;P

fleet burrow
#

Yeah just a quick test haha

subtle blade
#

Though that's another reason I changed how getNBT() worked above so it would never return null. Would save you from having to null check to accomplish the same thing

#

9/10 you want an empty NBT tag if one isn't present anyways

fleet burrow
#

So now I get an empty NBT

#

It doesn't seem to set the nbt to the block

subtle blade
#

What version are you on?

fleet burrow
#

1.15

subtle blade
#

Tile entities, unlike item stacks, may ignore custom NBT keys. Let me double check. Though 1.15 has a tag container API you really should be using.

subtle blade
#

Yea, that's the one

#

And yes, it does ignore custom values

#

Only loads what vanilla needs

fleet burrow
#

I guess I'll be using that

#

Didn't even know of it 😛

subtle blade
#

That's 1.14+ only, but eh. Newer versions are what you should be supporting anyways

#

So yea, TileStates (BlockState) are persistent data holders afaik

fleet burrow
#

So that supports any block?

subtle blade
#

Any BlockState (tile entities)

#

Blocks can't hold NBT data

#

That holds true for vanilla as well

tiny dagger
#

i'm curios , if i set 1.15 as api version

#

what happens with 1.14 version?

#

i don't want it to rollback to 1.12

subtle blade
#

It won't load on 1.14 (or 1.13) servers

#

Though 1.12.2 servers will ignore that and load it anyways because it didn't exist back then

tiny dagger
#

but if the server is on 1.15 and i set it to 1.14 it will recognize all the 1.14 api had right?

subtle blade
#

Yes. It acts as a minimum version

#

(again, with the exception of 1.12.2 and below)

tiny dagger
#

okay

storm tulip
#

if you'ree forced to support all versions like me

#

I have a set of tools

#

This has stuff like Xmaterial

obtuse onyx
#

Persistent Data Container is awesome :P

storm tulip
#

which is a new enum you can use

subtle blade
#

"forced" LUL

storm tulip
#

basically dude

subtle blade
storm tulip
#

in Factions

#

I get fuckin yelled at

subtle blade
#

Your first mistake was maintaining a factions fork

storm tulip
#

SuppOrt 1.8.8

frigid ember
#

sadly that is true 😦

storm tulip
#

my SkyblockX thing all the boyos are on 1.15.2

#

I still support 1.8 tho cuz I have experience

#

and I just use my tools and it worky

#

factions as a fork was even harder to maintain because I had to migrate all the legacy code

#

Since the rewrite its been a lot easier

obtuse onyx
#

It's definitely time for everyone to stop supporting 9 different versions at a time

#

r/unpopularopinion/

subtle blade
#

I still support 1.8 tho cuz I have experience
aPES2_VomitAttack

#

Your experience should be directed to using newer and more modern API features

upper hearth
#

I'm working on a pvp server and we only support 1.15.2. IMO it's much better to be able to utilize all the new features than it is to be able to hold your sword in front of your face

subtle blade
#

Someone give this mans a raise

tiny dagger
#

imagine having a huge workaround to support 1.8.8

upper hearth
#

^ yeah I also couldn't be asked to make everything work back that far

frigid ember
#

VomitAttack

tiny dagger
#

not to talk about how you have to test for n versions since they work so differently

subtle blade
#

Yea. VomitAttack

#

😄

fleet burrow
#

Hold on, I can store classes using PersistentDataContainer?

#

Or do I need to serialize them?

subtle blade
#

You can create your own data type for it to make it easier, sure

fleet burrow
#

Yup

#

Would you recommend extending that or using reflection to get the PrimitivePersistentDataType constructor?

tiny dagger
#

i saw this, but i haven't yet found a good use to it

subtle blade
#

No no, just implement it

fleet burrow
#

Alright, thanks 🙂

subtle blade
#

PrimitivePersistentDataType is for internal use to more easily create the primitive types as constants in PersistentDataType

fleet burrow
#

complex type is what I am given and primitive is what is store?

subtle blade
#

I believe so, yes

dusky basalt
#

hello, so i'm trying to setup the firewall in spigot, and I get this error

#

08.04 17:55:44 [Server] SEVERE at net.md_5.bungee.conf.YamlConfig.load(YamlConfig.java:73)
08.04 17:55:44 [Server] SEVERE at net.md_5.bungee.conf.Configuration.load(Configuration.java:71)
08.04 17:55:44 [Server] SEVERE at net.md_5.bungee.BungeeCord.start(BungeeCord.java:273)
08.04 17:55:44 [Server] SEVERE at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62)
08.04 17:55:44 [Server] SEVERE at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
08.04 17:55:44 [Server] SEVERE Caused by: mapping values are not allowed here

subtle blade
#

Sounds like a broken config

#

What's your bungee.yml look like (redact any sensitive information or whatever)

dusky basalt
#

can I dm?

subtle blade
#

I don't know what all is in there, I don't use bungee lol

#

Sure

woven saddle
#

Hey I'm in 1.12.2 and i can't find a proper way to change item's color.
For the moment i use the MetaData and i check if it's an instance of Colorable and then change the color.java if (materialData instanceof Colorable) ((Colorable) materialData).setColor(color);But this only works for wool, not concrete, because it doesn't have a proper MaterialData which is Colorable.
I could use byte data, but that's deprecated.
I don't know beforehand the Material.

inland depot
#

make sure that you're setting the itemmeta back to the item before giving the item

woven saddle
#

yes i am

#
MaterialData materialData = itemStack.getData();
if (materialData instanceof Colorable) ((Colorable) materialData).setColor(color);
itemStack = materialData.toItemStack(1);
upper hearth
#

Shouldn't you use itemStack.setData() or am I dumb?

fleet burrow
#

How can I compress a location to a Long?

woven saddle
#

@upper hearth that changes nothing

tiny dagger
#

i you can't

subtle blade
#

Concrete did not have Colorable MaterialData afaik

tiny dagger
#

x, y is alone 64 bits

subtle blade
#

It was a very incomplete API

#

So you have to resort to DyeColor.WHATEVER.toWoolData() and set concrete's byte data to it

#

Welcome to 1.12!

upper hearth
#

Why did Mojang even use data like that in the first place instead of using the naming we have now 🤔

full topaz
#

probably due to the way they used to store things

#

keep in mind everything was IDs before

upper hearth
#

Yeah I know, don't really understand that either.

full topaz
#

I too prefer the new system. Much more user-friendly and human-understandable

upper hearth
#

Back in the old days of 2009 or whatever I guess that was the way to go ¯_(ツ)_/¯

full topaz
#

Probably the quickest or easiest to implement

#

🤷‍♂️

subtle blade
#

Everything is IDs now, you just don't know it

full topaz
#

Oh?

upper hearth
#

Yeah but they still had to match the IDs to the string names, yes?

subtle blade
#

Every combination of block states are represented by a unique primitive ID in the block palette

full topaz
#

Oh...

upper hearth
#

All they did was flip which one we saw

full topaz
#

That's interesting

upper hearth
#

eh whatever, atleast we can all agree having the string names is better 👀

subtle blade
#

Though chest[waterlogged=true] is a lot easier to work with than, say, 4125

full topaz
#

definitely

cloud sparrow
#

Is there a way to convert a TileEntityHopper to a regular Hopper?

subtle blade
#

Wrap it in a CraftHopper

#

new CraftHopper(Material.HOPPER, hopperTileEntity)

#

That being an instance of Bukkit's Hopper

#

Actually the preferred alternative is probably to get the world from the TileEntityHopper, call on it getWorld() (to get CraftWorld), then getBlockAt(x, y, z), then getState()

cloud sparrow
#

Alright. Been running generations over the last 8 hours on a test server trying to find a good alternative at the moment.

#

as some of my tests generate up to around 1 million drops a hour so been trying to reduce stress on the server.

subtle blade
#
CraftWorld world = hopperTileEntity.getWorld().getWorld();
BlockPosition position = hopperTileEntity.getPosition();
Block block = world.getBlockAt(position.getX(), position.getY(), position.getZ());
Hopper hopper = (Hopper) block.getState();```
#

Little lengthier than wrapping it in a CraftHopper but it's going to be a bit more future-proof imo if you route it through the Bukkit API

cloud sparrow
#

Wouldn't it be better just to grab the chunk's world once if it's done via chunks?

subtle blade
#

However you can get the world, sure

cloud sparrow
#

Alright seems to work just need to implement a small way to keep storage now in a bit.

rocky knot
#

I need to create lots of itemstacks for my guis. set them some item meta etc.
Im worried about performace.

  1. How heavy is an itemstack object?
  2. Can i cache these itemstacks? Can a single itemstack be in multiple opened inventories at once?
cloud sparrow
#

Heavy as in to store it?

dark shuttle
#

1.) depends
2.) yes

rocky knot
#

heavy as to create, how much overhead they bring in

cloud sparrow
#

Should be barely to nothing dependent on what is in it.

dark shuttle
#

Mostly on its itemmeta

cloud sparrow
#

If you store all it's details in a empty itemstack and move it to nbt on a string single line it should make it less heavy.

#

then remake it later it'll make it less heavy

dark shuttle
#

ItemStack is just amount and itemmeta holder

cloud sparrow
#

and nbt*

#

like enchantments.

dark shuttle
#

its on itemmeta

cloud sparrow
#

and what other plugins may store in it

blazing owl
#

Hi guys

slate fable
#

hi so I as using skript and was trying to make it when someone clicks it it gives them the kit but its not working what do I need to do or change to the code? command /gui:
aliases: /g
trigger:
open virtual chest inventory with size 3 named "&c&lKits Menu" to player
format gui slot 10 of player with bow named "&6&lMachine Gun" with lore "&bShoots Arrows Fast" to close then run [execute player command "/kit MachineGun"]

muted anchor
#

Hello?

#

Anyone to help me?

vocal wraith
#

I'm not super good but what's your issue?

woven saddle
#

How can I check if a Material is Damageable in 1.12.2 ? In newer version there is the interface Damageable but in 1.12.2 i don't find anything about that

cloud sparrow
#

just check if it isn't a block?

#

and if it isn't one of the other potential booleans that a non-damageable material wouldn't have.

woven saddle
#

but there is all the other items like food, potions, enchanting books, etc that aren't blocks

cloud sparrow
#

yes? as I said check the other booleans..

#

A material has multiple booleans such as

#

isBurnable()

woven saddle
#

what's the difference between isFlammable and isBurnable ?

cloud sparrow
#
public boolean isFlammable​()
Check if the material is a block and can catch fire
woven saddle
#

okay i see

#

ofc

#

thanks

cloud sparrow
#

well here's docs but are for 1.15

#

but may help

woven saddle
#

i have the 1.12.2 docs

cloud sparrow
#

Scroll down to some of the methods if you need explanation.

ashen stirrup
#

What does arrow.setGravity(false); do?

subtle blade
#

As far as I'm aware, nothing

frigid ember
#

really? it doesn't stay in the air?

#

huh

#

that's what .setGravity(false) would do to any other entity

ashen stirrup
#

Oh

#

Great

subtle blade
#

Projectiles are different. They have velocity

#

I mean you could try it. I could be wrong. Though to my knowledge, the NoGravity tag is ignored on a projectile

frigid ember
#

so setting the velocity to 0 should suspend it in the air?

subtle blade
#

I don't know if it entirely ignores it

#

Projectiles likely have their own "gravity" so to speak

ashen stirrup
#

I need arrows to move but not lose height (Y)

#

But in 1.8

runic turret
#

Some one that knows this can help me please?

subtle blade
#

I actually did something similar, Jeeb, in one of my plugins

#

Every tick I re-set the velocity to what it was in the last tick

ashen stirrup
#

So it moves in the air but doesn't get any lower?

subtle blade
#

It only applies in water though I'd imagine it would do the same in the air

#

It looks slightly glitchy on the client because it has its own projectile prediction, but it works

ashen stirrup
#

Mind sharing it with me?

ashen stirrup
#

Cheers ❤️

subtle blade
#

(where ArrowEntityWater#getVelocity() literally just gets a Vector field and multiplies it by the passed value)

#

You can accomplish the same by just holding a Vector for the arrow when it's initially shot and just re-use it

ashen stirrup
#

Alright 🙂

frigid ember
#

Where can i see the plugins that i bought on spigotmc

cloud sparrow
wind dock
#

is it a good idea to get premium dns from namecheap when getting a domain for a minecraft server?

fleet burrow
#

I have a print statement in toPrimitive and fromPrimitive in the class that's extending PersistentDataType<String, PlayerMachine> and once I do persistentDataContainer.get(NAMESPACED_KEY, MACHINE_PERSISTENT_DATA); fromPrimitive doesn't seem to get called but toPrimtive is in fact called when calling persistentDataContainer.set(NAMESPACED_KEY, MACHINE_PERSISTENT_DATA, playerMachine);

#

And this is where I use it

Block openGUIBlock = playerMachine.getOpenGUIBlockLocation().getBlock();
            String machineJson = gson.toJson(playerMachine, PlayerMachine.class);
            setPlayerMachineBlock(openGUIBlock, playerMachine);
            System.out.println(getPlayerMachineFromBlock(openGUIBlock));```
cerulean turret
#

hey, does somebody have experience with forking spigot? I have a couple complications about setting everything up, any tips?

sharp hollow
#

First, why do you need to fork it?

grim sapphire
#

to make another beerspigot /s

sharp hollow
#

😂

#

I'm personally curious to see what changes those forks actually make, no way in hell am i paying though 👀

quick arch
#

Snow-Pyon's brother? 🤔

harsh otter
#

BeerSpigot is a joke, someone sent me the jar once

#

Yes

#

@quick arch may I ask, who are you

quick arch
#

A friend of Snow

harsh otter
#

Nice

grim sapphire
#

i mean beerspigot has turned into "3 tiered" versions of forks

cerulean turret
#

@sharp hollow basically in my country (Poland) there is a lot of people that uses "proxies" (handler between client->server, that allows u to manipulate packets)

grim sapphire
#

Pretty sure two of which have been purchased from other developers to resale for self gain

cerulean turret
#

I want to prevent them from doing bad stuff on polish servers

sharp hollow
#

Anti-Proxy/Anti-VPN plugin?

cerulean turret
#

no

sharp hollow
#

why not?

cerulean turret
#

it's called proxy, but I mean it's a custom server made on mcprotocollib library that allows u to connect to every server u want by just typing command in it

#

and it allows u to send packets, that I want to restrict as much as I can

#

I can give u more details about it on pm if you want

ashen stirrup
#

Is there a SilkSpawners for 1.15.2 or a similar plugin

naive goblet
#

Okay so my question is if the Apache license 2.0 still is valid. If it isn't I'm going to recode a plugin that is dead since 2017.

frigid ember
#

ouo

#

what plugin are you thinking of recoding?

#

also, sorry about cutting you off, but I have a question about packets

naive goblet
#

MineResetLite

frigid ember
#

ahhhhhhh

#

oh god

#

please recode i beg of you

naive goblet
#

Really need to know if I can do it

#

Or not

#

Due to the license

frigid ember
#

hmmmm

#

if you haven't already, i'd contact the author

naive goblet
#

Been asking several discords and most ignores me :[

#

Well the author quitted 2 years ago

frigid ember
#

this sounds like somewhat of a difficult thing to answer

#

hmmmm

quick arch
#

MRL?

naive goblet
#

Yes?

naive goblet
#

Oh then I dont have to :o

frigid ember
#

:D

#

by the way - according to the protocol wiki, PacketPlayOutAnimation involves certain "animations" or "effects" which can be applied to an entity

#

and if you put "1" as the value, it's the "damage" effect - but i am wondering what this is - does it just turn the entity red as if they took damage? or does it do something else

#

i am writing a custom weapon/damage system and it seems to be working up until this point

#

going to post a few lines of code

quick arch
#

iirc, it just turns them into that red damaged state

frigid ember
#

hmmm alrighty

#

this doesn't seem to happen then, wonder why

#

if it's alright, going to post a bit of code in here

#

            PacketPlayOutAnimation animationPacket = new 
PacketPlayOutAnimation(((CraftEntity)entity).getHandle(), 1);
            List<Player> NearbyPlayers = GameFunctions.playersInRange(EntityLocation, 18);
            if(NearbyPlayers.size() > 0) {
                for(Player player : NearbyPlayers) {
                    player.sendMessage("packet");
                    ((CraftPlayer)player).getHandle().playerConnection.sendPacket(animationPacket);         
                }
            }
            
#

getting the "packet" message whenever an entity is damaged, so it seems to be working up until that point

solemn grove
#

Not quite sure how to ask this question
Say your project is in version 1.2.2
A feature update means the version will go up to 1.3.0
But how do you consider the feature update is big enough to go up to 2.0.0?

frigid ember
#

maybe have a "roadmap" of updates

#

then divide 1.0 by the number of major features

#

that way, when you add one of those features, it's added on top of the number you already have

solemn grove
#

I see

frigid ember
#

it's quick and dirty but what i have used :D

solemn grove
#

@frigid ember thanks for the tips!

frigid ember
#

no problemo good luck fren!

regal topaz
#

Hello,

I search a good obfuscator for Spigot/BungeeCord. I use Redis, MongoDB and MySQL, what obfuscator you can advise me (Free/Paid) ?

I have already test ProGuard and he does not fonction :/

Thanks everyone for your help ! 😄

frigid ember
#

you already posted this

tiny dagger
#

proguard does work

#

pretty good too imo

#

deativate the optimize function or how it was

#

called

#

then add event handlers back and error lines

#

and make sure to have a package to not conflict with other plugins

sharp hollow
#

Then also make sure you don't break spigots 4.1.6 rule in any way, shape or form 😛

compact marsh
zealous yoke
#

nice profile pic @sharp hollow

sharp hollow
#

👌

regal topaz
#

@tiny dagger thanks for your response but on use ProGuard for obfuscate, any code is unloaded

gusty crane
#

Ive got an issue with the premium plugin Spartan

#

which i bought

#

and im not sure how to fix this but

#

a player is having issues joining the server

#

and keeps getting this message everytime they try

zealous yoke
#

we cannot do much about that, maybe you configured something wrong. but if it is a bug, you have no other possibility than contacting the author

gusty crane
#

well i havent

#

gotten into the config yet straight from the page and onto the server etc

#

and i would but then i gotta buy another rescourse of him which

#

isnt currently looked at as tempting

quick arch
#

Vagdedes is in here, but doesn't he have his own support Discord

gusty crane
#

1 You must own at least 2 of the my Minecraft products. To prove you are a buyer, please tag @Evan | Vagdedes in the #commands-n-links text-channel and provide a full screenshot of the page https://www.spigotmc.org/resources/purchased.

2 You must be a Syn Member. To prove you are a buyer, please tag @Evan | Vagdedes in the #commands-n-links text-channel and provide the Syn Membership conversation URL.

3 Become a Patron via https://patreon.com/vagdedes and enter amazing giveaways. To prove you are a buyer, please tag @Evan | Vagdedes in the #commands-n-links text-channel and provide a full screenshot of the page https://www.patreon.com/pledges.

#

gotta have one of them

#

im not a sun member

#

ive only got the spartan plugin

#

and patron is mentally scary

quick arch
#

forgot he's doing that "pay money to get more help" thingy 🤔

sharp hollow
#

Stupid as fuck as well tbh

quick arch
#

^

gusty crane
#

cant say i disagree

sharp hollow
#

I'd love to do an AntiCheat myself, but like...i can't even play MC 😂

wooden harness
#

I hate it when people require you to pay more for support

#

If paying for the plugin wasn’t enough already

gusty crane
#

yepp

#

sucks

compact marsh
#

Is it even allowed to do that on spigot?

quick arch
#

Don't think so

gusty crane
#

i were wondering about that

compact marsh
#

Because if not report him.

sharp hollow
#

guess what, we have staff who we can ask

wooden harness
#

I don’t remember seeing anything where it stated that it wasn’t allowed

sharp hollow
#

@subtle blade any idea if the above is allowed? I know you used to be a resource staff so you'd probably know

compact marsh
#

Like priority support if you pay more I get that. But you must help the people who are just buyers right?

gusty crane
#

i dont think he's obligated to help nor anything like it but ive hot no idea

#

got

subtle blade
#

You're not obligated to help anybody and users should not expect help, but asking for money for premium support is kind of scummy

#

I'd avoid that plugin (and author) like the plague tbh. Makes it clear that they care more about money than their users

gusty crane
#

didnt really expect the help which is why i came her

#

here

quick arch
#

I'd avoid that plugin (and author) like the plague tbh.
Great comparison

#

10/10

gusty crane
#

indeed

#

ill just buy a new one

#

any tips?

#

iris perhaps

sharp hollow
#

eh, guess i can see what would be easy to replicate and improve on to make a bit of competition 🤷‍♂️

pastel condor
#

Anyone know how I can have metadata stay on a block during a server restart?

quick arch
#

just use nbt 🤔

subtle blade
#

Right. The Metadata API is not intended to be a persistent data API

#

Its original purpose was actually for inter-mod communications if I recall correctly, but it was never used as such

fluid flame
#

hey

#

i need this plugins, someone can help-me? pls thanks

The Underground Dimension
and
World Heaven (100x100) houses

proper bison
#

all info for its in there cant find the issue

compact marsh
#

Main class doesn’t exist or can’t be found.

dusky herald
#

I don't know if anyone will find this useful; but I made a PageSorter class, which I'm using for commands that have multiple pages on them if ya'll want to use it:

https://pastebin.com/ieGAGBLk

brittle stone
#

An @EventHandler with ignoreCancelled = true, will that ignore cancelled events?

chrome lark
#

yes

proper bison
#

yeah

brittle stone
#

Strange, cause I have an event handler that does not receive a cancelled event, despite having ignoreCancelled set to false

final verge
#

Do you register the event listener?

brittle stone
#

I did

woven saddle
#

Hey i have a doubt with spigot 1.12.2 Material names, is the normal terracota (not colored) Material.HARD_CLAY ?

brittle stone
#

Also, the handler has a higher priority than the handler cancelling it

upper hearth
#

@brittle stone if you set "ignoreCancelled" to false it's not going to ignore the cancel lol

brittle stone
#

The handler where it is cancelled has a normal priority, and the handler in my plugin which should receive the cancelled event and uncancel it under certain conditions has a highest

#

Also @upper hearth on the event API reference on Bukkit wiki, it says this about ignoreCancelled: If set to true, your method will not get the event if the event has been cancelled

upper hearth
#

That's horribly named

#

I don't think this does what you intend it to do

#

If ignoreCancelled is true and the event is cancelled, the method is not called. Otherwise, the method is always called.

It's already false by default

brittle stone
#

And that makes the documentation on event cancellation very confusing

fleet crane
#

Why's it horribly named

upper hearth
#

not horribly named

#

But I feel like the docs are confusing

fleet crane
#

ignoreCancelled, ignores cancelled events

sharp hollow
#

I guess it could be ignoreCancelledEvents

#

That's more obvious compared to "ignoreCancelled"

brittle stone
#

Also, does a highest priority event handler receive an event after a normal priority?

upper hearth
#

So ignoreCancelled just straight up doesn't call the event if it's true? If it's false it just calls it and if it's cancelled doesn't do anything?

#

Lowest -> Low -> Normal -> High -> Highest is call priorities

sharp hollow
#

It calls the event, you just can't listen to it

upper hearth
#

I can't think of a use for that ngl

sharp hollow
#

Malicious plugins for example cancel the player chat event so their messages don't show in chat

#

...me being me though, i just mixin the fuck out of that event to uncancel them when it comes to my AntiMalware 👀

#

though, admittedly i mixin the fuck out of a variety of classes and events 👀

rocky knot
#

Can i make an itemstack unstackable in inventory?

upper hearth
#

Just use InventoryClickEvent and prevent them from placing an item on top of itself

rocky knot
#

im not listening to event ...

#

i could probably put custom nbt tag with random value

#

but that sounds fucked up

fleet crane
#

Y

rocky knot
#

damn, really no other way

upper hearth
#

Just listen to the event?

analog leaf
#

How often does the update checker URl update?

#

i keep getting warned for tryna share the url :/

quick arch
#

pretty sure md_5 said it updates every few hours

woven saddle
#

Hey what is the Material for the dyes in spigot 1.12.2 ?

fleet crane
#

Instantly butmay be cached at ur local cloudflare

#

Ps it has cache headers

#

Inksack

woven saddle
#

thanks

quick arch
#

oh the cache time is 4 or so hours

analog leaf
#

huh

#

oh so my local server has cached the version

#

alright gotcha

#

anyway to get around that?

fleet crane
#

Not your server specifically but yeah

#

I’m confused why you need updates down to the minute

analog leaf
#

I don't I was just wanted to make sure my code was working

#

thanks

nimble solar
#

Isn’t there a cache bypass option in cloudflare 🤔

#

I mean for an update checker bot having an update notification 4 hours after the update is released is a bit weird

rocky knot
#

Does jvm automatically unroll loops?

royal star
#

Hey there is a plugin to find out which command is created / used / overwritten by a plugin?

#

What is the name of that I can't seem to find it anymore.

woven saddle
#

is that normal that in 1.12.2 DyeColor are actually inversed for dyes ?
for example if i color an InkSac into DyeColor.LIME, i get magente, into DyeColor.BLUE i get Yellow 👀

unique hamlet
#

Wait so how do people make custom mobs in spigot 🤔

#

Without texture packs

#

There's this plugin called advanced mobs that can do it

upper hearth
#

ArmorStands probably

quick arch
#

AdvancedSpawners?

#

It's most likely done with armor stands

grim sapphire
#

Can anyone help me with nbtapi?

#

Just trying to figure out the basics of it, the examples confuse me

quick arch
#

It's simple 🤔

upper hearth
#

very helpful

quick arch
#

the examples are the basics of it

grim sapphire
#
public ItemStack injectNBT(File file) throws IOException {
    final NBTItem nbti = new NBTItem(getItemStack());
    final NBTFile nbtFile = new NBTFile(file);
    final NBTContainer container =  new NBTContainer(json); //Parse in json
    setItemStack(nbti.getItem());
    return nbti.getItem();
}
#

I dont understand the json part its asking for

fleet crane
#

@woven saddle theres dye colour and wool colour which are inverses

#

@rocky knot yes where appropriate

frigid ember
#

Is anyone else having slow startup times with 1.15? On a hosting site I've been using 1.8 loads faster than 1.15

grim sapphire
#

If im trying to add a simple nbt tag to my item, do i need nbt file and nbt container?

#

yeah my 1.15 is slow start too, idk if its cause only 1gb allocated but its pretty slow for me too

frigid ember
#

well.... its 1.15

dusky herald
#

Class: PageSorter

You can use this to sort through your lists as Objects[], sort em into pages...whatever. If any of ya'll have a use of this: https://pastebin.com/SPtYDx9x (Edit) removed useless imports

acoustic herald
#

is anybody here good with bedwars rel

pastel condor
#

All my plugins are using the same package format (com.voidcitymc.www) and I happen to have two of them running on my server, and my server claims that one of the plugins is already loaded. Is this an issue of using the same package format?

#

In other words a plugin doesn’t load

#

Also @acoustic herald I use bedwars rel

acoustic herald
#

its ok i got somebody else to help me

pastel condor
#

Kk

dusky herald
#

@pastel condor Package interferences are a thing. This is why you should abide to naming your packages unique for each project you make. Ensure the two plugins do not have the same package names at all.

If your IDE supports it, you can easily Refactor Package names and it will apply the package name change to all your classes in your project.

#

You could easily just name the packages something like...

#

com.vidcitymc.www.Plugin1

#

com.vidcitymc.www.Plugin2

pastel condor
#

Ah I see

#

Thanks

dusky herald
#

(Refactor is another fancy word for Rename, btw)

pastel condor
#

The main class had the same path so spigot got confused xD

#

For both my plugins

dusky herald
#

They can have the same name, they just need different packages.

pastel condor
#

Okay, I use eclipse and I believe it has that feature

#

I mean like my police plugin and other plugin’s main path is com.voidcitymc.www.Main

#

So spigot thought it was already loaded

dusky herald
#

yeah they need to be different

#

I would change them both to different names like (in my personal opinion)