#help-development
1 messages Β· Page 2254 of 1
Help pls
minecraft:stone_bricks is the namespace key
ohh i see
if ur doing forge modding
it would be
urmodname:custom_item
everything in minecraft has a key
minecraft:stone_bricks
^^^^ ^^^^^^^^^^
name key
space
can i change the tracking range of specific entities at runtime?
I'm not certain there is api for this but if you dig around nms I think you should find something
By tracking range what do you mean. Are you talking about agro range?
That's agro range
Lol okay yea you can change that with nms
There are apis that make thag wider too
plss help
?learnjava
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.
you've obviously just copied this from a tutorial
Hello, I've been trying to get player's group from the plugin GroupManager. Before explaining, I do not wish to use LuckyPerms due to very bad experience... unless it's my last solution.
Anyway, I had multiple ways to get a player group, and all worked perfectly + my plugin works fine.
But out of no where, Essentials X (Chat) is crashing and cannot synchronise the chat anymore which results in the loss of chat formating (prefix/suffix).
At first I thought it was because my plugin was sending commands on the console, so instead I went with Group Manager files/configs.
But somehow, EssentialsX Chat is capable of detecting any interaction I am doing with Group Manager and crash upon it.
org.bukkit.event.EventException: null```
For exemple, I wrote a line to get GroupManager plugin from Bukkit and just that crash the chat formatting:
`Bukkit.getPluginManager().getPlugin("GroupManager");`
My only solution now is to get the users.yml file by hand with a string path. But I am not quite sure it's gonna be responsive whenever a player change groups.
It's probably a server related problem or Essentials version, but I changed servers and version quite a lot and nothing.
If needed
Any help, suggestions or fix solutions would be appreciated.
can you provide more of the stack trace
Surely
org.bukkit.event.EventException: null
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:303) ~[forge:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[forge:?]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[forge:?]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:588) ~[forge:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:570) ~[forge:?]
at net.minecraft.network.play.ServerPlayNetHandler.chat(ServerPlayNetHandler.java:1758) ~[?:?]
at net.minecraft.network.play.ServerPlayNetHandler.func_147354_a(ServerPlayNetHandler.java:1686) ~[?:?]
at net.minecraft.network.play.client.CChatMessagePacket.lambda$handle$0(CChatMessagePacket.java:35) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
at java.lang.Thread.run(Thread.java:832) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "org.anjocaido.groupmanager.GroupManager.getWorldsHolder()" because "this.groupManager" is null
at net.milkbowl.vault.chat.plugins.Chat_GroupManager.getPlayerPrefix(Chat_GroupManager.java:272) ~[?:?]
at net.milkbowl.vault.chat.Chat.getPlayerPrefix(Chat.java:67) ~[?:?]
at net.milkbowl.vault.chat.Chat.getPlayerPrefix(Chat.java:91) ~[?:?]
at com.earth2me.essentials.perm.impl.AbstractVaultHandler.getPrefix(AbstractVaultHandler.java:51) ~[?:?]
at com.earth2me.essentials.perm.PermissionsHandler.getPrefix(PermissionsHandler.java:88) ~[?:?]
at com.earth2me.essentials.User.getNick(User.java:484) ~[?:?]
at com.earth2me.essentials.User.getNick(User.java:443) ~[?:?]
at com.earth2me.essentials.User.setDisplayNick(User.java:509) ~[?:?]
at com.earth2me.essentials.EssentialsPlayerListener.onPlayerChat(EssentialsPlayerListener.java:188) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) ~[forge:?]
... 12 more```
Similar stack trace happens with other lines of code, this is one of few examples
"this.groupManager" is null
looks pretty clear to me
What exactly are you doing on your end to group manager ?
Yea but it is vault failing there
Yes but no, I added a groupManager variable days after this issue
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Mate, your question is literally "pls tell me what imports I need because I am too lazy to figure it out"
the plugin variable you reference is just never defined as a field
This might be the reason, but I installed Vault after that issue so I don't know, but I could try
Cannot find symbol variable plugin
Let your IDE import the packages
Basically, I try to get user's group and depending on it, I give the player various effects. My plugins works fine, it's just the conflict with EssentialsX
Wdym, exactly?
Did you add all dependencies like Spigot?
if vault properly hooks, you should see a info log in your console
Are you depending on GroupManager?
Nope
Yeah
This is why I am confused
why the fuck does vault not add group manager as a soft dependency
Well then everything works.
Probably not, I installed Vault after this issue but I don't have any knowledge on Vault utilities/uses
data.save(new File(plugin.getDataFolder(), "cards.yml"));
you need to pass in the instance of your JavaPlugin for plugin
How?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
?learnjava
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.
Well, I presume if vault doesn't hook group manager then yea, you are fucked
I will try to fix Vault issue and see if anything will change
does vault hook it without your plugin ?
Anvil inventories are not linked to an actual anvil block iirc. What you can try:
Get the inventory holder and check if its a BlockInventoryHolder. But i feel like this wont cut it.
Wait where is the anvil question? Did they delete it?
Seems like it yeah
Have i been deceived?
Gross the UK
best way to remove everything from the arraylist?
list.clear()
Loopp through every element and remove it one by one clear is for beta males
But you should very rarely need to clear a whole list...
every 5 minutes
Wha wha why π₯Ί
Concurrent modification exception:
Just catch ignore it and continue that is the sigma male mindset
Bump
It only matters if my code works not how I achieved it to work
Ah. What you need is a BlockIterator. Let me show you an example.
I'm working on a plugin that requires me to use player#sendBlockChange() but when I right click the block it disappears. Is there a way to prevent this from happening?
public List<Block> getBlocksBetween(Location locA, Location locB) {
Vector direction = locB.toVector().subtract(locA.toVector());
int distance = (int) Math.floor(direction.length());
Vector start = locA.toVector();
double yOffset = 0D;
BlockIterator iterator = new BlockIterator(locA.getWorld(), start, direction, yOffset, distance);
List<Block> blocks = new ArrayList<>();
iterator.forEachRemaining(blocks::add);
return blocks;
}
When they interact you need to send the block change again.
You can also intercept the block packet.
Thank you, and now if I wanted to connect a whole list like this π
Hello there. Is there a way to modify server's code without using reflections and custom spigot fork? I used Mixins before, but I can't find a way to use Mixins with spigot
You mean like several lines hooked together?
Fork spigot or inject bytecode. No other way.
is it possible to convert an object into an arraylist whilst keeping it sorted?
^
Arrays.sort(sortedvalue, new Comparator() {
public int compare(Object o1, Object o2) {
return ((Map.Entry<String, Integer>) o2).getValue()
.compareTo(((Map.Entry<String, Integer>) o1).getValue());
}
});``` i have this
tyes
how make it arraylist
the sortedvaloue
I have a list of blocks that i m creating a cave from, now i need it to be connected by this co it would be continous, i need to connect list.get(0) with list.get(1), then list.get(1) with list.get(2) etc.
One moment
Honestly you would be better off with a 3d cave noise algorithm.
Hello guys, is there an event to check if a trade with a villager was successful - to change the xp you recieve on trade
Thats what im using, but the perlin noise generator makes spaces between blocks and idk why
Check online if theres a even for trading, there might be what youre looking for
Okay, i sent you friend request, can sent you what i currently have but im not on a pc rn, have to go now, thanks though
Couldn't find an event for this... so would inventoryCloseEvent be the right thing? Even tho I would need to cancel dropping xp somehow
public List<Block> getBlocksBetween(Location locA, Location locB) {
Vector direction = locB.toVector().subtract(locA.toVector());
int distance = (int) Math.floor(direction.length());
Vector start = locA.toVector();
double yOffset = 0D;
BlockIterator iterator = new BlockIterator(locA.getWorld(), start, direction, yOffset, distance);
List<Block> blocks = new ArrayList<>();
iterator.forEachRemaining(blocks::add);
return blocks;
}
public List<Block> getChain(List<Location> locations) {
Preconditions.checkArgument(locations.size() > 1);
List<Block> blocks = new ArrayList<>();
Location locA;
Location locB;
for (int i = 0; i < locations.size() - 1; i++) {
locA = locations.get(i);
locB = locations.get(i + 1);
blocks.addAll(getBlocksBetween(locA, locB));
}
return blocks;
}
You could do much better with bΓ©zier curves in a discrete space.
But that a bit of math.
private static Location point(float t, Location p0, Location p1, Location p2) {
float a = (1-t)*(1-t);
float b = 2*(1-t)*t;
float c = t*t;
return p0.clone().multiply(a).add(p1.clone().multiply(b)).add(p2.clone().multiply(c));
}
private static Location point(float t, Location p0, Location p1, Location p2, Location p3) {
float a = (1-t)*(1-t)*(1-t);
float b = 3*(1-t)*(1-t)*t;
float c = 3*(1-t)*t*t;
float d = t*t*t;
return p0.clone().multiply(a).add(p1.clone().multiply(b)).add(p2.clone().multiply(c)).add(p3.clone().multiply(d));
}
// quadratic Bezier
public static List<Location> curve(Location p0, Location p1, Location p2) {
List<Location> points = new ArrayList<>();
for(float t = 0; t < 1; t+=0.007)
points.add(point(t, p0, p1, p2));
return points;
}
// cubic Bezier
public static List<Location> curve(Location p0, Location p1, Location p2, Location p3) {
List<Location> points = new ArrayList<>();
for(float t = 0; t < 1; t+=0.007)
points.add(point(t, p0, p1, p2, p3));
return points;
}
just dropping this in
anyone got an idea on this?
Nice this looks good. Just for the guy doing caves: This is not a discrete curve so you cant really use this.
But for particles this is surely nice
I also tried searching it, but couldnt find it.
You could check if the inventory in InventoryCloseEvent is a MerchantInventory,
but that doesnt guarantee you a successful trading.
And I also dont know if the Inventory closes if you trade with a Villager
prob not
yeah i originally did this for tracking shots
but never continued
maybe it helps, maybe it dont
hmm like the core thing is changing the xp getting from a trade. Some overall "getting xp" event also doesn't exist if I am correct, so unsure how to approach this problem
this message is about the bezier curve topic I think
but for a discrete curve a bspline or catmullrom spline would fit better
tha fk is a catmullrom spline?
oh yea, I meant to reply on your message
there is a PlayerExpChangeEvent
but there is no REASON Enum or smth
so it could be any source
puh that's hard
its different in Paper API
so I would need to check with interact event, when a trade starts, check via invcloseevent when it's canceled / done and if xp changes, I would need to cancel it then
there is a getSource method which returns an entity which can be null
there is also a PlayerTradeEvent in Paper
but ig you are using Spigot
I am using spigot in this case :c
yea then no idea
what does the R in for example v1_16_R3 stand for? I know there's different versions of the nms packages, but I don't know what the R stands for. Release?
Probably stands for Release. Possibly Revision
It's not consistent with the game though. I think 1_16_R3 covers versions 1.16.4 and 1.16.5
yep, thanks
Is it possible, using Scoreboards, to display a string in the player list rather than an integer??
Could you be a little more specific? Strings on the scoreboard, or strings in the tablist?
Cause both are possible.
It's just that, with the scoreboard, you can't remove the numbers on the right side. You can change them, but you can't remove them.
Yeah I meant the numbers on the right side, if it was possible to use a string instead
I wanted to display which world the player was in on the right side, but I suppose that's not possible then
Yea, those numbers are used for the ordering of values. They can't be anything other than an integer. Although, it's been that way for a long time now. Not sure if it's for a specific reason though. Mojang makes some weird decisions sometimes.
I just can't be bothered with using the protocol to make a custom tab list, so I was hoping there was an easier solution lol
I guess not
[19:54:15 WARN]: java.lang.NullPointerException: Cannot invoke "org.bukkit.block.BlockFace.getOppositeFace()" because "this.mainFace" is null```
possible to get the highest block to spawn an entity at a certain x z
trying to find the safest spot to spawn an entity at a certain x and z
Hey, does anyone know how to fill a falling barrel?
With command it would be something like this:
/summon falling_block ~ ~ ~ {BlockState:{Name:"minecraft:barrel"},TileEntityData:{Items:[{Slot:0b,id:"minecraft:bow",Count:1b}]},Time:1}
Get the ItemMeta and cast it to PotionMeta. From there you can get the potion effects.
Some people have been getting this error when entering my commands. Anyone know what its about? A quick google search turned up nothing really.
"Out-of-order chat packet received. Did your system time change?"
Appearently they get kicked with this message
Sounds like a 1.8 problem to me. They had a different approach to TCP
the server is on 1.19
Do you have any anti cheats?
if (fallingBlock.getBlockData() instanceof TileEntityBarrel barrel) {...
doesn't work
That is not my server, I just got a report of staff members getting kicked when entering a command.
Yes because the BlockData is not a BlockState. Those are different things.
ik, but falling blocks don't have a blockstate
and I need TileEntityData not BlockState
So i thought that would be the closest one :D
I dont see a way to do this with the api...
That's why I tried casting it to TileEntityBarrel. But I actually don't have an idea what of the falling block I have to cast
Are you fine with using nms?
yessir
One moment
I think I'll just write this problem off as "not mine"
Maybe protocollib. Or an anti cheat. idk
I dont use protocollib, the anti cheat is possible as I dont think ive ever seen that error message...
i've spent 4 hours trying to copy the villager ai onto the horse
to make it smarter
i finally figured it out
getAttribute(Attributes.FOLLOW_RANGE).setBaseValue(100); this is literally all i needed to do
why when i spawn a falling block like this, it won't show anything until it lands ?
it lands fine
what I do is updating the TicksLived every tick to 1
till it lands
idk if that's the best solution tho
Either implement a custom FallingBlock or use a scheduler.
But why do you want to do this?
Sounds weird... what version?
1.17.1
Have you tried other types like stone?
it has to be chest
Try stone
like how other envoy plugins work with chest
Usually they just mount a chest on an ArmorStand and let it descent.
I figured it works with vanilla commands and I was too lazy to just fill it when landing :)
Yeah its kind of hard because you would need to manually serialize a CompoundTag...
you can also use a barrel
Usually they just mount a chest on an ArmorStand and let it descent.
too lazy to do that
figure out when it lands
do all the maths and shit with the gravity
nah im better with OAK_WOOD
Then you need to tag the falling blocks PDC or put it in a Set (or map) so you can replace it in the EntityChangeBlockEvent
You should never detect custom items by lore or their name.
Always go for data inside the PDC
?pdc
ItemStacks can hold persistent data
is there any event called when a dragon heals using the crystals ?
PDC is more modular and safer regarding modifications. (Other plugins might allow the player to change the name or lore of an ItemStack)
Its just overall the cleaner approach.
EntityRegainHealthEvent
Its for every time, any entity regains health
bump @lost matrix
Full stack trace?
Banned
idk. Do you use a VPN?
nah
tried in incognito and it works there
even logging in
ah now it works again idk what was going on
too long, cant send, but points to this>
BlockIterator iterator = new BlockIterator(locA.getWorld(), start, direction, yOffset, distance);```
You paste it
?paste
i want to make a particle force but i need to do data and stuff but i dont wanna add any datat to the particle so how would i do that? its not letting me add null as.getWorld().spawnParticle(part, as.getLocation(), 2, 0, 0, 0, null, null, true); ```spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force)
@lost matrix
1.8 ...
and?
anyone? how can i skip out on using T data
This version is ancient and full of bugs. Support was dropped years ago. The community is vanishing.
If you need support for horribly old software then you need to go and dig in old forum posts from half a decade ago.
I just want to point out that the same things is for 1.19 so its your code that isnt working
Nope. You've seen the test. Works like a charm. Check the "distance" in getBlocksBetween(Location locA, Location locB)
Sysout the variable and tell me the value right before the crash.
And just so you know this is happening in populator, so the chunks are only loading when this is happening
You cant use a BlockIterator withing a chunk generator... there is nothing to iterate. The chunk is just being created.
Distance: 1
So, what should i do?
Do you want vanilla caves or custom ones?
Then let your generator generate vanilla caves.
I use only populators
Otherwise you would need to implement something called "perlin worms"
I have that, but as it is said, it only creates this
I cant attach files
But essentially its a spread of block with no connections in between them mostly
@lost matrix
are you cancelling the break event and setting AIR yourself?
Why are you setting air in BlockBreak if you are not cancelling?
Seems a pointless effort
then you are in the wrong event
Cancel this event for Stone/Cobble https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/block/BlockDropItemEvent.html
That way only cobble is stopped from dropping yet the tool will still be damaged
yep
how to get chunks between 2 coordinates
in that case don;t set AIR just getDrops().clear()
@eternal oxide
Math
you only need the X and Z of your two Locations
thx
he he, question, if i want to ask questions about a bukit plugin, is here the place to ask them?
If that doesn;t work does BlockBreak have the setDropItems in 1.8?
If you are a dev workign on a Plugin, Yes. If its a question about using a plugin #help-server
no no, i am a dev
okay, thnx, i dont have question now, but i like to know where to go if something goes horible worng XD
Just set it on fire and walk away
i wish XD
Update to a modern version π¦
hello
i wanted to do something like when you right click an item and the item is a nether star with name and lore and it says i couldn't pass event PlayerInteractEvent to plugin
code?
?paste
Full exception pls
Im suspecting a nullpointer as usual
You can register a recipe only once.
Npe
Registering the same recipe multiple times is illegal
i did not
The exception tells us otherwise.
Also ur code says otherwise too
If you right claim a nether star it creates a new recipe
Also
Sure but you are registering it again for no reason.
where
Why not register it on enable
dunno
Every time any player clicks, you are registering the recipe again.
thatβs a compile error
Does anyone have a good config file tutorial, that includes creation, modification, multiple files, etc...
you are trying to use it in a different method
then i have to make it public?
no
add a persistent data container to the item with an id of βheartβ or something
then check the items pdc in the oninteract method
You learn by facing hardships
?pdc
Hello all, looking for a dev for a server I am a part of, more than willing to give a full tour of it π
Programming will always lead to problems that you have to solve. And you learn a lot by doing so. Don't give up. It's fun to solve problems
two links right above
There's always room for improvement :) Or maybe you got a friend that can help you who got more experience
im 11 -__- my friends dont code
Programming takes a lot of time
docs *
ikr
you should start from youtube tutorials of java
adding a PDC flag to the heart is not the easiest way to do it, but it is the proper way
pretty sure you'd have to add the PDC when its crafted not in its recipe.
especially for NMS
It may work in the recipe, I've never tried
Someone got and idea why "event.getDamager().remove()" doesn't remove instance of Arrow in EntityDamageByEntityEvent ?
try getting entity instance inside final variable
and executing new task via bukkit scheduler after 1 tick
Entity entity = event.getDamager();
new BukkitRunnable() {
public void run() {
entity.remove();
}
}.runTask(this.plugin);
im not sure if this would work but you can try
so I'm trying to make a kinda simple algorithm that returns an x, y, and z from a single number but i can't really wrap my head around it, i'll try my best to explain
thanks i'll try
do you want to compress x,y,z into one variable?
Cantor pairing can map two integers into one unique integer, or more integers if steps would be recursively repeated
and you can remap those values into two values by reversing the algorithm
but it only works for smaller values, since you can easily reach int 32 bit limit
ItemMeta heartmeta = heart.getItemMeta();
NameSpacedKey key = new NamespacedKey(this, "hearta");
heartmeta.getPersistentDataContainer().set(key, PersistentDataType.BYTE, (BYTE) 1);
heartmeta.setDisplayName(ChatColor.RED + "" + ChatColor.BOLD + "SERCE");
heartmeta.setLore(List.of("Daj to adminowi jak chcesz dostaΔ dodatkowe serce." + " Nick admina: NG5M"));
heart.setItemMeta(heartmeta);
ShapedRecipe recipe = new ShapedRecipe(key, heart);```
I start off with a single block, which is the origin. If i input the number 0, it should return the origin coords, (0, 0, 0)
If i enter the numbers 1-26, it'll go over a list of blocks that surround the origin. For example:
1 -> 1, 0, 0
2 -> 1, 0, -1
3 -> 1, 0 1
4 -> 1, -1, 0
... and so on until all blocks around the origin have been covered
Then, when I reach number 27, it should start searching the next "layer". For example:
27 -> 2, 0, 0
28 -> 2, 0, -1
29 -> 2, 0, -2
.. and so on
I want this to repeat until it searches all blocks within a 20x20x20 cube around the origin
didn't work :(
is there a packet for clicking a button in 1.8.9
gui button?
or normal one
like stone button, wooden button
maybe interact packet
yeah apparently that's not a thing
cannot resolve symbol
yes, because you have to also change the way you detect it in your click event
Use a container object
And set it as a parameter
bruh how
huh
the closest thing I can find is Animation packet which gets invoked when player punches his fist
by getting that fist packet you can raytrace
Use a container for 3 numbers x, y and z then in your method take take container apart
What version of spigot is for 1.8 development ?
and see if in front of him there is a button
1.8
its unsupported. Spigot for 1.8 is abandoned dead codebase
what if they just punch it and not activate it
then bukkit better ?
Bukkit is an API
hello ππ
ItemStack item = event.getPlayer().getInventory().getItemInMainHand();
If (!item.hasMeta()) return;
if (item.getPersistentDataContainer().has(new NamespacedKey(plugin, "hearta"), PersistentDataType.BYTE) {```Or something close.
1.8 bad
Only paid spigot forks support 1.8.8 till this day
Velocity then XD?
but they can be unstable
Yeah i mean 1.8.9
sorry
1.8.9 isn't a server version
which only newer versions of spigot got 1.12+ (basically private devs backported it to 1.8)
sry wdym container
So what version of spigot is for the 1.8.9
It's jsut and object that contains fields
1.8 works with any 1.8 sever version
1.8.8
ty
i'm trying to input a single number though?
Input the object as the parameter
its for steppable algorithm, each step checks one block around an origin
System.out.println("nodeIsValid Called");
System.out.println("0");
PathLocation location;
PathBlock block;
try {
System.out.println("1");
location = node.getLocation();
System.out.println("2");
block = location.getBlock();
} catch (Exception e) {
System.out.println("3");
e.printStackTrace();
return false;
}
System.out.println("Got block: " + block);
System.out.println(block);
Im so confused - i get this output:
nodeIsValid Called
0
1
2
You could always bitshift
try removing last declaration from try block
sometimes it does like that
that it silently crashes internally
i've encountered something like this before too
Sorry for the off-topic question. But how do mods in minecraft divide the executable code inside themselves into client and server parts? The mod is both on the server and on the client, and the server part of the mod needs to somehow communicate with the client. For example, I have a mod that adds a new gun. When I issue this gun to myself, some of the functions it uses need to be done on the server side, and some of the functions just can't be done on the server. How is it shared?
Is the game involved in all sending packages and other rubbish? Doesn't this happen inside the mod itself?
Packets
can you elaborate a little more?
The game has the networking channel for sending data but the mod needs to create and send the packets using that channel
@cursive sand if youβre just worried about teleportation you can listen to the teleport event instead of movement
Less expensive
{
if(pos1.getWorld() != pos2.getWorld())
return null;
World world = pos1.getWorld();
ArrayList<Block> blocks = new ArrayList<>();
int x1 = pos1.getBlockX();
int y1 = pos1.getBlockY();
int z1 = pos1.getBlockZ();
int x2 = pos2.getBlockX();
int y2 = pos2.getBlockY();
int z2 = pos2.getBlockZ();
int lowestX = Math.min(x1, x2);
int lowestY = Math.min(y1, y2);
int lowestZ = Math.min(z1, z2);
int highestX = lowestX == x1 ? x2 : x1;
int highestY = lowestX == y1 ? y2 : y1;
int highestZ = lowestX == z1 ? z2 : z1;
for(int x = lowestX; x <= highestX; x++)
for(int y = lowestY; x <= highestY; y++)
for(int z = lowestZ; x <= highestZ; z++)
blocks.add(world.getBlockAt(x, y, z));
return blocks;
}``` i put 2 positions but it returns [ ] theres no blocks in the list, why is this happening? they are blocks, there are no void/air blocks
Oh. Okay. Thanks
for(int y = lowestY; x <= highestY; y++)
same with Z
thats the same as what i have?
read teh line
No it isnβt
copy/paste error
You have a typo in yours
Actually Elgar was pointing out the typo so it is the same as yours
i dont get it
But thatβs because he wasnβt giving you fixed code, just explaining the issue
x <= highestY
Same for your z
Hey, I want to store data about players (e.g. money and brooms_mounted) and access it & update it (+1, -1, etc) on multiple servers on one BungeeCord network.
We have a dedicated machine and don't often have more than 20 players but I'd like whatever solution to be able to scale up to 100 players without crashing the server.
Is the best route to just query & update the SQL tables every time they're needed? (could be up to like three times a second, per player)
If not, any advice? I know when swapping BungeeCord servers onJoin is called before onQuit, so I want to avoid loading into a map or something then saving on exit.
I tried to have a google for Spigot threads addressing this but couldn't find any. Still looking now but if anyone knows of any and could send them over that'd be super helpful too
3 times per second per player for 100 people isnβt that much but youβre still probably better off caching that data
Why are you querying it so much per second anyway
how would i use bitshifts here
It's more of an absolute-maximum than a likely-going-to-happen thing. For example if they do 3 actions that we want to store stats for in 1 second then we need to update all 3 action's data
Such as?
bump
Having read your earlier explanation you wouldnβt need bitshifts here, you just need a method to convert an int into a coordinate tuple
It seems like youβve already articulated the specific conditions to apply to the number
What is your question?
Yeah I need help to come up with that method
Does an answer to this question change your answer? It's really a worst-case use-case specific to our server
The type of actions youβre storing should dictate the strategy you use to store them
So yes it does
I have a yml question here, is it possible to have smt like this that is infinitely expandable?
events:
- event1:
- type: pvp
- reward: money
- event2:
- type: duel
- reward: points```
can you explain what you are doing better?
or better make a thread
hello
Δ± write mc puligin how to make console message send message discord channel
@ornate patio you need to start by defining your concept of a βlayerβ
Do you know Java
Is the number you are entering like (1) the layer?
x, y, and z offsets from a single number
@eternal oxide
Very dumb question, but how would I use an if check to determine if a player has a certain permission?
if (player.hasPermission(βhiβ))
Thank you!
is there an event that gets called when a villager picks up a job
',' or ')' expected``` ```java
if (sender.hasPermission(βtestβ)) {```
declaration: package: org.bukkit.event.entity, class: VillagerCareerChangeEvent
The type of actions youβre storing
Oh nvm, I'm dumb
those quotation marks look weird
Last dumb question: java no-permission-message: "<gradient:#FF0000:#FF3DC5>You don't have the "<permission>" to use this command!</gradient>" How could I use ' and " in my config.yml file?
"test"
this wasnt toward u i was just checking something
escape them
usually done with \ character
no-permission-message: "<gradient:#FF0000:#FF3DC5>You don't have the \"\<permission>\"\ to use this command!</gradient>" like this?
looks like it should work
Thank you!
what is the easyest way to check if a player (or just an entity) is standing on/in a block
i tried EntityEnterBlockEvent, turns out that for bees entering there hives :/
how would i increase the price of villager trades?
inflation
there is Villager#getRecipes @red sedge
unmodifiable so you have to get, change, set
in PacketPlayOutPlayerInfo what is a b c and d in 1.18.2
do you mean to escape special characters? if so, you need to append \ before each special character to not confuse parser that its not a new string or whatever
cross-reference the serialization with wiki.vg
and see for yourselfd
Alright thank you!
perfect site for this
or you paperweight userdev
and remap your jars π
Alright thank you
damn that tool is useful
ikr
I generally just figure it out by myself but it could help me out in the future
flashbacks to rebuilding and updating a world gen from an obfuscated jar
but reflections dont get remapped since you provide method names or field names in a string format
ooh fancy
NMS accessor autogen
you can setup gradle so your spigot plugin can support NMS multiple versions without bothering to implement a system for yourself
hi
@EventHandler
public void OnBed(PlayerBedEnterEvent event) {
if(event.getPlayer().isSleeping()) {
event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,1000, 1));
event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SATURATION,1000, 1));
}
}
Did you register your event?
yeah
event.getPlayer().isSleeping() could return the player if he is in deep sleep
outher event working
Wait, what is deep sleep?
yeah
imma make a PR to add PlayerMimirEvent
what should i change
try removing event.getPlayer().isSleeping()
maybe check for getSleepTicks
whenever a discount applies to a villager it decreases the price multiplier right?
and check if that is greather than 0
why bother checking sleepticks when an event is fired when he's in bed
wdym
if remove all time give effect
When do you want it to happen then?
that's... the objectiv
with paper you can setup a gradle project that way you can use mojang's mappings which allows you to see NMS without obfuscation and reobfuscate your jars for usage in minecraft spigot servers
check x y z ?
basically fields like aW b z will be converted to normal source code names, but when you compile your plugin it would revert back
to support obfuscated minecraft server software (spigot, sponge)
Uh, you know you can do that with spigot too right? Also with maven.
@mortal hare So I create a new paper project with gradle so I can see the mappings?
hey is there any way to cancel swimming? I tried cancelling the EntityToggleSwimEvent event, and setting LivingEntity.setSwimming to false, but neither seems to have any effect.
alright
(pretty new to plugin development, so I have no idea if I'm even going about this in a sane way)
I don't think there is an easy way to do it without NMS. The client will still play the swimming animation in several cases.
im honestly pretty certain just stop sprint would work ngl
I'll give it a try, thanks
allright
do u just reply to people at random
the animation is much less important to me than the changed movement and the changed hitbox that comes from swimming
this doesn't seem to do anything either...
if i add a passenger to an armor stand i cant move it anymore, is there a way around this?
Wdym by move?
teleport
ive tried https://www.spigotmc.org/threads/teleport-entity-with-passenger.223261/ but [23:05:30 WARN]: java.lang.IllegalArgumentException [23:05:30 WARN]: at jdk.internal.reflect.GeneratedMethodAccessor21.invoke(Unknown Source) [23:05:30 WARN]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) private static final Method[] methods = ((Supplier<Method[]>) () -> { try { Method getHandle = Class.forName(Bukkit.getServer().getClass().getPackage().getName() + ".entity.CraftEntity").getDeclaredMethod("getHandle"); return new Method[] { getHandle, getHandle.getReturnType().getDeclaredMethod("b", double.class, double.class, double.class, float.class, float.class) }; } catch (Exception ex) { return null; } }).get();
rip
a
You'll have to dismount and remount passengers if you are teleporting them. It's a limitation of the game, but at least it can be worked around.
imagine using reflection π€‘
whats wrong with reflections sometimes it is needed
and you have no way to access for example protected field or method
I'm still waiting for the day where someone makes a hardware-optimized minecraft server OS
sounds like a fun project ngl
thats not gonna happen
sounds cursed
saw a guy make a tetris OS, how hard would it be to impl the minecraft protocol
it is hard
have fun with chunks
there's open source project called glowstone which is alternative to NMS server software
it supports 1.12.2
at max
Lmao, I bet it'd be really hard with mojang's shotty code.
its not as if the community cant build new server software its just that the community cant keep up with mojang's roadmaps and maintain totally different server software by replicating mojang's gameplay functionality in their own software. Cat and mouse game. Its the same for spigot and paper, but its way easier to modify existing codebase rather than implementing the codebase yourself
I mean from scratch
Tetris isnβt constantly changing and adding new features like minecraft
i saw that dude creating that tetris OS too
what native minecraft server codebase currently lacks is concurrency
but its very hard to achieve that
especially with current minecraft's server architecture
iirc theres work to do this with the client going on rn
an OS dedicated to just running the game
its possible to make optimized version of JVM just for minecraft
but it would be the same as writing new server software, in which case it would make no sense, because whenever minecraft update rolls out, you'll need to update it
how can I design my EntityTargetLivingEntityEvent to disable Mobs being able to target players, specifically through barrier blocks?
im okay with setting up my event, but idk how to actually design the barrier bit
What is the best library to manage inventories and is it useful to use one if you have always used the default inventory system?
In my opinion what should spigot/paper should do is to add an option to decouple api methods and optimizations from server software
that way you can make hardcoded modifications to server software without having api overheads
What?
add an option to build tools
to build a jar without bukkit api in it
and without its NMS traces
completely removing bukkit api with its hooks inside NMS
with only optimizations and patches left out
and maybe plugin support
but without any api methods or fields
So you want build tools to just build the minecraft server jar from mojang?
no
I want buildtools to build a JAR which has all the paper's optimization patches but without bukkit api support
Why
thx it look good
Also build tools has nothing to do with paper
there's no reason for public use, but for private use, you're removing the overhead of api hooks inside NMS
thus a bit improving performance
Theyβre not going to just release an optimized vanilla jar lol
for example there's a bunch of api hooks inside ServerGamePacketListener class which could be removed
Hey ! I need your help for a plugin, I don't know how I can get an item when I click him on another item in a inventory, thx for advance
Thatβs not what spigot is
knowing well that NMS is mostly single threaded it would benefit CPU usage
The purpose of spigot is the plugin API, not to release an optimized version of vanilla
why not give an option to remove the api inside build tools
If you want to do that you can fork it and do it yourself
if they can inject patches into NMS they can sort those patches into front end and back end patches as well
Because that would require work on something that isnβt what they want to do
They arenβt trying to make an optimized vanilla jar
I bet hypixel does something like this
Hypixel uses the plugin API lmao
they have some kind of stripped out version of spigot fork
They use the bukkit/spigot api for their stuff
For the most part
The api hooks are not meaningfully impacting performance
And itβs not the bottleneck you think it is
?paste
Hey ! I need your help for a plugin, I don't know how I can get an item when I click him on another item in a inventory, thx for advance
look how much is being done just to support that event
none of this is being used in NMS internally
Almost nothing, in terms of performance
each container has clicked method
Youβre talking about microseconds
Thatβs not the issue with Minecraftβs performance by any means
Lmao
InventoryClickEvent#getCursor()
Ok it's what I do I have just fail something, thx
can someone explain me the purpose of Optional<>?
cant you just use IF statement?
it get it in C/C++ where you cant return null values
but in Java?
huh??
imo @Nullable and @NotNull are better served than using Optional
With Bukkit Teams, do you have to be part of the team to see the prefix or you can see their prefix without being part of the team?
Anybody know this?
you have to be on teh same scoreboard
If they are on the same scoreboard but different team
Let's say for each player there is a different team
I'll see their team's prefix
if its on always
then everyone can see it
Aight thanks that was my question
I was planning on adding a "controll [player]" command to my troll plugin, would it be a good way to
- cancel the victims movement event
- make the controlling player invisible
- teleport the victim to the controller every tick
?
I was also thinking about some additional events like cancelling the victims chat event and replacing the controller's name with the victim's name when he is typing
Are there any other events I should take care of?
maybe when the controller executes a command execute it as the victim? could be useful for /msg or /whisper stuff
Optionals are for FP in java iirc
Hi, is there a way to modify the villager trades a player sees without changing the villager's original MerchantRecipes?
No
Actually wait
You can add recipes
But you'd have to change the original merchant recipe list for thag
Yeah, you can add and remove MechantRecipes to a villager's list. But I'd like to modify the recipes of the list and allow the player to trade with those modified recipes without permanently modifying the original MechantRecipes.
Maybe I could store the original MechantRecipes as PersistentData in the villager
Confused why you would want to do this
I was thinking of allowing emerald prices to be higher than 64 emeralds by swapping for emerald blocks whenever the prices go over 64
Ugghh, I'm trying to figure out how to make this file system work with what I want it to be able to do. This is my resources folder. Some of these files are critical to the plugin's functionality. Namely config.yml, defaults.yml, overrides.yml and at least one of the locale files.
Right now, I have all of these files being created with a mess of code.
Most of the files are created with this FileManager class: https://paste.md-5.net/uyeduwovos.java
All of the language files are created with this bit of code in the main class: https://paste.md-5.net/emesabizet.cs
The problem I'm having is trying to balance how I should manage them all. My current idea is to have each individual system have control over their respective files, but I'm worried that would lead to a bunch of repeating code. (E.G. The language files would be handled by a LangaugeManager class. The mysql files would be handled by the MySQLDataManager, etc)
The other problem with this is figuring out how to get consistent verbose output. I want to be able to see if anything went wrong at startup in an easy to read format. If it's not done in a certain order, the output could be broken up between other parts of code that run first.
I've been trying to hack something together, but I'm just stuck right now. What should I do about this?
File systems can be a massive hassle. I actually have my own configuration utility called ConfigUtils all you need to do is pass in a plugin instance and file path super easy to use this could help you with repetitive file code you could extend this or take a look at the code and see what you want. I use this for all of my configs. While I'm sure this isn't the best util out there it really helps me make stackable configs which I'm using in my upcoming gui plugin
https://github.com/Reecepbcups/ServerTools-MC/blob/main/src/main/java/sh/reece/tools/ConfigUtils.java
Credit to reece here for making it and sharing with me I love it and couldn't imagine using anything else
new SimpleDateFormat("MMMM-dd-yyyy_HH:mm:ss-a"); what kind of format is this lol
locale_owo.yml ?
im gonna need a few text samples from that file
lol. That file is just going to be run through this tool. https://github.com/nkomarn/owoifier/blob/master/src/main/java/xyz/nkomarn/owoifier/util/Owoification.java
Just a bit of fun for the people who want to mess with plugin settings.
I'd love to mock up you some code with the util I use but I can't as I'm on my phone
But it should make your life less hell
I was going to just loop through #getKeys(true) and run the strings through the #owoify method, but if you've got a better solution, I'm down.
That method seems fine to me. But the code your shared seems like a mess
I'd create languagemanager object
Oh, it's definitely a mess. I'm fully aware of that fact. xD
Also, I'm not sure if that configutil is going to work for my case. I don't use config versioning as I change/rearrange stuff way to often.
It's part of the reason why I created this thread. https://discord.com/channels/690411863766466590/991327724918550579
Wdym config versioning
That section in configs called version and there is a comment above it saying to never change it. Usually at the top.
Oh wait, I forgot I already have a language manager. https://paste.md-5.net/ovezeqinap.java
Lmfao
Ofcourse you do ahahha
Sorry for being late but itβs to enforce and emphasize programβs correctness in terms of behavior
Because well⦠literally everything in Java can be null
sure @smoky tinsel and @urban grotto can fix itβ¦ but they donβt enforce it
Woops
That's there fault lmao
Optional shows your intention of absence of a value more clearly
Yea, the problem is that things are a mess right now. It's kinda screwing me up. What I want is for all of the files to be created at startup, then double check to see if they are there when reloading the plugin. The language files are actually a separate system right now, but I have that one bit of code in the FileManager that creates an english language file on startup.
?paste
The util I sent should help create condfigs easier it's got no versioning nor updator its kinda. A bare bones of my friends
I have this code: https://paste.md-5.net/nupehutayu.java
When I try to do anything inside the anvil (rename/repair) nothing happens.
How could I fix this?
I'm honestly debating whether or not I actually need that class right now. Because most of these files will be handled by separate classes.
Wait, why didn't I think of this?
This is the only config util I use
Just hope you donβt call this every second or even more frequently as that would make an io call since it uses YamlConfiguration::load
I was wondering about that. I know that spigot caches the main config by default. Was thinking if it would be problematic to call that frequently or not.
Yes
π
Many poor plugins use that factory method relentlessly
Does YamlConfiguration#loadConfiguration() also cache the file? Or does it just do what you'd expect?
No
Itβs just sugar for using new YamlConfiguration(), followed by load()
and automatic error handling
Don't spam call getConfigFile I only use it once on enable
and load makes an io call whenever called
Gotcha. My current implementation is right then. I create an object, load it, then pass it around to where I need it. I'd like to keep it that way. π
player.setWalkSpeed(0.2f); what's the max value I can use here?
I think speed maxes out at 1F.
Perfect, thank you!
How could I do something like if (args[0] >= 10)?
Basically I need to see if args[0] is greater than or equal to 10
Hmm, how would I store it into a variable? Integer.parseInt(args[0]); (I'm very new to java, sorry)
?learnjava
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.
Heh, I'll do those
How make variable lol
I know a few variables, but I've never used more than about 3 xd
yeah ive used a few variables in my day
Variables are pretty nice
One more thing, how could I do something like player.setWalkSpeed(speedf); As I believe I need the f there for this to work the way I need it to.
speed is a variable (int)
Either cast it, or in this case, just make your speed variable a float.
Could you elaborate float a bit, please?
float speed = 0.2F;
float = floating point (32 bit in memory)
double = double precision floating point (64 bit in memory)
float is to double what int is to long.
This wont compile
fixed.
int myInt = 18;
double myDouble = 0.2;
float myFloat = 0.5F;
long myLong = 8_301_275_578L;
short myShort = 255;
byte myByte = 2;
char myChar = 94;
Just some examples of the different types of variables you can use.
float -> double
float f = 0.5F;
double d = f;
double -> float
double d = 0.5;
float f = (float) d;
3.3333333333333335 enjoyer
Integer speed = integer / 10;
float f = speed;
double d = f;
player.setWalkSpeed(f);``` Like this?
or am I horribly mistaken?
?learnjava
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.
Is PersistentData kept after a transformation?
wym
Define transformation.
Anything that might call the EntityTransformEvent
wouldnt be very persistent if it wasnt persistent now would it
I'm not sure if that event applies to items.
I was just making sure
I believe it doesn't but mobs can also store PersistentData en they do transform
Unless you are changing persistent data on said item, then it should be preserved. Not sure about entity transformations though.
You'd probably want to test that.
Would be a nice feature. Thats something ive always missed. Random events vanishing my data.
Hi I'm experiencing some really odd behavior with inventory events. I'm using paper api, but I dont think its an issue with paper. For all InventoryClickEvents and all InventoryDragEvents in the player inventory the inventory type is always CRAFTING which is not the expected behavior as per the docs https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/inventory/InventoryType.html
The documentation says that any interactions within the 4x4 crafting grid and result slot should be CRAFTING and any interactions within the 36 player inventory slots as well as offhand and armor should be type PLAYER. This is my code:
@EventHandler
public void onPlayerInventoryClick(final InventoryClickEvent e) {
e.getWhoClicked().sendMessage("Click: " + e.getInventory().getType());
}
@EventHandler
public void onPlayerInventoryDrag(final InventoryDragEvent e) {
e.getWhoClicked().sendMessage("Drag: " + e.getInventory().getType());
}
And in game I get this output where ever I click
declaration: package: org.bukkit.event.inventory, enum: InventoryType
Help would be appreciated
Which part of the inventory are you clicking on?
I tried every slot in the player inventory
all hotbar slots, upper inventory, offhand, armor, and crafting grid
I get CRAFTING for every slot no matter what
Ah, It's probably due to the InventoryView. If you grab the bottom inventory, you'll get the PLAYER type.
InventoryClickEvent#getView#getBottomInventory()
ah ok weird
does getInventory return the top inventory by default which is the crafting grid?
I think it returns the top inventory by default.
But even then I'm not sure.
I've had weird experiences with it too.
thats really unintuitive if thats how that works
Well it had something to due with how inventories changed in a certain version.
It used to be simple.
oh i see
Now it's split up.
The "inventory" that you expect is now an InventoryView.
It contains both the top and bottom parts of the inventory.
OHH
i see
so the base Inventory class contains both the top and bottom views
and each view has its own type
Yea. As for how it derives the type, I have no clue. It could get it from the top inventory, but don't quote me on that.
the weirdest part is that you cant get the views from just the Inventory object
so idk how tf it actually works behind the scenes but it looks like a huge mess
:mojank:
Is there any server dedicated to making plugins?
many
I cant find anyone that actually has motivation
It was annoying learning how to get the proper inventory with that update. It also moved the #getTitle method to the view as well.
Can i have an invite
yeah I noticed that and its terrible
well what are you looking for exactly
I am lookking for someone to create a custom plugin
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
And who wont ghost me for a month after it is 99% done
anyone knows what's the event triggered by a item frame being broken or losin what it is framing?
If it's by a player, try the EntityDamageByEntityEvent. If it's a natural break, try checking the HangingBreakByEntityEvent
I still think a requests channel should exist lol. So many messages about requests recently 
to anyone who understands nms, why does my horse randomly do this lmfao https://medal.tv/games/minecraft/clips/qXc8MG6XBBKiZ/d1337NsBSpWZ?invite=cr-MSxiWGYsMzE3NzQ5ODgs
Watch rapidly spinning horse and millions of other Minecraft videos on Medal, the largest Game Clip Platform.
i've got an vector object as string (out of an location object, it's the direction). how to cast this back into a location? i cant get this as Vector object, only as string
it's a string such as this: -0.0,1.0,6.123233995736766E-17 and i want to set the direction of an locationobject with this data
That would be Double#parseDouble If anything
String#split and Double#parseDouble I guess
Having 100 Minestom instances
why is it even a string at the first place?
its cause it comes via an command, cause i want an onclickable text and thats the only option to react to an onclickable text. just believe me, that is only can be a string
If it comes via a command I'd replaced the commas with whitespace
That would avoid a String#split call and be more intuitive
jap, that seems nice, but idk if i can do this... i've got to split the string anyways. thy
is this kind of yaml possible? ```yml
events:
- eventOne:
- ID: 1
- description: "Event One"
- action: "kill"
- type: "ZOMBIE"
- amount: 100
- reward: "money"
- rewardAmount: 100
- rewardTopOne: "money"
- rewardTopOneAmount: 100
- rewardTopTwo: "money"
- rewardTopTwoAmount: 100
- rewardTopThree: "money"
- rewardTopThreeAmount: 100```
would it be like events.eventOne.ID etc?
Hey, tried making my first plugin today, but I'm getting a couple problems when I try and run it on my test server. For starters I get the following problem...Legacy plugin FirstPlugin v1.16.5 does not specify an api-version.
Ok thanks, also the 'version' in the plugin.yml is referring to a minecraft version or something else?
Or is it just kind of version bookkeeping just for my understanding.
Ok and assuming it's my plugin it would just be 1 then lol
Sweet thanks
u can represent it in any way
Ayy first plugin works
I'm attempting to make a speed command like Essentials... https://paste.gg/p/anonymous/983b475ede704ac49c4d55b56ee00f05
How could I make that work? Right now, anything lower than 10 just freezes you.
You're doing an integer division
Since your speed is lower than 10, speed / 10 = 0
Just do a float division : speed / 10.0 ;)
So that it will give something between 0 and 1
no....
walkspeed is from 0.0 to 1.0
example 7 / 10 = 0.7
float walkspeed = (speed / 10.0);
float
Provided:
double```
Ah, thank you!
why when i use a command on my plugin the tps goes from 20.00 to 19.40
Default speed is 0.2f, correct?
yes
Perfect, thanks!
Perhaps the command is written in a way that makes it inefficent?
whats the best way to create minigame servers
i'm thinking a prefab system
Depends really
it enables the vanish to the player
what do i use instead of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#isOnGround() ?
declaration: package: org.bukkit.entity, interface: Player
but when nobody's online the tps lags a lot
Check If there is a Block below the Players foot
That doesn't Nail it down much more
What do you want it to do?
create minigame servers on the fly
for players who wanna play
or well - just servers in general
Sounds kinda #help-server anyways
i'm programming it
Generally you probably wanna use a profiler or sth to see what exactly causes it under the hood, Iβd recommend using sth like spark.
lagging when no one is online would seem to indicate a serious issue with code running that shouldn't
command sux? idk
What no? π yes
Send your code
GG, you jumped into this rabbit hole and never gonna go back. Make cool stuff! :D
or contribute to cool stuff
Yea
never gonna give you up
same
I need a list of spigot projects
π
i want to contribute to open source and use spigot to start off
here you go
have fun making a chunk cache so we can access unloaded chunk snapshots
this was a good one but i suck at pathfinding and 3d shit
hehe i m doin the 69th problem in my assignment right now
otherwise contribute to my overwatch idea
send link π«
which does not exist yet
oh
i had an idea
i make a script that downloads every spigot plugin using resource ids
csgo overwatch... hypixel atlas...
and then malware check them?
we have Optic for this
this can turn out great
but im too lazy to make it
at least not motivated enough to make it alone
yea i just yoinked his idea
but he didnt check all plugins
better tree api maybe
have fun wasting your time on this
it will take time and even afterwards you have to check them manually
why?
your script will not find everything
well ill use that antimalware plugin thing
oh u know what i did see from paper that make be a nice duplicate plugin number 2948282?
world size
how much disk space a world takes up
i should make a plugin that would delete it self
and then delete the server
and slowly takeover the world
π
i think thatll get u banned from spigotmc.org
what if he states in the description that it does exactly what he just said?π€
In that case it's a feature and not a malicious intention
or include a bot net into your plugin π
include minecraft in your plugin
so the server admin can play mc while the servers running
dunno what that means but ok
smart idea
maybe render minecraft using ascii in server terminal
how would i go about making a plugin to stop endermen teleporting onto bottom slabs
Check for EntityTeleportEvent and cancel if entity is enderman and block is bottom slab
is there any way to add spaces between "accept and deny" ?
Make a text component space?
or just add a space after accept
but that will make it clickable
so yeah, space component
yea but it will make it clickable too
I want to make it only clickable on text
make a text component without any click action
that is only a space