#help-archived
1 messages · Page 8 of 1
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
can a player be in a chunk that isnt populated tho
I only saw that one part of what he asked, I dont know the rest of the details.
Just went on an assumption;
ok i did setHealth and they wont disapwn
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
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());
}
}
}
How do I check if a player is in a water portal? How do I check the location
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
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?
I want to make a teleportation portal
use PlayerMoveEvent and check if the block they're in is water
I already have that
so is there an issue you're running into?
I want to check between specific coordinates
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
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
https://paste.md-5.net/tawikalaku.cs
@alpine vector This works fine for me
Could do regions but would only work for rectangular shapes
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
^ Probably best solution
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)
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)) {
oof
Make sure that pos2 coordinate is greater than pos1 coordinate
double x1 = 139;
double y1 = 68;
double z1 = -34;
double x2 = 137;
double y2 = 61;
double z2 = -34;
so there is only one hardcoded portal?
For now yes
@bronze marten nope nothing works even your code
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,
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)
btw, for this kind of region, i would prefer int than double
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?
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
can someone help me rq? I wanna add a custom enchantment. I already have the class written. How do I register it?
sues every server for not building the jar on there
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));
}
Most likely because that NPC does not exist on the server
It exists only on the client, correct?
To set its equipment, you would have to send another packet
Not sure off the top of my head. Though https://wiki.vg/Protocol will be of use
Well thanks!!
PacketPlayOutEntityEquipment iirc
That's the one
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
That should work fine. If you're running Essentials, use /minecraft:give
because fuck essentials lol
okay
Any one have any suggestions for saving and reading permission nodes from a MySQL database?
As in existing plugins or making your own?
Making my own
Trying to save per-player nodes into the database so they can be attached when the player joins
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
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
Well you only need to save if perms are updated
Update cache (if player is online and cache exists) and then update db async
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
perm_node, player_uuid
?
could even extract perms and have separate table relationship if you want to be fancy and store all known nodes
So just have a separate table, and make a new column for each node?
Well if the player has a permission, add that entry
And ofc the uuid column
Is it possible to store multiple UUIDs like that?
Yeah of course
Like
<node> | <UUID>, <UUID>, <UUID>, etc etc
?
No
Do you ned to know every permission node available? Or do you just want to know if a player has a permission node?
Just if they have it.
<node> | <uuid>
----------------------------------------------
"build.place" | "ehehehe-eegheghe-ehjehehe"
"build.place" | "aaaaa-aaaaaa-aaaaaaaa-aaa"
"build.destroy" | "ufufdbn-dfhdshf-dfhfsdh"
etc ..
Sure, but then multiple people have the node, correct?
Well yeah, can't multiple people have the same permission node?
Key would be the composite of both
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?
By adding another row
<node> <uuid> are your columns
your player entries are your rows
Oh I can't read apparently
and you have as many rows as you want
Or store each permission in it's own entry
said that doesn't need to know every perm just if a player has it
Uuid | permission node (varchar)
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?
identical to my setup
Well, that's literally how I did it like 7 years ago @wraith apex lol
oh god how many perm nodes does a server have
Everything is custom on mine
And I'm only talking about per-player perms here, not group perms.
Group perms are handled differently.
Idk, you could add each node as a column, but seems like a waste of time to me
you don't require that number of columns, it's not normalised and not clear
But the number of rows I'd be adding with your method would be insane
You could just run a batch search for all entries under UUID for the player
And apply each node
That was found
Bruh
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
Db's have millions of rows
Not millions of columns
MySQL optimises for rows if your structure is good.
Who cares if you have 75 entries
Just search with a filter, you can get all entries with 1 search query
what's the difference between pulling a column and a row?
nothin it's just a block of memory
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
<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?
First one
may i ask just
real quick
new aight
ChatColor.AQUA + ChatColor.BOLD + "Welcome "
would this be correct
or
how do i do it
need a string between
ChatColor.AQUA + "" + ChatColor.BOLD + "Welcome "
Blame java not having operator overloading
❤️
So the first method is better?
yes
If you plan to add more nodes later especially
75 nodes to start with is enough to tell you that
If you add more nodes later, and you enter them as columns then you'll have to update each player later as well
what fucking db schema has 75 columns 😂
I already have code in-place to handle stuff like that @dusky herald
ohh who was right without confusing newpeople
Well either way, the first way is a better approach and provides more versatility.
A course on design lol I figured itd be common sense really
Bruh I studied db design in university. We had to do relational algebra before touching sql
It sucked.
Alright thanks guys, I'm not really a fan of SQL ;l
Also consider the data types you pick for your tables as well; they matter as far as data transfer goes and optimizing speed
oh god
@wraith apex btw I wasnt disagreeing with you earlier; I came in on the middle of the conversation 😂
What... is that monstrosity...
Dude I dropped out of university so I wouldn't have to deal with calculus anymore
It's called academics being academics
@subtle blade
Can't believe I got 98% in that module.....
@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
IMO I would load all the permissions when they log in
Yea lol
Yeah it will
Update immediately when it's granted?
yeah always async duh
can't stress it enough not enough ppl do it
Nah I do understand that part of it
some dbs are on separate servers ya know 😭
And the Java part ofc, but SQL and db design ;(
All these people running localhost sql servers
SQL is pretty easy. Although it can get technical, it shouldnt be that hard for minecraft servers
When I implemented my database, I wasn't using async and didn't notice because localhost
DB design is difficult
Switched to my real server and oh boi
I guess, but I've messed with databases since I was 12 so I guess I got used to it.
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 😂
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.
Yeah optimisation does take the fun out of it
Understanding the internals make it less satisfying when solving a problem
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
If you're working on optimizations where you can really see an improvement when using the "product", I think it can be fun
too an extent
Yeah I guess if you have to optimize it to make whatever you're working on remotely enjoyable
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
Hell sometimes when you optimize you have to start all over
@earnest bison
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
It depends. Optimization can lead to total redesigns of systems, not just changing a few things.
If the code is initially bad, yes
But I mean adding new features and stuff is clearly more fun lmao
Yeah sometimes that just contributes to the problem.
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)
Uh yeah, take Minecraft for example
All they do is add features and break stuff only to fix it 4 years later
They dont design Minecraft for modders.
I'm talking vanilla Minecraft
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.
Yeah Mojang really likes adding new features and really dislikes fixing issues. From what I've seen anyways
They do fix issues actually
I didn't say they never fix them
Minecraft 2. The optimisation update
Cannot wait to compare hytale server vs minecraft
in terms of raw performance under load
We'll see I suppose. They have to release it first..
IMO Hypixel announced too early
not really the hype allowed for greater investment opportunity 😉
We are getting offtopic now? #general
need a #off-topic
#general I suppose
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
is anyone able to help me diagnose performance issues on my server?
im getting about 7-9 tps with 80 people on
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?
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?
how do i make the lines display in configure.yml the lines for a scoreboard
how can i improve the performance of cactus farms?
Any ideas why my spawners aren't working? It spawns one critter, then turns to the floating pig of doom. O.o
yo can someone help me real quick?
With?
I want to add a custom enchantment
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
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?
yes
No it shouldn't work as those are outdated mechanics and different ways of how stuff are saved.
hmm
You can make a backup and try but no guarantee without issues.
minecraft can update them... sorta
@frigid ember what version
That's your risk if you want potential corrupted chunks
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. ❤️
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?
@soft iron have you tried silkspawners
still work?
Like, so the pig thing stops happening
should
You, are a god.
Jesus LOL
.> <.<
But does it work on 15.2
That shall be the question of the day
Is it possible to uncancel cancellable events?
e.setCancelled(false)
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
But.. someone can help me?
And if I understand events correctly, priorities should be LOWEST, LOW, NORMAL, HIGH, HIGHEST and then MONITOR
Indeed
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:
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?
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?
i don't really know
Do /plugins
where can i do it?
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
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
return minecraftKey != null ? MinecraftKey.b() : "";
What does this mean?
It'll return (nothing) if it's null
else, the value in MinecraftKey.b() if it's not null
nice..
So if you call A it'll return B and if you call B it'll return A
That's from the Spigot source
Oh
kekw
It says MinecraftKey.b() has protected access
write your source obfuscated big brain
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
I assume it works for 1.13.2 since I'm updating it from that to 1.15.2
What did b() do and why are they using MinecraftKeys?
@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;
}
There’s api for this. CreatureSpawner BlockState has #getSpawnedEntityType() or something like that. I’m on my phone, can’t double check
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
Cheers ❤️
o/
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
How are you planning on storing info on the keys
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
@grim sapphire I mean it'd work, you could make a map for <CrateObject, Key>
help
i wanted to play speedrunner vs assassin
but idk how
i installed the assassinplugin 1.1 from https://www.spigotmc.org/resources/assassinplugin.74228/
Did you put it in your plugins folder? You also need https://github.com/JorelAli/1.13-Command-API/releases/tag/v2.3a according to the resource page.
@keen moth can you help me with that?i dont know where is plugins folder :<
Your plugins folder is located in your server directory.
what if i dont have a server?and i use Tlauncher?
I'm not sure what that is. That resource is a plugin that must be ran on a server.
i use crack
@keen moth can i play assassin vs speedrunner on LAN?
You need a server to run it
Frosted, for the cancel, i just do ignoreCancelled = false right?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/EventHandler.html#ignoreCancelled--
If ignoreCancelled is true and the event is cancelled, the method is not called. Otherwise, the method is always called. The parameter itself does not cancel the event.
false is default afaik
What's max scoreboard length on 1.15?
Alright, thanks
@cloud sparrow Scoreboard length as in title or team name?
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
Someone correct me if I'm wrong, but pretty sure team entries are capped at 16.
ah yeah I have that.
could be my text limit hmm.
color isn't going to the end:
Actually, I'm pretty sure the limit was increased in 1.13+
Could be an issue with the way you're formatting it, if you're doing anything fancy.
likely is.
return new EntryBuilder()
.blank()
.next("&fRank: &7[Member]")
.blank()
.next("&fOnline: &a0")
.next("&fServer: &e&lHub 1")
.blank()
.build();
Yea no, if there was a cap, the text would be cut off entirely, not just the color.
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
Whats this error i keep getting in my console? https://i.gyazo.com/ba8cf6bdbae095a198512733d4d69409.png
is this a server jar error or a plugin?
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 suggestedBukkit.getAverageTickTime, but that method is undefined, does anyone else have an idea?
is that the server your influxdb is running on?
wherever you put influxdb is out of disk space
idk which plugin is using influxdb
its not clear from the log
Alright, but I'd assume minecraft doesn't use influxdb so its kinda 'safe' to ignore 🤣
probably a statistics plugin you installed
Alright thanks for the help 🙂
is there any event thats runs after join?
PlayerJoinEvent
yeah but still feels quiet fast
then delay it
yeah i think so
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
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
Well, hopefully any block but I can deal with blocks that are TileEntities
but only spawners is quite limited
i hate eclipse and its enum bug :\
So why are you using eclipse/
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;
}
}```
because i know where everything is
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
That'll set nbt for the block?
this gets NBT
ahhh
there's another method to set it
What about setting then?
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
aight
Regular blocks don't store nbt, only tile entities
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
Yeah, I could deal with only tile entites its ok
it's gotten better in 1.15
I might just place a sign at the very top of the chunk
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
Some improvements on that code which sets the nbt: No need for return statements & the else block.
I've been told there are ways to set block data also but that would be less efficient no?
Are you storing custom data in the tile entity? If not, there may already be api you can use to modify the data
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
@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
hmm
how do i change my nickname
rn its qbasty
on spigot
ill rejoin
didnt work
rip
Hello, can someone please help me to use CompletableFuture for Bukkit - Bungeecord messaging channels
i need the information from GetServer in RealTime
please
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
Im not quite sure that signshop supports custom items
@fiery pendant ask @golden vault because he is a maintainer
hey @golden vault ?
is there an tutorial into the wiki for permissions ? i'm struggling right now 🧐
@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.
is this the only way to one go remove items from a list? 🤔
all the functional interface stuff is very nice
yeah its way too good
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.
Hello, my spigot account was "hacked" and my email adress was changed
Nice
any one here knows how can I disable auto-opening of files at vscode when move a file to vscode window?
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..
@frigid ember send an email to spigots support email
Can i have the mail pls?
I believe tmp-support@spigotmc.org is the right one
Thx
Welcome ^.^
@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"
If it's that then isn't it incorrect?
It is correct
Correct
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);
}
}```
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
Well for one, should definitely make a variable for playerMachine.getOpenGUIBlockLocation().getBlock(). You use it 4 times ;P
Yeah just a quick test haha
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
What version are you on?
1.15
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.
Yea, that's the one
And yes, it does ignore custom values
Only loads what vanilla needs
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
So that supports any block?
Any BlockState (tile entities)
Blocks can't hold NBT data
That holds true for vanilla as well
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
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
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?
okay
if you'ree forced to support all versions like me
I have a set of tools
https://github.com/CryptoMorin/XSeries
Im using a forked version of this with some extra methods I need
This has stuff like Xmaterial
Persistent Data Container is awesome :P
which is a new enum you can use
"forced" LUL
basically dude

