#help-development
1 messages · Page 2234 of 1
And finally, try to name your variable a,b,c... It's way faster (proof: obfuscation do it)
Anyone just imported a skyblock plugin via maven yet?
Why limit to ascii?
i dont think so but you can PR it
Unicode better

You're right
Jokes apart, do you guys know if it's possible to use a Java 17 dependency on a Java 8 plugin?
If you run Java 17 on the server it should be possible
Yeah, but I mean since the plugin should also be compatible with llower Java version, it should still run when not having this plugin on it
But on gradle I can't import it...
java is backwards compatible
"Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 8"
but if the plugin is compiled in java 8 you obv. cant use java 17 features
Yeah I guess I'll have to use Reflection
Bukkit.getOfflinePlayers().size()
The .size() is red
.length not .size()
alr
hey maybe my tnt cannon can help too
or use tabs. a tab can replace 4 spaces, or even 8. then you can make it faster but it still looks like you have spaces
life hack
yes. set the source and target in maven to java 8, but run it with java 17 anyway
is there a way to somehow use pehkui with spigot? so basically have players use the mod client side and use spigot to send packets to tell people entity sizes?
I guess that if you know exactly which packets you need to send, you can do it for sure. You just have to write your own packets
Couldn’t you prevent the distribution of premium plugins by linking it to some sort of site registration? Is this a problem worth solving?
Any premium plugin you write must be able to run without the internet
Is that a requirement by spigot?
yes
Ah gotcha
all downloaded premium plugins have a custom ID injected. You can host a ban list when the plugin can check to see if its banned and disable. but you can't stop the plugin workgin if it has no internet
So just to be clear I wouldn’t be able to disable the plugin if I detect that there’s no internet access?
no, the plugin must be able to be used the instant its downloaded
that's not allowed
without internet
Hey, I'm having issues with dispatching a large amount of commands for a Vote Party.
I'm currently executing a sync runnable with a period of 4 to handle the rewards, but the payload is still causing large TPS drops
Anyone have any suggestions for dispatching a large payload of commands to all online players? (~600 total commands because of 150 online)
premium plugins must work without internet, without access to a specific server, and without any additional activation / license keys etc
any way to spawn an entity like this?
like what should I put the entity type for this?
https://hypixel.net/attachments/c8690991-d1aa-4eae-971b-2e79326b280d-png.2763481/
what was it
ops
like that
first 2 looks like armorstands
no I want to be a player or a npc!
so send a fake player
how?
?bing
Bing your question before asking it:
https://www.bing.com/
Google your question before asking it:
https://www.google.com/
interesting
no
Thanks, will give it a read
?bing
Bing your question before asking it:
https://www.bing.com/
All of those are zombies
Just zombies with armor
whilst I know this, it's still bs
Oh nice
You can use the base pon
But why you want to build it?
do minecraft servers generally have static ips or do some have dynamic ips?
to have all in 1?
static
static
to have 1 output jar
Oh ok
kinda got it working by having Core shade the other modules
just build the parent pom
but i dont get 1 output jar
i get one from each module
You cannot build the parent because its not a jar
Its type pom
oh well nvm
thats the way to go
now i cant get access to the core module in any other since i cant depend on core since core depends on the other modules to build and combine the jar
[ERROR] [ERROR] The projects in the reactor contain a cyclic reference
even though i put the scope as provided
a dynamic Server Would only Work Sometimes
i can create a module to just build it
when the DHCP Decides to Give you the same IP
You can attribute IP yourself
- DHCP is local
Yeah, it's Called Static
and i said the DHCP did you Just Assume is External? xD
Well i was lazy to read the previous conv so it's in case you wanted to open a server externally x)
Yeah for sure
ik but I wont be able to set custom mob speed
and stuff
Thrown when an entity creates an item drop.
kinda worded weirdly, does that mean that this event happens whenever a player or entity drops an item?
and which event would i use if i want to execute some code whenever a player presses the Q key and drops an item? PlayerDropItemEvent or EntityDropItemEvent?
https://i.redd.it/a2uo7echwn161.jpg
something like this
only the lost adventurer part
That event fires if ANY entity drops an item
it could be dragged from their inventory, pressed Q or a Piglin dropped it
ok thx
Yes you will
Just set attributes
i wonder why PersistentDataContainer#getOrDefault's default parameter is annotated with @Nonnull
doesn't really make sense
god but I did it for 1.8 and not 1.16
oh cringe lol
1.8 smooth 👍
smooth brain more like
Upgrade to latest lol
Latest is actually 1.19
Keep typing Alex
I also wouldn't do that. It's an old, outdated version
bro
for some reason
when a new version is out
the previous version is a bommer
There are people in the Minecraft community that are younger than 1.8 lol
*boomer
My brother in Christ 1.8 is like 8 years old
I use 1.6 o.o
that's how it works. once a new version is out, the former newest version is now an old version
it's a pretty easy logic
seems like quantam physics to me
hi elgarl
seems so, yes
The API keeps improving. So of course we always suggest you update. New features
like Attributes, that you want to use.
The fact that I’m at risk with interacting with a 14 year old in this server is an affront to my sanity
im -10 tho
So long as you don;t get your tallywhacker out, you should be ok.
tallywhacker is by far the worst word for dick that I’ve ever read
my brain
wait woeds raent balcksited hres
?
3 blocked messages lol
I hate how discord shows blocked messages anyway. It's way too tempting to read them
alr im out before I get the whole server to block me
Yeah like what’s the fucking point
yeah pretty stupid. There should be an option to not see them at all
I love how it's already 11 major versions behind. Like, more versions of minecraft were released since 1.0 after 1.8 than before 1.8 lol.
ohhhhhhhkay um
i dropped an item
why didn't this code execute?
public void onItemDrop(EntityDropItemEvent event) {
Bukkit.getLogger().info("entity drop item event fired");
}```
did you register the listener?
um
private final FileConfiguration config;
public PlayerDropItemHandler(HeavyWeapons plugin) {
Bukkit.getPluginManager().registerEvents(this, plugin);
this.config = plugin.getConfig();
}
// Removes effect if player drops item
@EventHandler
public void onItemDrop(EntityDropItemEvent event) {
Bukkit.getLogger().info("entity drop item event fired");
}
}
``` i think???
and you dropped the item using Q or similar, right?
it might be that you have to use InventoryClickEvent and check if the ACtion is DROP
maybe EntityDropItemEvent is only for "loot" of dying entities
show the code in your main class
FileConfiguration config = getConfig();
@Override
public void onEnable() {
// Plugin startup logic
config.options().copyDefaults(true);
saveDefaultConfig();
new PlayerHeldItemHandler(this);
new PlayerDropItemHandler(this);
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if(cmd.getName().equalsIgnoreCase("hvwreload")) {
this.reloadConfig();
new PlayerHeldItemHandler(this);
sender.sendMessage(ChatColor.GREEN + "HeavyWeapons reloaded successfully");
return true;
}
return false;
}
public FileConfiguration getConfigFile() {
return config;
}
}```
why are you creating a new listener everytime the command is run?
and why do you compare the command's name?
and why do you have a onCommand method if you never register the command?
damn ok lemme try to answer all those questions lol
- i create a new listener cause whenever i reload the config with the command the config reloads but fsr the material doesn't update within the code, so it doesn't actually update the item -- i remember you (or someone else) talking about config cache or smth so idk
- i kinda had no idea what i was doing most of the time trying to get the command to work so i tried following a bunch of tutorials online and they all seemed to do things differently, and people kinda gave really complex answers in the discord i couldn't understand because i'm stupid so i just tried something and it worked ig
- i mean i put it in plugin.yml and it seems to have an autocomplete feature in the chat? does that count as registering?? i know i didn't put a line in the onEnable() but idk, it works but probably not very cleanly
again this is my first plugin 😢
- I'm not sure but don't you have two listeners then, after reloading? A better solution would be to simply not cache the config object, then a simple reloadConfig() is enough
- If you do not register more than one command per commandexecutor, you don't need to compare the name. I mean it doesn't hurt to do so, it's just useless
- I am not sure whether getCommand("asd").setExecutor() is only needed when the onCommand method is not in the main class. So as long as it works, just ignore my third question
so instead of saving "config" as field in your PlayerDropItemHandler, just store the plugin in a field. And instead of "config.get(blabla)", do "plugin.getConfig().get(blabla)" instead
oh ok
the reason is that getConfig() always returns your cached config. If you do reloadConfig() however, you get a new config object. And your listener still keeps a reference to the old one, if you save the config object in a field
ah alright
but anyway, the listener should actually work
hm I just checked. Neither killing a pig nor pressing Q triggers the event for me
do u have correct @EventHandler annotation
sounds rediculous but ive had that happen several times
idk if there are any other ones in default spigot but with my own event system i confused it
i mean this is the entire code ```package heavyweapons.heavyweapons.handlers;
import heavyweapons.heavyweapons.HeavyWeapons;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDropItemEvent;
import org.bukkit.inventory.ItemStack;
public class PlayerDropItemHandler implements Listener {
private final FileConfiguration config;
public PlayerDropItemHandler(HeavyWeapons plugin) {
Bukkit.getPluginManager().registerEvents(this, plugin);
this.config = plugin.getConfig();
}
// Removes effect if player drops item
@EventHandler
public void onItemDrop(EntityDropItemEvent event) {
Bukkit.getLogger().info("entity drop item event fired");
}
}```
so i'm not sure what you mean
willing to accept any solution at this point lmao
but the other code i want to run in the end result doesn't execute so even if system.out works i'm not sure if it'll help 🤔
How would I write with packets to an open sign editor?
i want to have custom lines there
(no embed)
small brain me is confused again
do you mean this?
private final FileConfiguration plugin;
public PlayerHeldItemHandler(HeavyWeapons plugin) {
Bukkit.getPluginManager().registerEvents(this, plugin);
this.plugin = plugin.getConfig();
}
// Equipping or unequipping items via offhand keybind
@EventHandler
public void onPlayerHoldItem(PlayerItemHeldEvent event) {
Player player = event.getPlayer();
ItemStack mainhandItem = player.getInventory().getItem(event.getNewSlot());
ItemStack offhandItem = player.getInventory().getItemInOffHand();
Material configMaterial = Material.valueOf(plugin.getString("material")); ... etc etc```
really bad with java terms but at least it doesn't give me an error, tho i don't know if it actually did anything
i feel like it's the same thing but just with some names changed
no. don't save a FileConfiguration. Save a plugin instance
public class YourClass {
private final Plugin plugin;
public YourClass(Plugin plugin) {
this.plugin = plugin;
}
}
JavaPlugin > Plugin
Change my mind
normally you should reference stuff by the weakest type possible. But in this case it doesn't matter at all anyway, so I'd say JavaPlugin == Plugin in this case
I mean you also wouldn't declare a method to require an ArrayList if you could just require a List instead, would you?
👀
they only need the config and Plugin declares getConfig(), so no point in explicitly making it a JavaPlugin
whats the difference between the Plugin class and JavaPlugin I see people use Plugin sometimes and I don't get it
JavaPlugin is an abstract class, Plugin is an interface
oh okay
for example JavaPlugin has the constructor logic builtin. If you'd just implement Plugin you'd have to do that yourself
interesting
It usually depends what you need from it. 99% of people probably don't need JavaPlugin or even their PluginClass but they use it anyways 
I generally DI JavaPlugin as I never know what shitty code I'm going to write in the class in the future
it'd be stupid to change the variable for every project also it would invalidate utilities to use a specific main class
btw I also think that JavaPlugin doesn't provide ANY additional methods than what's in Plugin already anyway. So you actually never need JavaPlugin
Generally I spend 5h using reflection to fix an issue I didn't have to begin with when it comes to DI 
what would be even the reason to use Plugin instead of java plugin is there ever an instance where you'd need The most abstract version
it might happen that you sometime have a plugin that's not a javaplugin but only a PluginBase (https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/plugin/PluginBase.html)
declaration: package: org.bukkit.plugin, class: PluginBase
It's best practice usually
I have this code which is supposed to set two arrow's vector to be around one arrow to make a bow shoot 3 arrows at once:
arrows[1].setVelocity(vector.rotateAroundY(-50));```
I was wondering how to make them rotate vertically instead of rotate in the y axis. any ideas?
what the when I've never seen that before
as said, it's the same as List and ArrayList. in 99% of cases you'll be doing stuff with ArrayLists but still, why declare it as ArrayList if you don't use any ArrayList specific methods?
type should be as weak as possible because then you can use it in more cases
for example many methods where you'd think they require a String actually only need a CharSequence
it wouldn't make sense to specifically require a String if no String-specific methods need to be accessed
It's also good practice for when you start working with your own custom interfaces and such
does anyone have any idea?
what is a pluginbase and what are the aplicable uses for it
the description in the docs makes 0 sense to me
I don't know if anyone has ever used it lol
You'd have to dig through the CB source to see where it reads plugins from the plugins folder to register them. See if it handled PluginBase differently from JavaPlugin
the SimplePluginManager only uses "Plugin" all the time
everything else wouldn't make sense since PluginManager#enablePlugin etc also only require a Plugin, not a PluginBase or JavaPlugin
anyone? please
How would you access to a plugin instance if the plugin uses DI?
Throw Plugin Manager right?
use rotateAroundX or Z if Y isn't the correct one?
no, through DI
throw plugin manager? whut?
you can't DI inject it from the original plugin then so the questions doesnt really make sense
Because i used to use a static getter for main class. Now that I dont use any more I dont know how to access
Do I explain?
you can just get it from the pluginmanager of course
no, there you were talking about DI which you cannot do from another plugin
I tried that
if you get a plugin from the plugin manager, then you are NOT dependency-injecting it
DI is to pass references from one part of your plugin to another class you are instantiating
you are simply using the fact that it's a singleton
and that the plugin manager has the instance of it in a list
Oh allrgiht
maybe it's because the arrows are pushing each other?
So in fact for accessing plugin a from another plugin, which doesnt have a static getter we use Plugin Manager right?
help pls
D:\1.16.5>java -Dfile.encoding=UTF-8 -Xmx1G -jar spigot-1.16.5.jar
Unsupported Java detected (61.0). Only up to Java 16 is supported.
D:\1.16.5>pause
Press any key to continue . . .
Unsupported Java detected (61.0). Only up to Java 16 is supported.
how
"C:\Program Files\Java\jdk-8\bin\java.exe" -jar spigot-1.16.5.jar
thanks
Do note that's an example and copy pasting it won't work
o
any ideas please?
can u create the start command for me pls
one arrow above and one below?
you want one arrow to be left and one arrow to be right of the original arrow, or what?
We don't know where your java is installed
You need to find that yourself
why are you using 1.16 anyway? all newer versions support java 17 and later
I want 1 on the left, 1 on the right, 1 up and 1 down.
so diagonals
coz the plugin i am using isnt updated to 1.17 , 1.18, 1.19
okay then you'd have to get the direction of the player location, and then... you need math lmao
up and odwn in a line would be simple
it was extremely easy but I don't really remember how the math is supposed to work
yeah up and down is easy
but left and right requires some angles and stuff
I have this Vector vector = arrow.getVelocity(); arrows[0].setVelocity(vector.rotateAroundY(50)); arrows[1].setVelocity(vector.rotateAroundY(-50)); arrows[2].setVelocity(vector.rotateAroundZ(50)); arrows[3].setVelocity(vector.rotateAroundZ(-50));
which gets the bug in the video
yep x and z
@tender shard i need ur permission to sent photo
nope, you don;t rotate them
okay, you have my permission now
so what do I do
see dm
well its not that simple
"C:\Program Files\Java\jdk-17.0.3.1\bin\java.exe" -jar spigot-1.16.5.jar
thanks
its quite complex Math
are you sure? I could easily explain it in german
but ugh
how is this called agian
if you have a vector that is 90° aligned to the original one
how is that called in english
parallel
um, no idea if there is a single word for that
yep
hmm
just say its 90° i understand that
it's called Orthogonale in german
y this coming
so basically you need the direction of the eyesight vector. get the orthogonal vector of that and normalize it. then add this to the player location's vector. and that's it
perpendicular?
seems like ;-;
Only in 2D
what are u trying to do?
The mathematical term is Orthogonal
idk, there is no german word similar to that lol. but yeah, that looks like it's what I meant
yeah that's also the word that i remembered
two vectors are orthogonal if their multiplied result is 0
but erm how to calculate that... I need a pen and paper
my math classes are 10 years ago lol
think its something to do with a.b
and |a||b|
and cos theta
well cos 90 is 0
so hence why it's 0
It's the dot product
ah yes math
Given two vectors A [a1, a2...] and B [b1, b2, ...]
The dot product A.B is the sum of a1*b1, a2*b2, ...
so if the dor product is 0, it's perpendicular
Yeah if A.B = 0, A and B are orthogonal
i did math up to 3d vectors but dont recall seing that word
we just used perpendicular
weird thinking abt it now
although, the concept is the same
Perpendicular is only used in 2D, not 3D
Same concept but not the same things
Doesn't mean anything to say "90°" in 3D
this is all i could come up with
i doubt that it helps anyone lmao
fucking pq formula
sure it does
No x)
You have to specify the vector from which your doing the rotation
If I give you a vector and tell you to find a vector that is a rotation of 90°, could be infinite possibilities
hence why i said this
When you give a plane or a vector yes
Watch the video I linked. You already have teh Direction vector of the arrow, you can get the second vector by rotating the vector around Y by 90. That gives you the Plane.
do u want to make a "shotgun" effect?
where the arrows go out in a cone?
@harsh totem ur doing the correct thing. what ur doing wrong is vector.rotate(amount) and then vector.rotate(-amount)
the second one sets the vactor back to it's initial pos
use vector.clone.rotate
@humble tulip thank you it works now
hello neighbour
hello!
How do I kill an armor stand? (with spigot)
you also got this fucking zensus shit?
oh okay. I have to answer the doorin the next 45 minutes because I was "randomly chosen" to have to answer their fucking questions in person
Last time they asked me (about 6 years ago) I declined
maybe it wasn't zensus but a compareable organisation
like this?
private final HeavyWeapons plugin;
public PlayerHeldItemHandler(HeavyWeapons plugin) {
Bukkit.getPluginManager().registerEvents(this, plugin);
this.plugin = plugin;
}```
yes
hm my letter says I have to answer, otherwise fine up to 5000€ lol
nah 5000€ fine if you answer them wrong
I have 2 locations
They are placed so it forms rectangular shape
I just need to calculate each corner out of those 2 corners
corner1 being upper location
and corner2 being lower location
again 😄
you are my savior
So I had an interesting idea for a plugin and wanted to see if anyone knew if it was a thing or not before I looked into it.
**My Idea: **
Items dropped and respawned by a player (after death) can show up in loot chests in dungeons/structures later.
I was thinking about something like this while reading The Hobbit. I thought about how they found those old elven weapons and how that could be used in a SMP. Imagine you or someone else on the server dies at some point and they loose their stuff. Maybe some villager or zombie came along at some point and scooped up an old weapon and several days or months later, a player finds that weapon (with the same name and stats) in an old chest somewhere. Or possibly a zombie or skeleton has a chance of spawning with that weapon in hand? This would of course apply to other items as well. Just using weapons as an example.
Is there a plugin like this somewhere? Would it even be possible? What do you guys think?
if you don't answer it's just 300€
lol
?paste
possible but prob. hard
but sounds great!
wtf is an "allgemeinbildende schule"
a university?
omfg yees
thx
np
don't ask me lol
this is so stupid lol
heh probably copy pasted those numbers 😄
LOL
jesus LOL
is there an opposite event of ExplosionPrimeEvent which triggers when a creeper no longer ignites (player out of range)
l1 should be upper or lower ?
or it doesnt matter
doesnt matter
prefer clone methods than just a constructor with itself as a param
great
and u dont need to calculate which is lower
it's from an old project
dont even care to change it now
can I dm u ? again 😄
sure
how can i make creepers always explode?
this doesnt work because creeper.explode() triggers the same event again which then gets cancelled
@EventHandler
public void onCreeperIgnite(ExplosionPrimeEvent event) {
// Always explode after 1.5 seconds even if player left the radius
event.setCancelled(true);
if (event.getEntity() instanceof Creeper creeper) {
Bukkit.getScheduler().runTaskLater(plugin, creeper::explode, 30L);
}
}
I tried looking into how to remove arrows from a player with NMS
And I found this : ((CraftPlayer)p).getHandle().getDataWatcher().watch(9, (byte) 0);
It just canceled the player receiving any damage from the arrows and now it won't reset even if I reset the server
What can I do?
Why not use the API
I like the idea, maybe you could start with one of the "Death Chests" plugins and modify it
ok that works for identifying the creepers, however i just noticed that ExplosionPrimeEvent gets called when the igniting phase is over, not when it begins. is there a way to get an event when the creeper begins to ignite?
If it's possible I will do it, I didn't find a way to do it though
declaration: package: org.bukkit.entity, interface: LivingEntity
allgemeinbildende schule is another term for a general education school, i.e. a primary school or high school
Oh I'm using 1.8 so that wouldn't be possible for me, how do I cancel the player not receiving arrow damage though?
Yeah 1.8 is a nightmare 😅
Time to update
I would love to, but this plugin is PVP based so I have to do it
No you don't
we don’t need another pvp server
Like that?
if(e.getCause() == EntityDamageEvent.DamageCause.PROJECTILE && e.getDamager() instanceof Arrow && e.getEntity() instanceof Player){
Bukkit.broadcastMessage(e.getDamager().getType().toString());
e.getDamager().remove();
return;
}
You can disable attack cooldown on modern versions
well the plugin is not for me
and it was requested in 1.8
yep
It doesn't work😅
where do i download spigot
?bt
nope
separate if statements and debug each one
You're removing the entity so it won't damage the player
It does reach it because the print statement I put there does work
That's what I thought as well but for some reason it does
Wait so what's the issue
Canceling the event removes the knockback and the confirmation of hitting
That it doesn't remove the arrow
You need to use the modern MySQL driver
The one you're using is outdated an unsecure which is why it's being denied
i want to make a plugin that doesnt allow renaming items this is my code is:
`@EventHandler
public static void onInvClick(InventoryClickEvent event) {
HumanEntity player = event.getWhoClicked();
if (event.getClickedInventory() != null) {
if (event.getClickedInventory().getType() == InventoryType.ANVIL) {
if (event.getSlotType() == InventoryType.SlotType.RESULT) {
ItemStack item = event.getCurrentItem();
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(null);
item.setItemMeta(meta);
}
}
}
}`
the problem is that if the item is already renamed it renames the item to the original name, for example; i have an iron sword called "arkhalis" wich is a part of the plugin and when someone puts it in the anvil and applies an enchantment the item is renamed do "Iron Sword"
---- Minecraft Crash Report ----
// But it works on my machine.
Time: 6/23/22 4:28 PM
Description: Exception in server tick loop
java.lang.NullPointerException: Exception in server tick loop
at net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:406)
at net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:70)
at net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:406)
at net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:70)
at net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:406)
at net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:70)
at net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:406)
at net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:70)
at net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:84)
at net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:53)
at net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:43)
at net.minecraft.server.v1_8_R3.ChunkRegionLoader.loadChunk(ChunkRegionLoader.java:70)
at org.bukkit.craftbukkit.v1_8_R3.chunkio.ChunkIOProvider.callStage1(ChunkIOProvider.java:25)
at org.bukkit.craftbukkit.v1_8_R3.chunkio.ChunkIOProvider.callStage1(ChunkIOProvider.java:1)
at org.bukkit.craftbukkit.v1_8_R3.util.AsynchronousExecutor.skipQueue(AsynchronousExecutor.java:336)
im getting this error
i mean the server keeps crashing
any fx?
bruh feels the need to post it in every help channel
nah
?paste
discord message send limit
how do i spawn a custom entity, i made a class that extends Creeper but when doing world.spawnEntity() i can only give it an entitytype
come dm
?paste
oh
no
you basically can with a bit of messing around
i made a creeper class that has a custom event in it
you can use custom textures :P
Make sure this is actually the version being used ln the server
Doubt it
bro wait your so annoying
I was going to help but nah can't be patient
ik
Spigot server not MySQL
i was patient
in this post, they make a new class that extends the creeper and add an event call in between
how do i spawn that entity tho
Oh NMS entities
i want to make a plugin that doesnt allow renaming items this is my code is:
`@EventHandler
public static void onInvClick(InventoryClickEvent event) {
HumanEntity player = event.getWhoClicked();
if (event.getClickedInventory() != null) {
if (event.getClickedInventory().getType() == InventoryType.ANVIL) {
if (event.getSlotType() == InventoryType.SlotType.RESULT) {
ItemStack item = event.getCurrentItem();
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(null);
item.setItemMeta(meta);
}
}
}
}`
the problem is that if the item is already renamed it renames the item to the original name, for example; i have an iron sword called "arkhalis" wich is a part of the plugin and when someone puts it in the anvil and applies an enchantment the item is renamed do "Iron Sword"
um guys im patient? https://paste.md-5.net/setocunora.sql
why does every path i take lead to NMS
can u fix it? pls "pls"
You're not
Also I awnsered you in #help-server
oh
ok so i made it extend the NMS creeper instead, how would i spawn it?
Hey so i have a problem with my code :
for(Player players : Bukkit.getOnlinePlayers()){
User personalUser = new User(players.getDisplayName(), "alive", null, null, 0); //error is on THIS line
setUser(players.getUniqueId(), personalUser);
users.add(personalUser);
}
User class :
public class User {
private Role PlayerRole;
private String PlayerName;
private List<String> PlayerTags;
private Team PlayerTeam;
private Integer PlayerKills;
public User(String name, String tags, Role role, Team team, Integer kills) {
PlayerName = name;
assert PlayerTags != null;
PlayerTags.add(tags);
PlayerRole = role;
PlayerTeam = team;
PlayerKills = kills;
}
public void setKills(Integer kills){this.PlayerKills = kills;}
public Integer getKills(){return PlayerKills;}
public void setTeam(Team team) {this.PlayerTeam = team;}
public Team getTeam(){return PlayerTeam;}
public void setRole(Role role) {this.PlayerRole = role;}
public void addTag(String tag) {this.PlayerTags.add(tag);}
public List<String> getTagList(){
return PlayerTags;
}
public void setName(String name) {
this.PlayerName = name;
}
public String getName() {
return PlayerName;
}
}
PlayerTags is null
PlayerTags.add(tags);
Why did you hide the warning Intellij gave you with an assert 🙃
i dont get it i defined it up there
It's defined not initialized
It has no value
You cannot add stuff to a list that doesn't exist
So start by creating your list instance
ok i know how to fix it
Now this is a learn java moment
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
so... how do i fix this then? now the syntax at the beginning is different and i have no idea what to do now
intellij white mode warning
my cursor turns invisible against it 😢
getConfig is a method
so
()
ah aight
did you instanciate it
no you didn't why I bother even asking that
you have to instanciate the list
wdym yes i initiated my list did i do smth wrong while doing it?
my bad
my bad
my bad
com.naruto.lopversion.narutonew.NarutoNew.onCommand(NarutoNew.java:219) ~[?:?]``` whats on line 219
its fixxed it was a stupid mistake
everything worked out! tysm for the help!
alright so, i did this:
for debug i put a broadcast in there as well
but it doesnt get called when the creeper explodes
I recommend doing setPos before spawning the entity
Make sure that's the actual method that gets called when a creeper ignites
ignite is when it starts its count I believe
Yeah that's what they want
yeah it just doesnt get called
.
you mean the ignite method isn;t called?
Check the NMS class and see how it works
how can i tell if thats the thing that gets called
i mean i assume it is, because nothing else is called ignite
and spigot api uses this name as well
.
that doesnt really help
Check other behaviour not just that method
yes, there is nothing else in there that has anything to do with igniting
Don't have access to a pc so can't check for myself
ok hang on
i tried explodeCreeper() instead just to see if that would work
and it does
hmm ok
well thats not the behaviour i want tho
Does the Creeper have goals and a brain
If so check if it has a goal that would cause the ignite
idk doesnt look like it? what would that look like
i mean yeah it extends Mob
Yeah I'm looking for Creeper specific goals
You could override that method
And then create your own SwellGoal with the behaviour you want
keep getting this error
Cannot resolve constructor 'ItemStack(me.superischroma.spectaculation.item.SMaterial)'
@Override
public SEntityEquipment getEntityEquipment()
{
return new SEntityEquipment(new ItemStack(SMaterial.IRON_SWORD),
new ItemStack(Material.CHAINMAIL_HELMET),
new ItemStack(Material.CHAINMAIL_CHESTPLATE),
new ItemStack(Material.CHAINMAIL_LEGGINGS),
new ItemStack(Material.CHAINMAIL_BOOTS));
}
``` yes I know it should be Material.SOME_ITEM but I have added some custom items and I want to add it to the equipment part
whats the error and how do I fix it?
is there a way to get the axis a player is facing?
You awnsered it yourself
It needs a material
So convert your one to the regular one
but I dont want it to be a material
I want it to be a custom material which I made
which is SMaterial
Alright then you will need to start modding the Spigot jar
Basically make your own fork
so this wont work?
It won't
I mean, "custom materials" don't even work really
so I cant give mobs custom helm and stuff?
You can add amor to amor stand vía code?
How to i include NMS things like CraftLivingEntity with maven? my pom.xml looks like this
<project>
...
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<!--Spigot API-->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!--Bukkit API-->
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
or is there a better way to remove ai from an entity ( so they dont move around )
Remove Bukkit and change Spigot-API to Spigot
1.8
well
how do I get the values on the right?
sucks
tho, NMS isn't really needed
iirc NoAI existed in 1.8.8
just no API call
Yaw and pitch in the player location
Yeah
...
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
...``` just that?
Could not find artifact org.spigotmc
pom:1.8.8-R0.1-SNAPSHOT in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
Did you use bt?
Probably not
no
You need to compile spigot in order to use nms
?bt
It's for both
alright i think that is working now
next problem: how do i cast a my FuseCreeper into a org.bukkit.entity.Creeper, it says it cannot be cast
fusecreeper extends net.minecraft.world.entity.monster.Creeper
ok alternatively how can i make the goal not cancelable
is there a way?
OH SHIT IT FINALLY WORKS OMG
I already told you
i don't understand
Haven't seen you here in a while pulse
Get player location then get yaw and get pitch
what is pitch
no auto complete
kappa
get yaw or get pitch
thanks
How can I detect the shooter of a projectile when it kills a player?
Entitydeatheveny
Get the entity cast it to a projectile and call get shooter
On phone too :)
lmap
Sitting in the train lmao
nm, I thought you said on 🙂
Don't try to be funny
Yes sir
😩
how would i replace any creeper that spawns with my custom creeper
i am trying to do it in creaturespawnevent but i am getting stackoverflow errors
so i tried adding a pdc entry to my custom creepers to not make an infinite loop, but that doesnt do anything
if (entity instanceof Creeper && entity.getPersistentDataContainer().get(creeper_is_fusecreeper_key, PersistentDataType.BYTE) == null) {
Creeper creeper = (Creeper) entity.getWorld().spawnEntity(entity.getLocation(), EntityType.CREEPER);
entity.remove();
creeper.getPersistentDataContainer().set(creeper_is_fusecreeper_key, PersistentDataType.BYTE, (byte)1);
}
spawning an entity calls the event again
You call spawn before you set teh PDC
and since you don't modify the pdc until after it overflows
use teh spawn that accepts a consumer
so i have an enum called Role, how can i create a list containing all vallues of that enum
Enum#values()
set teh pdc in the consumer
uh ok that makes sense, however this isnt exactly the code i am using so i am not sure how i would do the pdc stuff first:
Hi, I am creating a plugin that allows a player to use a certain item and get a permission (tmc.hasthestone) and if they have the permission and they die they're items are kept just for that one instance until they get the permission back...how can I detect the player death? this is what I have in terms of detecting the player death
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event) {
Player player = event.getEntity();
ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
if (player.hasPermission("tmc.hasthestone")) {
event.setKeepInventory(true);
event.setKeepLevel(true);
String removestone = "lp user " + player.getName() + " remove tmc.hasthestone";
player.sendMessage("Inventory and Levels Kept.");
Bukkit.dispatchCommand(console, removestone);
}
}```
does that command actually work?
you know what, just set a boolean flag in that class. Set it before you add your creeper to the world, then in the start of the event reset it and return if the bool is set.
yes it gives the permission
isnt it -> lp user name permission unset permission.node
ohhh ok
is the death not recognised?
yea it isn't recognised at all
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event) {
System.out.println("player died");
Player player = event.getEntity();
ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
if (player.hasPermission("tmc.hasthestone")) {
event.setKeepInventory(true);
event.setKeepLevel(true);
String removestone = "lp user " + player.getName() + " remove tmc.hasthestone";
player.sendMessage("Inventory and Levels Kept.");
Bukkit.dispatchCommand(console, removestone);
}
}
try that
see if you see player died in the console
alrighty
I always make a listener class and do a lot of work in it and forget if I ever registered it, so I put it on my server and then get irritated when I find out I didn't register the class kekw
nothing
did you register your listener?
actually i just realised i can do this:
if (entity instanceof Creeper && !(((CraftEntity)entity).getHandle() instanceof FuseCreeper))
ye u can do that too
Yes I thought I did and then I skimmed the code to find I spelt something wrong...pain of coding
now lets see if it magically works
yep it works but problem is my items are still kept
do I need to set the event.setKeepInventory(true); & event.setKeepLevel(true); to false after?
ill try that
what's the convention for display commands with different params depending on the first param
like this is what i have right now
§cUsage: /<command> <add|remove> <player> §7OR §c/<command> <list> [page]
Ok I have a problem where it drops the items and XP when I die but still keeps the items in my inventory when I dont have the permission
wait a creeper and a exploding creepere are different entities?
I'm trying to make a command that takes a player's username as an input, even if they aren't online
i need to get the UUID from that player name
set dropped xp to 0
and do event.getDrops.clear
event.setDroppedExp(0)
which means i may need to use Mojangs API and use caching and stuff. Is there a library to automatically handle this?
@ornate patio can't you just do getPlayer? It's deprecated because using names means they could'Ve changed
but it does have the uuid
now this would be for when I don't have the permission correct (the else)?
i guess
it doesnt sound reliable thogh
no
this would be for when u do
oh well the problem is happening when I don't have the permission it still keeps items.
what that wants to say is that players can change their names. The only reason it's deprecated is that unlike getPlayer(uuid) it can return the wrong player
send ur code
the updated code
if for example i do something like /teleportonlogin <name> and two players switch names before rejoining
it'll hit the other player
got it
@EventHandler
public void onPlayerDeath(PlayerDeathEvent event) {
System.out.println("player died");
Player player = event.getEntity();
ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
if (player.hasPermission("tmc.hasthestone")) {
event.setKeepInventory(true);
event.setKeepLevel(true);
String removestone = "lp user " + player.getName() + " remove tmc.hasthestone";
player.sendMessage("Inventory and Levels Kept.");
Bukkit.dispatchCommand(console, removestone);
} else {
event.setKeepInventory(false);
event.setKeepLevel(false);
}
}```
which could be an issue
well getoffline was always an issue
just wondering if there was a library to automatically handle mojang requests and stuff
the only thing i see that needs to be done here is when u set keep inventory, you clear the drops and when you set keep level, you set the num of dropped levels to 0
what kind of stuff.? Getting UUID, skins, .. ?
getting UUIDs from player name
so event.getDrops.clear and event.setDroppedExp(0) would be the two?
with caching also implemented so theres a less chance of hitting the rate limit
the two what?
there's this
the two lines I need to add in the setting keep inventory
ur gonna have to cache yourself
yeah
ok
also print a message in the if saying "keeping inventory"
and "not keeping inventory" in the else
yeah but im also looking for automatic caching
not hard to cache stuff
yeah but im lazy
just put it in a map for x amt of time
ill worry about it later ig lmao
can u make an inedible item edible?
doubt
for sure with texture packs u can
using edible items ofc
wait, is eating handled by the client or the server?
well now another problem has arrived...it always thinks I have the permission when I don't
is the command correct?
see what the console says
console will say wheter the command was executed successfully
the command does work
Client side
welp that answers that question
can u send a pic of ur console when u die?
But it still sends the beginning of the animation
However you can just send the packet of eat without playing the animation it will work
well they disabled media sharing apparently but ill send u a url yes
ur not verified that's why
from where to where?
when I did it at the top it said I have the permission and then after when I died twice it said I dont have it
I can do a screen recording for an example if you'd like?
@agile anvil can you elaborate on the packet?
Im moving blocks on which players are standing
How do I move the player seamlessly so they don't fall down but move together with those blocks?
?paste
current code:
https://paste.md-5.net/izodupikob.cpp
check honey blocks
but it doesn't work how I imagened it to
no need
try with luckperms
lets say its a giant ship
see how that works
or do u mean source code?
would you be "moving" the honey block?
or unsetting it and setting it somehwere else?
unsetting and setting
u can try and see if it works
WorldEdit
I paste schematic, after second i Undo paste
and paste again
private void doSlideMovement(Entity var0) {
Vec3 var1 = var0.getDeltaMovement();
if (var1.y < -0.13D) {
double var2 = -0.05D / var1.y;
var0.setDeltaMovement(new Vec3(var1.x * var2, -0.05D, var1.z * var2));
} else {
var0.setDeltaMovement(new Vec3(var1.x, -0.05D, var1.z));
}
var0.resetFallDistance();
}
``` this doesnt help me tho
why not?
it does
i mean you got to have the vector wheree you move to
what does even var0 and var1 mean?
why would that make a difference
.......learn to read
oh then it makes sense
idk maybe a lightperms bug
here look at the video, I show that it says I have no perms after.
could be a lightperms bug
use luckperms
well just try and see
if it's a lightperms bug, u can report it to alex
couldn't I just do Location newLoc = shipNewPos.subtract(player.getLocation)); ?
try just tping the player
shipnewPos.clone.add(shipOldPos.clone.subtract(player.getLocation))
that's the new player loc
ye thx
it is not a lightperms bug..just tried.
calling location methods modifies the location, hence the suggested clone, and that gives you the vector from old to new position, but not the actual new position iirc
oh right
any ideas on what to do?
Well I don't find the "start" packet sent by the client, but it seams to have changed.
Now the end of the animation is managed by the server.
So
- Player starts eating and send : Idkpacketname x)
- Server receive, count the correct time, send EntityStatus packet with status 9 (end of action), update food and items
I want to make a sort of gui that like, two players can see at the same time
what would be the best way to update both guis?
Yea
x)
lessgo
@humble tulip problem solved...I am very dumb... I have OP which means I HAVE ALL PERMS SMH
ily
does the client send a packed when it stops the eating animation prematurely?
It should, have to find which one
eh im just asking to know
if im doing something i'll have to make a runnable anyways
and giving that one information or stop it is annoying
Hello ! Someone know how I can did a "machine". I would like do a loop that do something when block (exp = cauldron) with an special NBT make something on all chunks loaded
I already use NBTAPI
there's a onChunkLoad event. No idea how to use that api tho
just loop through all chunk coordinates and check the blocks
onChunkLoad check all block in ?
Hmm ok
THx I will see un Spigot API what I can do 🙂
It's not more opti to save coordonate on pose Him and get the coordinate in save file rather than check all block in chunk loaded ?
cause check all block in loaded chunks with 100 players that will lag no ?
actually 10
But it's default
I will change this to 4 or 6
But it's same problem
I don't want create tps drop X)
yea scanning around a billion blocks at once will cause lag
is your plugin the one responsible for that nbt data?
If you are the one who "create" these machines, it's 10000000x more efficient to just save their coordinates
Yes it is
Ok ok, so i save coordinates in yml file for exemple and onLoad plugin I input all "machine" in Map ?
uh no
doing that has the issue of you registering unloaded blocks
thats unnecessary overhead
save the locations of those blocks in the chunk file
You can also save all coordinates in a yml files, and load them if they're in the chunk that is loaded (ChunkLoadEvent)
Or save them in the chunk file, but it will be harder to catch them all if you want a quick erase of data
guys
what is the int for waterColor
https://cdn.discordapp.com/attachments/902581430268362752/989614733101514762/unknown.png
what's PDC ? 😅
what kind of color code is it
?pdc
Persistent Data Container. Entities, Chunks and Items have it
blocks have not
Ok ok
theres a library that emulates that by stuffing pdc into chunk pdc
i think mnfalex made it
Where does this code from?
but the 1.8.8 version didn't have that no ?
nms biomefog
could be a 1.13 thing
Save coords in a yml file, that's the best way
You're trying to change the water color right?
Ok ok, I need stock temp "machines" in a Hashmap ?
yes and i can but idk what it is based on actually
For don't call the configuration file everytimes ?
Nice Club penguin avatar :3
Depends. If you have to do some regular stuff on your machines (other than just checking if it's a machine when a player interact for instance), I recommend you to load your machines on memory. To avoid overload, listen to ChunkLoadEvent and check in your config file if one or more machine are in the chunk, then load it
If it's just an interact stuff, don't load your machines, just give them an NBTTag, and check each time a player interact that the block has the NBT of the machine
Well, I'm not an expert on 1.13+ versions, but I think that the water color of a biome is client side
It's hex RGB
true true
algae
letters
Yeah
Hex are numbers, 0-9a-f
can u try to set the color to #ffffff and make a screenshot
i want to see what happens
DUDE
NICE
if wromg colour
Did you do that server side ??
yes
Location location = player.getLocation();
BiomeFog fog = ((CraftWorld) player.getWorld()).getHandle().getBiome(new BlockPosition(location.getX(), location.getY(), location.getZ())).l();
Field c = fog.getClass().getDeclaredField("c");
c.setAccessible(true);
c.set(fog, Color.RED.asRGB());
Well that's good to know thanks !
Try with "fcc203"
or to single parts of it
I'd like to affect a specific area of blocks
Seams like it's biome related, maybe you should change the color of a specific (or new) biome, and change all the blocks of water to that biome
?
could i declare an area of blocks a new biome then?
Or 16 564 739
does that work?
giving hex inputs decimal numbers
Yeah, you can even change only one block
piss
lmao it works
wrong game sniper
nice to know. I plan on doing some visual stuff and using water seems like it might be interesting
particles cause
um
lag?
i cant send out more than 40k particle packets before it MASSIVELY delays them
chops them up for some reason
it loads half of it
40k per second ???
OMG x)
i mean a packet is what
can u share how u did this?
60 bytes?
It's almost a DOS in that case
well the issue is probably my router anyways
unfortunately for smooth curves i need a buttload of particles
Seams way too big
im using the colour change particle
since thats nondescript and can be assigned a colour
Location location = player.getLocation();
BiomeFog fog = ((CraftWorld) player.getWorld()).getHandle().getBiome(new BlockPosition(location.getX(), location.getY(), location.getZ())).l();
Field c = fog.getClass().getDeclaredField("c");
Field f = fog.getClass().getDeclaredField("f");
f.setAccessible(true);
c.setAccessible(true);
c.set(fog, Color.PURPLE.asRGB());
f.set(fog,Optional.of(Color.PURPLE.asRGB()));
1.17.1
oo nice
doesnt really matter too much