Your first mistake was maintaining a factions fork
SuppOrt 1.8.8
sadly that is true 😦
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
It's definitely time for everyone to stop supporting 9 different versions at a time
r/unpopularopinion/
I still support 1.8 tho cuz I have experience
Your experience should be directed to using newer and more modern API features
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
Someone give this mans a raise
imagine having a huge workaround to support 1.8.8
^ yeah I also couldn't be asked to make everything work back that far
VomitAttack
not to talk about how you have to test for n versions since they work so differently
Hold on, I can store classes using PersistentDataContainer?
Or do I need to serialize them?
Yup
Would you recommend extending that or using reflection to get the PrimitivePersistentDataType constructor?
i saw this, but i haven't yet found a good use to it
No no, just implement it
Alright, thanks 🙂
PrimitivePersistentDataType is for internal use to more easily create the primitive types as constants in PersistentDataType
complex type is what I am given and primitive is what is store?
I believe so, yes
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
Sounds like a broken config
What's your bungee.yml look like (redact any sensitive information or whatever)
can I dm?
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.
make sure that you're setting the itemmeta back to the item before giving the item
yes i am
MaterialData materialData = itemStack.getData();
if (materialData instanceof Colorable) ((Colorable) materialData).setColor(color);
itemStack = materialData.toItemStack(1);
Shouldn't you use itemStack.setData() or am I dumb?
How can I compress a location to a Long?
@upper hearth that changes nothing
i you can't
Concrete did not have Colorable MaterialData afaik
x, y is alone 64 bits
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!
Why did Mojang even use data like that in the first place instead of using the naming we have now 🤔
probably due to the way they used to store things
keep in mind everything was IDs before
Yeah I know, don't really understand that either.
I too prefer the new system. Much more user-friendly and human-understandable
Back in the old days of 2009 or whatever I guess that was the way to go ¯_(ツ)_/¯
Everything is IDs now, you just don't know it
Oh?
Yeah but they still had to match the IDs to the string names, yes?
Every combination of block states are represented by a unique primitive ID in the block palette
Oh...
All they did was flip which one we saw
That's interesting
eh whatever, atleast we can all agree having the string names is better 👀
Though chest[waterlogged=true] is a lot easier to work with than, say, 4125
definitely
Is there a way to convert a TileEntityHopper to a regular Hopper?
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()
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.
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
Wouldn't it be better just to grab the chunk's world once if it's done via chunks?
However you can get the world, sure
Alright seems to work just need to implement a small way to keep storage now in a bit.
I need to create lots of itemstacks for my guis. set them some item meta etc.
Im worried about performace.
- How heavy is an itemstack object?
- Can i cache these itemstacks? Can a single itemstack be in multiple opened inventories at once?
Heavy as in to store it?
1.) depends
2.) yes
heavy as to create, how much overhead they bring in
Should be barely to nothing dependent on what is in it.
Mostly on its itemmeta
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
ItemStack is just amount and itemmeta holder
its on itemmeta
and what other plugins may store in it
Hi guys
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"]
I'm not super good but what's your issue?
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
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.
but there is all the other items like food, potions, enchanting books, etc that aren't blocks
yes? as I said check the other booleans..
A material has multiple booleans such as
isBurnable()
what's the difference between isFlammable and isBurnable ?
public boolean isFlammable()
Check if the material is a block and can catch fire
i have the 1.12.2 docs
Scroll down to some of the methods if you need explanation.
What does arrow.setGravity(false); do?
As far as I'm aware, nothing
really? it doesn't stay in the air?
huh
that's what .setGravity(false) would do to any other entity
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
so setting the velocity to 0 should suspend it in the air?
I don't know if it entirely ignores it
Projectiles likely have their own "gravity" so to speak
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
So it moves in the air but doesn't get any lower?
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
Mind sharing it with me?
Cheers ❤️
(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
Alright 🙂
Where can i see the plugins that i bought on spigotmc
is it a good idea to get premium dns from namecheap when getting a domain for a minecraft server?
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);
This is the class extending PersistentDataType https://srcb.in/53cc347eda
These are the methods I use to save and get persistent data https://srcb.in/9998f3059e
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));```
hey, does somebody have experience with forking spigot? I have a couple complications about setting everything up, any tips?
First, why do you need to fork it?
to make another beerspigot /s
😂
I'm personally curious to see what changes those forks actually make, no way in hell am i paying though 👀
Snow-Pyon's brother? 🤔
BeerSpigot is a joke, someone sent me the jar once
Yes
@quick arch may I ask, who are you
A friend of Snow
Nice
i mean beerspigot has turned into "3 tiered" versions of forks
@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)
Pretty sure two of which have been purchased from other developers to resale for self gain
I want to prevent them from doing bad stuff on polish servers
Anti-Proxy/Anti-VPN plugin?
no
why not?
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
Is there a SilkSpawners for 1.15.2 or a similar plugin
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.
ouo
what plugin are you thinking of recoding?
also, sorry about cutting you off, but I have a question about packets
MineResetLite
Been asking several discords and most ignores me :[
Well the author quitted 2 years ago
MRL?
Yes?
There's this updated version, https://www.spigotmc.org/resources/mineresetlite-with-worldedit-v6-v7-tokenenchant-explosive-support.61713/
Oh then I dont have to :o
: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
iirc, it just turns them into that red damaged state
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
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?
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
I see
it's quick and dirty but what i have used :D
@frigid ember thanks for the tips!
no problemo good luck fren!
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 ! 😄
you already posted this
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
Then also make sure you don't break spigots 4.1.6 rule in any way, shape or form 😛
^ that rule is only for people who upload on spigotmc.org.
nice profile pic @sharp hollow
👌
@tiny dagger thanks for your response but on use ProGuard for obfuscate, any code is unloaded
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
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
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
Vagdedes is in here, but doesn't he have his own support Discord
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
forgot he's doing that "pay money to get more help" thingy 🤔
Stupid as fuck as well tbh
^
cant say i disagree
I'd love to do an AntiCheat myself, but like...i can't even play MC 😂
I hate it when people require you to pay more for support
If paying for the plugin wasn’t enough already
Is it even allowed to do that on spigot?
Don't think so
i were wondering about that
Because if not report him.
guess what, we have staff who we can ask
I don’t remember seeing anything where it stated that it wasn’t allowed
@subtle blade any idea if the above is allowed? I know you used to be a resource staff so you'd probably know
Like priority support if you pay more I get that. But you must help the people who are just buyers right?
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
eh, guess i can see what would be easy to replicate and improve on to make a bit of competition 🤷♂️
Anyone know how I can have metadata stay on a block during a server restart?
just use nbt 🤔
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
hey
i need this plugins, someone can help-me? pls thanks
The Underground Dimension
and
World Heaven (100x100) houses
Main class doesn’t exist or can’t be found.
ClassNotFoundException: me.kieranslayer.ao.Ao
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:
An @EventHandler with ignoreCancelled = true, will that ignore cancelled events?
yes
yeah
Strange, cause I have an event handler that does not receive a cancelled event, despite having ignoreCancelled set to false
Do you register the event listener?
I did
Hey i have a doubt with spigot 1.12.2 Material names, is the normal terracota (not colored) Material.HARD_CLAY ?
Also, the handler has a higher priority than the handler cancelling it
@brittle stone if you set "ignoreCancelled" to false it's not going to ignore the cancel lol
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
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
And that makes the documentation on event cancellation very confusing
Why's it horribly named
ignoreCancelled, ignores cancelled events
I guess it could be ignoreCancelledEvents
That's more obvious compared to "ignoreCancelled"
Also, does a highest priority event handler receive an event after a normal priority?
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
It calls the event, you just can't listen to it
I can't think of a use for that ngl
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 👀
Can i make an itemstack unstackable in inventory?
Just use InventoryClickEvent and prevent them from placing an item on top of itself
im not listening to event ...
i could probably put custom nbt tag with random value
but that sounds fucked up
Y
damn, really no other way
Just listen to the event?
How often does the update checker URl update?
i keep getting warned for tryna share the url :/
how often does https://api.spigotmc.org/legacy/update.php?resource= update
pretty sure md_5 said it updates every few hours
Hey what is the Material for the dyes in spigot 1.12.2 ?
thanks
oh the cache time is 4 or so hours
huh
oh so my local server has cached the version
alright gotcha
anyway to get around that?
Not your server specifically but yeah
I’m confused why you need updates down to the minute
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
Does jvm automatically unroll loops?
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.
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 👀
Wait so how do people make custom mobs in spigot 🤔
Without texture packs
There's this plugin called advanced mobs that can do it
ArmorStands probably
Can anyone help me with nbtapi?
Just trying to figure out the basics of it, the examples confuse me
It's simple 🤔
very helpful
the examples are the basics of it
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
@woven saddle theres dye colour and wool colour which are inverses
@rocky knot yes where appropriate
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
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
well.... its 1.15
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
is anybody here good with bedwars rel
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
its ok i got somebody else to help me
Kk
@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
(Refactor is another fancy word for Rename, btw)
They can have the same name, they just need different packages.
